-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable libstdc++ v2 #146
base: master
Are you sure you want to change the base?
Enable libstdc++ v2 #146
Changes from 11 commits
2b1466d
15b1ddd
e155241
e94334a
e49011b
6eb43c1
0f6e9c4
c6c0de4
f12244f
85469d0
fc46726
dc6db5b
1706c91
661e4bd
6a6596d
2d1bc6c
fea6183
464d551
26910ae
f9765de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
--- esp_iot_sdk_v1.5.2/ld/eagle.app.v6.irom.ld.orig 2016-04-01 09:11:42.171496836 +0300 | ||
+++ esp_iot_sdk_v1.5.2/ld/eagle.app.v6.irom.ld 2016-04-07 09:52:31.502596929 +0300 | ||
@@ -102,11 +102,14 @@ | ||
*(.gnu.linkonce.e.*) | ||
*(.gnu.version_r) | ||
*(.eh_frame) | ||
+ . = (. + 3) & ~ 3; | ||
/* C++ constructor and destructor tables, properly ordered: */ | ||
+ __init_array_start = ABSOLUTE(.); | ||
KEEP (*crtbegin.o(.ctors)) | ||
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) | ||
KEEP (*(SORT(.ctors.*))) | ||
KEEP (*(.ctors)) | ||
+ __init_array_end = ABSOLUTE(.); | ||
KEEP (*crtbegin.o(.dtors)) | ||
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) | ||
KEEP (*(SORT(.dtors.*))) | ||
@@ -151,6 +154,15 @@ | ||
} >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) | ||
+ *libm.a:(.literal .text .literal.* .text.*) | ||
+ *irom.a:(.literal .text .literal.* .text.*) | ||
+ _irom0_text_end = ABSOLUTE(.); | ||
+ } >irom0_0_seg :irom0_0_phdr | ||
+ | ||
.text : ALIGN(4) | ||
{ | ||
_stext = .; | ||
@@ -182,7 +194,7 @@ | ||
*(.entry.text) | ||
*(.init.literal) | ||
*(.init) | ||
- *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) | ||
+ *(.literal .text .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) | ||
*(.fini.literal) | ||
*(.fini) | ||
*(.gnu.version) | ||
@@ -198,14 +210,8 @@ | ||
*(.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 */ | ||
INCLUDE "../ld/eagle.rom.addr.v6.ld" | ||
+ | ||
--- esp_iot_sdk_v1.5.2/ld/eagle.app.v6.new.2048.irom.ld.orig 2016-04-01 09:11:42.175496836 +0300 | ||
+++ esp_iot_sdk_v1.5.2/ld/eagle.app.v6.new.2048.irom.ld 2016-04-07 09:53:01.086596929 +0300 | ||
@@ -102,11 +102,14 @@ | ||
*(.gnu.linkonce.e.*) | ||
*(.gnu.version_r) | ||
*(.eh_frame) | ||
+ . = (. + 3) & ~ 3; | ||
/* C++ constructor and destructor tables, properly ordered: */ | ||
+ __init_array_start = ABSOLUTE(.); | ||
KEEP (*crtbegin.o(.ctors)) | ||
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) | ||
KEEP (*(SORT(.ctors.*))) | ||
KEEP (*(.ctors)) | ||
+ __init_array_end = ABSOLUTE(.); | ||
KEEP (*crtbegin.o(.dtors)) | ||
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) | ||
KEEP (*(SORT(.dtors.*))) | ||
@@ -151,6 +154,15 @@ | ||
} >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) | ||
+ *libm.a:(.literal .text .literal.* .text.*) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think about taking the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. But i'd build libmirom the same way as other *irom libs are done now (see my previous comment). |
||
+ *irom.a:(.literal .text .literal.* .text.*) | ||
+ _irom0_text_end = ABSOLUTE(.); | ||
+ } >irom0_0_seg :irom0_0_phdr | ||
+ | ||
.text : ALIGN(4) | ||
{ | ||
_stext = .; | ||
@@ -182,7 +194,7 @@ | ||
*(.entry.text) | ||
*(.init.literal) | ||
*(.init) | ||
- *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) | ||
+ *(.literal .text .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where did There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for pointing me to this. This is definitely my fault. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Funny enough. I tested micropython with this. Since these sections are not in .text they end up in .lit. So actually their location in RAM is changed, but because they are still in RAM the linker script creates working binaries. |
||
*(.fini.literal) | ||
*(.fini) | ||
*(.gnu.version) | ||
@@ -198,14 +210,8 @@ | ||
*(.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 */ | ||
INCLUDE "../ld/eagle.rom.addr.v6.ld" | ||
+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it has pretty much been established that this
objcopy
doesn't do anything useful, might it not be more efficient to just usecp
instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to agree, but there is one argument against this approach. I tried to keep backward compatibility meaning the patch mustn't break solutions which worked before. If we change libstdc++irom just to a copy we either keep inconsistency between the way how libcirom is built and the way how libstdc++irom is built or we may break those solutions which used libcirom assuming that the functions inside are packed into .irom0.text.
So i'd rather keep it the way it's done now to keep backward compatibility and unified way of building *irom libs.