From 8134a4910ccda6cb579e2d622c75d5dbd8a799a7 Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Mon, 4 May 2020 17:33:56 -0700 Subject: [PATCH 1/2] Bump ldscript-generator for ITIM ffunction-sections Signed-off-by: Nathaniel Graff --- scripts/ldscript-generator | 2 +- wit-manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ldscript-generator b/scripts/ldscript-generator index 4ea12ca67..fbb56a8cc 160000 --- a/scripts/ldscript-generator +++ b/scripts/ldscript-generator @@ -1 +1 @@ -Subproject commit 4ea12ca67dbe0b47ab3b247256b5a1322599c848 +Subproject commit fbb56a8cc29eb5e4f31a8169069ae2ab8002a011 diff --git a/wit-manifest.json b/wit-manifest.json index 30ddb1612..a07913bdb 100644 --- a/wit-manifest.json +++ b/wit-manifest.json @@ -20,7 +20,7 @@ "source": "git@github.com:sifive/devicetree-overlay-generator.git" }, { - "commit": "4ea12ca67dbe0b47ab3b247256b5a1322599c848", + "commit": "fbb56a8cc29eb5e4f31a8169069ae2ab8002a011", "name": "ldscript-generator", "source": "git@github.com:sifive/ldscript-generator.git" }, From 0a13740c54d04612508830b5616a49a273d79e67 Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Mon, 4 May 2020 17:34:11 -0700 Subject: [PATCH 2/2] Regen BSPs Signed-off-by: Nathaniel Graff --- bsp/freedom-e310-arty/metal.default.lds | 21 +++-- bsp/freedom-e310-arty/metal.freertos.lds | 21 +++-- bsp/freedom-e310-arty/metal.ramrodata.lds | 21 +++-- bsp/freedom-e310-arty/metal.scratchpad.lds | 21 +++-- bsp/qemu-sifive-e31/metal.default.lds | 21 +++-- bsp/qemu-sifive-e31/metal.freertos.lds | 21 +++-- bsp/qemu-sifive-e31/metal.ramrodata.lds | 21 +++-- bsp/qemu-sifive-e31/metal.scratchpad.lds | 21 +++-- bsp/qemu-sifive-s51/metal.default.lds | 21 +++-- bsp/qemu-sifive-s51/metal.freertos.lds | 21 +++-- bsp/qemu-sifive-s51/metal.ramrodata.lds | 21 +++-- bsp/qemu-sifive-s51/metal.scratchpad.lds | 21 +++-- bsp/qemu-sifive-u54/metal.default.lds | 21 +++-- bsp/qemu-sifive-u54/metal.freertos.lds | 21 +++-- bsp/qemu-sifive-u54/metal.ramrodata.lds | 21 +++-- bsp/qemu-sifive-u54/metal.scratchpad.lds | 21 +++-- bsp/qemu-sifive-u54mc/metal.default.lds | 21 +++-- bsp/qemu-sifive-u54mc/metal.freertos.lds | 21 +++-- bsp/qemu-sifive-u54mc/metal.ramrodata.lds | 21 +++-- bsp/qemu-sifive-u54mc/metal.scratchpad.lds | 21 +++-- bsp/sifive-hifive-unleashed/metal.default.lds | 21 +++-- .../metal.freertos.lds | 21 +++-- .../metal.ramrodata.lds | 94 +++++++++++++++++-- .../metal.scratchpad.lds | 21 +++-- bsp/sifive-hifive1-revb/metal.default.lds | 21 +++-- bsp/sifive-hifive1-revb/metal.freertos.lds | 21 +++-- bsp/sifive-hifive1-revb/metal.ramrodata.lds | 21 +++-- bsp/sifive-hifive1-revb/metal.scratchpad.lds | 21 +++-- bsp/sifive-hifive1/metal.default.lds | 21 +++-- bsp/sifive-hifive1/metal.freertos.lds | 21 +++-- bsp/sifive-hifive1/metal.ramrodata.lds | 21 +++-- bsp/sifive-hifive1/metal.scratchpad.lds | 21 +++-- bsp/spike/metal.default.lds | 21 +++-- bsp/spike/metal.freertos.lds | 21 +++-- bsp/spike/metal.ramrodata.lds | 21 +++-- bsp/spike/metal.scratchpad.lds | 21 +++-- 36 files changed, 575 insertions(+), 254 deletions(-) diff --git a/bsp/freedom-e310-arty/metal.default.lds b/bsp/freedom-e310-arty/metal.default.lds index 890002580..a4996526f 100644 --- a/bsp/freedom-e310-arty/metal.default.lds +++ b/bsp/freedom-e310-arty/metal.default.lds @@ -23,6 +23,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -148,13 +149,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -186,6 +180,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/freedom-e310-arty/metal.freertos.lds b/bsp/freedom-e310-arty/metal.freertos.lds index 69e1a3dad..609fc2677 100644 --- a/bsp/freedom-e310-arty/metal.freertos.lds +++ b/bsp/freedom-e310-arty/metal.freertos.lds @@ -26,6 +26,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -158,13 +159,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -197,6 +191,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/freedom-e310-arty/metal.ramrodata.lds b/bsp/freedom-e310-arty/metal.ramrodata.lds index d13ef8963..1c7d2eb2b 100644 --- a/bsp/freedom-e310-arty/metal.ramrodata.lds +++ b/bsp/freedom-e310-arty/metal.ramrodata.lds @@ -27,6 +27,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -152,13 +153,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - /* ITIM SECTION * @@ -178,6 +172,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/freedom-e310-arty/metal.scratchpad.lds b/bsp/freedom-e310-arty/metal.scratchpad.lds index dfa78a7ec..10d39084c 100644 --- a/bsp/freedom-e310-arty/metal.scratchpad.lds +++ b/bsp/freedom-e310-arty/metal.scratchpad.lds @@ -24,6 +24,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -149,13 +150,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >ram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -187,6 +181,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >ram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-e31/metal.default.lds b/bsp/qemu-sifive-e31/metal.default.lds index 15de789ea..bc74471dd 100644 --- a/bsp/qemu-sifive-e31/metal.default.lds +++ b/bsp/qemu-sifive-e31/metal.default.lds @@ -22,6 +22,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -145,13 +146,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -183,6 +177,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-e31/metal.freertos.lds b/bsp/qemu-sifive-e31/metal.freertos.lds index 13d225ba2..7108b1d16 100644 --- a/bsp/qemu-sifive-e31/metal.freertos.lds +++ b/bsp/qemu-sifive-e31/metal.freertos.lds @@ -25,6 +25,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -155,13 +156,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -194,6 +188,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-e31/metal.ramrodata.lds b/bsp/qemu-sifive-e31/metal.ramrodata.lds index 307fa44e2..6442a3843 100644 --- a/bsp/qemu-sifive-e31/metal.ramrodata.lds +++ b/bsp/qemu-sifive-e31/metal.ramrodata.lds @@ -26,6 +26,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -149,13 +150,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - /* ITIM SECTION * @@ -175,6 +169,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-e31/metal.scratchpad.lds b/bsp/qemu-sifive-e31/metal.scratchpad.lds index 2c5796526..01dcb8563 100644 --- a/bsp/qemu-sifive-e31/metal.scratchpad.lds +++ b/bsp/qemu-sifive-e31/metal.scratchpad.lds @@ -23,6 +23,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -146,13 +147,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >ram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -184,6 +178,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >ram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-s51/metal.default.lds b/bsp/qemu-sifive-s51/metal.default.lds index 15de789ea..bc74471dd 100644 --- a/bsp/qemu-sifive-s51/metal.default.lds +++ b/bsp/qemu-sifive-s51/metal.default.lds @@ -22,6 +22,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -145,13 +146,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -183,6 +177,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-s51/metal.freertos.lds b/bsp/qemu-sifive-s51/metal.freertos.lds index 13d225ba2..7108b1d16 100644 --- a/bsp/qemu-sifive-s51/metal.freertos.lds +++ b/bsp/qemu-sifive-s51/metal.freertos.lds @@ -25,6 +25,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -155,13 +156,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -194,6 +188,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-s51/metal.ramrodata.lds b/bsp/qemu-sifive-s51/metal.ramrodata.lds index 307fa44e2..6442a3843 100644 --- a/bsp/qemu-sifive-s51/metal.ramrodata.lds +++ b/bsp/qemu-sifive-s51/metal.ramrodata.lds @@ -26,6 +26,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -149,13 +150,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - /* ITIM SECTION * @@ -175,6 +169,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-s51/metal.scratchpad.lds b/bsp/qemu-sifive-s51/metal.scratchpad.lds index 2c5796526..01dcb8563 100644 --- a/bsp/qemu-sifive-s51/metal.scratchpad.lds +++ b/bsp/qemu-sifive-s51/metal.scratchpad.lds @@ -23,6 +23,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -146,13 +147,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >ram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -184,6 +178,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >ram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-u54/metal.default.lds b/bsp/qemu-sifive-u54/metal.default.lds index 333649e95..1f760b2b4 100644 --- a/bsp/qemu-sifive-u54/metal.default.lds +++ b/bsp/qemu-sifive-u54/metal.default.lds @@ -21,6 +21,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -146,13 +147,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >testram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >testram :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -184,6 +178,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >testram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-u54/metal.freertos.lds b/bsp/qemu-sifive-u54/metal.freertos.lds index feaf00469..e4db87285 100644 --- a/bsp/qemu-sifive-u54/metal.freertos.lds +++ b/bsp/qemu-sifive-u54/metal.freertos.lds @@ -24,6 +24,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -156,13 +157,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >testram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >testram :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -195,6 +189,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >testram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-u54/metal.ramrodata.lds b/bsp/qemu-sifive-u54/metal.ramrodata.lds index 8f1df7d50..1eb1b1e26 100644 --- a/bsp/qemu-sifive-u54/metal.ramrodata.lds +++ b/bsp/qemu-sifive-u54/metal.ramrodata.lds @@ -25,6 +25,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -150,13 +151,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >testram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >testram :rom - /* ITIM SECTION * @@ -176,6 +170,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >testram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-u54/metal.scratchpad.lds b/bsp/qemu-sifive-u54/metal.scratchpad.lds index 229751b83..6f3f7be63 100644 --- a/bsp/qemu-sifive-u54/metal.scratchpad.lds +++ b/bsp/qemu-sifive-u54/metal.scratchpad.lds @@ -22,6 +22,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -147,13 +148,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >testram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >testram :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -185,6 +179,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >testram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-u54mc/metal.default.lds b/bsp/qemu-sifive-u54mc/metal.default.lds index 22c5723d7..3697b798f 100644 --- a/bsp/qemu-sifive-u54mc/metal.default.lds +++ b/bsp/qemu-sifive-u54mc/metal.default.lds @@ -21,6 +21,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -146,13 +147,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >testram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >testram :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -184,6 +178,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >testram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-u54mc/metal.freertos.lds b/bsp/qemu-sifive-u54mc/metal.freertos.lds index caa1bae9a..682b0ce44 100644 --- a/bsp/qemu-sifive-u54mc/metal.freertos.lds +++ b/bsp/qemu-sifive-u54mc/metal.freertos.lds @@ -24,6 +24,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -156,13 +157,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >testram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >testram :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -195,6 +189,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >testram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-u54mc/metal.ramrodata.lds b/bsp/qemu-sifive-u54mc/metal.ramrodata.lds index baa030ba8..3f31927fa 100644 --- a/bsp/qemu-sifive-u54mc/metal.ramrodata.lds +++ b/bsp/qemu-sifive-u54mc/metal.ramrodata.lds @@ -25,6 +25,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -150,13 +151,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >testram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >testram :rom - /* ITIM SECTION * @@ -176,6 +170,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >testram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/qemu-sifive-u54mc/metal.scratchpad.lds b/bsp/qemu-sifive-u54mc/metal.scratchpad.lds index 55b804572..50d0fc09b 100644 --- a/bsp/qemu-sifive-u54mc/metal.scratchpad.lds +++ b/bsp/qemu-sifive-u54mc/metal.scratchpad.lds @@ -22,6 +22,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -147,13 +148,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >testram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >testram :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -185,6 +179,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >testram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/sifive-hifive-unleashed/metal.default.lds b/bsp/sifive-hifive-unleashed/metal.default.lds index ded33c0e6..12f2e27a8 100644 --- a/bsp/sifive-hifive-unleashed/metal.default.lds +++ b/bsp/sifive-hifive-unleashed/metal.default.lds @@ -23,6 +23,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -154,13 +155,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -192,6 +186,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/sifive-hifive-unleashed/metal.freertos.lds b/bsp/sifive-hifive-unleashed/metal.freertos.lds index d01bc06b7..f984c78ef 100644 --- a/bsp/sifive-hifive-unleashed/metal.freertos.lds +++ b/bsp/sifive-hifive-unleashed/metal.freertos.lds @@ -26,6 +26,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -164,13 +165,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -203,6 +197,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/sifive-hifive-unleashed/metal.ramrodata.lds b/bsp/sifive-hifive-unleashed/metal.ramrodata.lds index 3b8899a6e..c1fbbd9f8 100644 --- a/bsp/sifive-hifive-unleashed/metal.ramrodata.lds +++ b/bsp/sifive-hifive-unleashed/metal.ramrodata.lds @@ -27,6 +27,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -159,7 +160,6 @@ SECTIONS } >rom : rom - /* ITIM SECTION * * The following sections contain data which is copied from read-only @@ -171,21 +171,97 @@ SECTIONS */ .itim : ALIGN(8) { - /* The .text sections are placed in the ITIM to improve the performance - * of all post-init and non-constructor application code. Note that - * this may cause the program to fail to link if the ITIM is not large - * enough to contain the entire .text section. */ - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) *(.itim .itim.*) + /* The following takes advantage of -ffunction sections to link benchmark + * code into the ITIM when the ITIM is big enough to take advantage of it. + */ + *(.text.startup.main) + + /* Dhrystone */ + *(.text.Func_1) + *(.text.Func_2) + *(.text.Func_3) + *(.text.malloc) + *(.text.memchr) + *(.text.memcpy) + *(.text.memmove) + *(.text.Proc_1) + *(.text.Proc_2) + *(.text.Proc_3) + *(.text.Proc_4) + *(.text.Proc_5) + *(.text.Proc_6) + *(.text.Proc_7) + *(.text.Proc_8) + *(.text.time) + *(.text.strcmp) + *strcmp.o(.text) + + /* Coremark */ + *(.text.barebones_clock) + *(.text.calc_func) + *(.text.check_data_types) + *(.text.clock) + *(.text.cmp_complex) + *(.text.cmp_idx) + *(.text.copy_info) + *(.text.core_bench_list) + *(.text.core_bench_matrix) + *(.text.core_bench_state) + *(.text.core_init_matrix) + *(.text.core_init_state) + *(.text.core_list_find) + *(.text.core_list_init) + *(.text.core_list_insert_new) + *(.text.core_list_mergesort) + *(.text.core_list_remove) + *(.text.core_list_reverse) + *(.text.core_list_undo_remove) + *(.text.core_state_transition) + *(.text.crc16) + *(.text.crcu16) + *(.text.crcu32) + *(.text.crcu8) + *(.text.get_seed_32) + *(.text.get_time) + *(.text.iterate) + *(.text.matrix_add_const) + *(.text.matrix_mul_const) + *(.text.matrix_mul_matrix) + *(.text.matrix_mul_matrix_bitextract) + *(.text.matrix_mul_vect) + *(.text.matrix_sum) + *(.text.matrix_test) + *(.text.memchr) + *(.text.memcpy) + *(.text.memmove) + *(.text.portable_fini) + *(.text.portable_init) + *(.text.start_time) + *(.text.stop_time) + *(.text.time_in_secs) + *(.text.unlikely.core_bench_list) + *(.text.unlikely.core_list_init) + *(.text.unlikely.core_list_mergesort) } >itim AT>rom :itim_init PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/sifive-hifive-unleashed/metal.scratchpad.lds b/bsp/sifive-hifive-unleashed/metal.scratchpad.lds index fa398b335..9728ac70c 100644 --- a/bsp/sifive-hifive-unleashed/metal.scratchpad.lds +++ b/bsp/sifive-hifive-unleashed/metal.scratchpad.lds @@ -24,6 +24,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -155,13 +156,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >ram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -193,6 +187,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >ram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/sifive-hifive1-revb/metal.default.lds b/bsp/sifive-hifive1-revb/metal.default.lds index bd71eb698..893f7a001 100644 --- a/bsp/sifive-hifive1-revb/metal.default.lds +++ b/bsp/sifive-hifive1-revb/metal.default.lds @@ -23,6 +23,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -148,13 +149,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -186,6 +180,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/sifive-hifive1-revb/metal.freertos.lds b/bsp/sifive-hifive1-revb/metal.freertos.lds index 5a8b58540..977f20c24 100644 --- a/bsp/sifive-hifive1-revb/metal.freertos.lds +++ b/bsp/sifive-hifive1-revb/metal.freertos.lds @@ -26,6 +26,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -158,13 +159,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -197,6 +191,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/sifive-hifive1-revb/metal.ramrodata.lds b/bsp/sifive-hifive1-revb/metal.ramrodata.lds index 776e44033..b10926de0 100644 --- a/bsp/sifive-hifive1-revb/metal.ramrodata.lds +++ b/bsp/sifive-hifive1-revb/metal.ramrodata.lds @@ -27,6 +27,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -152,13 +153,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - /* ITIM SECTION * @@ -178,6 +172,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/sifive-hifive1-revb/metal.scratchpad.lds b/bsp/sifive-hifive1-revb/metal.scratchpad.lds index f010fbca9..42ba0d5b5 100644 --- a/bsp/sifive-hifive1-revb/metal.scratchpad.lds +++ b/bsp/sifive-hifive1-revb/metal.scratchpad.lds @@ -24,6 +24,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -149,13 +150,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >ram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -187,6 +181,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >ram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/sifive-hifive1/metal.default.lds b/bsp/sifive-hifive1/metal.default.lds index 53041cd87..d0397abf5 100644 --- a/bsp/sifive-hifive1/metal.default.lds +++ b/bsp/sifive-hifive1/metal.default.lds @@ -22,6 +22,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -145,13 +146,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -183,6 +177,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/sifive-hifive1/metal.freertos.lds b/bsp/sifive-hifive1/metal.freertos.lds index 216788955..cd98c58e3 100644 --- a/bsp/sifive-hifive1/metal.freertos.lds +++ b/bsp/sifive-hifive1/metal.freertos.lds @@ -25,6 +25,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -155,13 +156,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -194,6 +188,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/sifive-hifive1/metal.ramrodata.lds b/bsp/sifive-hifive1/metal.ramrodata.lds index 4accb825c..088a8e7a5 100644 --- a/bsp/sifive-hifive1/metal.ramrodata.lds +++ b/bsp/sifive-hifive1/metal.ramrodata.lds @@ -26,6 +26,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -149,13 +150,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >rom : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >rom :rom - /* ITIM SECTION * @@ -175,6 +169,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >rom :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/sifive-hifive1/metal.scratchpad.lds b/bsp/sifive-hifive1/metal.scratchpad.lds index ebb13dafa..4cc81d734 100644 --- a/bsp/sifive-hifive1/metal.scratchpad.lds +++ b/bsp/sifive-hifive1/metal.scratchpad.lds @@ -23,6 +23,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -146,13 +147,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >ram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >ram :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -184,6 +178,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >ram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/spike/metal.default.lds b/bsp/spike/metal.default.lds index 333649e95..1f760b2b4 100644 --- a/bsp/spike/metal.default.lds +++ b/bsp/spike/metal.default.lds @@ -21,6 +21,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -146,13 +147,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >testram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >testram :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -184,6 +178,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >testram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/spike/metal.freertos.lds b/bsp/spike/metal.freertos.lds index feaf00469..e4db87285 100644 --- a/bsp/spike/metal.freertos.lds +++ b/bsp/spike/metal.freertos.lds @@ -24,6 +24,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -156,13 +157,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >testram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >testram :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -195,6 +189,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >testram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/spike/metal.ramrodata.lds b/bsp/spike/metal.ramrodata.lds index 8f1df7d50..1eb1b1e26 100644 --- a/bsp/spike/metal.ramrodata.lds +++ b/bsp/spike/metal.ramrodata.lds @@ -25,6 +25,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -150,13 +151,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >testram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >testram :rom - /* ITIM SECTION * @@ -176,6 +170,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >testram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only diff --git a/bsp/spike/metal.scratchpad.lds b/bsp/spike/metal.scratchpad.lds index 229751b83..6f3f7be63 100644 --- a/bsp/spike/metal.scratchpad.lds +++ b/bsp/spike/metal.scratchpad.lds @@ -22,6 +22,7 @@ PHDRS tls PT_TLS; ram PT_LOAD; itim_init PT_LOAD; + text PT_LOAD; } SECTIONS @@ -147,13 +148,6 @@ SECTIONS KEEP (*(.metal.dtors .metal.dtors.*)) } >testram : rom - .text : { - *(.text.unlikely .text.unlikely.*) - *(.text.startup .text.startup.*) - *(.text .text.*) - *(.gnu.linkonce.t.*) - } >testram :rom - .rodata : { *(.rdata) *(.rodata .rodata.*) @@ -185,6 +179,19 @@ SECTIONS PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); + /* TEXT SECTION + * + * The following section contains the code of the program, excluding + * everything that's been allocated into the ITIM already + */ + + .text : { + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >testram :text + /* RAM SECTION * * The following sections contain data which is copied from read-only