Open klew opened 1 year ago
It looks like there are two sections: .flash.text and .flash.rodata which "start" should be in different 64 KB flash region.
Disabling asserts is reducing text
section to very small one ( < 64 KB) and it causes above linking error.
For some reason, it is not a problem for linker if text
and rodata
share the same sector when text
length is > 64 KB.
Anyway linking problem can be resolved by adding ALIGN(64K) to text
section, as follows:
diff --git a/components/esp8266/ld/esp8266.project.ld.in b/components/esp8266/ld/esp8266.project.ld.in
index 54d7bb48..ce1decc2 100644
--- a/components/esp8266/ld/esp8266.project.ld.in
+++ b/components/esp8266/ld/esp8266.project.ld.in
@@ -175,6 +175,7 @@ SECTIONS
*(.fini.literal)
*(.fini)
*(.gnu.version)
+ . = ALIGN (64K);
_text_end = ABSOLUTE(.);
_etext = .;
It fixes linking but it make binary file a little bit bigger. I'm not very familiar with ldgen, so if there is away to add this align conditionally, then it would be better solution.
Environment
Problem Description
I would like to get rid of file paths from my local PC in "bin" file. I thought this was caused by logging assertions, so I tried to silent assertions, but paths were still in bin file. Then I disabled assertions by setting:
However this breaks linking with following error:
Expected Behavior
hello_world example should compile and link with disabled assertions.
Actual Behavior
Linking fails when assertions are disabled.
Steps to repropduce
Here is output from objdump: