jcmvbkbc wrote:RostakaGmfun wrote:What I actually want to do (figured this out right now) is to move 3rd party library .text segment from .text section to .irom0.text. How can I do this?
You can do it by changing your ld script like this:Code: Select all--- eagle.app.v6.ld 2015-07-08 17:40:50.321595028 +0300
+++ eagle.app.v6.ld.mod 2015-07-08 17:42:46.079819303 +0300
@@ -157,6 +157,14 @@
} >dram0_0_seg :dram0_0_bss_phdr
/* __stack = 0x3ffc8000; */
+ .irom0.text : ALIGN(4)
+ {
+ _irom0_text_start = ABSOLUTE(.);
+ *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
+ path/to/3rd_party_lib.a:*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
+ _irom0_text_end = ABSOLUTE(.);
+ } >irom0_0_seg :irom0_0_phdr
+
.text : ALIGN(4)
{
_stext = .;
@@ -204,13 +212,6 @@
*(.gnu.linkonce.lit4.*)
_lit4_end = ABSOLUTE(.);
} >iram1_0_seg :iram1_0_phdr
-
- .irom0.text : ALIGN(4)
- {
- _irom0_text_start = ABSOLUTE(.);
- *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
- _irom0_text_end = ABSOLUTE(.);
- } >irom0_0_seg :irom0_0_phdr
}
/* get ROM code address */
where path/to/3rd_party_lib.a is the exact path used in the link command.
Hell yeah! It seems to be working! Thanks a lot