diff options
Diffstat (limited to 'ld/emulparams')
-rw-r--r-- | ld/emulparams/aarch64cloudabi.sh | 6 | ||||
-rw-r--r-- | ld/emulparams/aarch64elf.sh | 8 | ||||
-rw-r--r-- | ld/emulparams/aarch64elf32.sh | 8 | ||||
-rw-r--r-- | ld/emulparams/aarch64fbsd.sh | 6 | ||||
-rw-r--r-- | ld/emulparams/aarch64linux.sh | 6 | ||||
-rw-r--r-- | ld/emulparams/aarch64linux32.sh | 6 | ||||
-rw-r--r-- | ld/emulparams/armelf.sh | 8 | ||||
-rw-r--r-- | ld/emulparams/armelf_fuchsia.sh | 6 | ||||
-rw-r--r-- | ld/emulparams/armelf_linux.sh | 6 | ||||
-rw-r--r-- | ld/emulparams/armelf_phoenix.sh | 6 | ||||
-rw-r--r-- | ld/emulparams/armnto.sh | 8 | ||||
-rw-r--r-- | ld/emulparams/elf32bmip.sh | 16 | ||||
-rw-r--r-- | ld/emulparams/elf32bmipn32-defs.sh | 16 | ||||
-rw-r--r-- | ld/emulparams/elf32frv.sh | 4 | ||||
-rw-r--r-- | ld/emulparams/elf32lriscv-defs.sh | 3 | ||||
-rw-r--r-- | ld/emulparams/elf32mcore.sh | 4 | ||||
-rw-r--r-- | ld/emulparams/elf32ppccommon.sh | 2 | ||||
-rw-r--r-- | ld/emulparams/elf32rl78.sh | 8 | ||||
-rw-r--r-- | ld/emulparams/i386nto.sh | 2 | ||||
-rw-r--r-- | ld/emulparams/score3_elf.sh | 16 | ||||
-rw-r--r-- | ld/emulparams/shelf_nto.sh | 2 | ||||
-rw-r--r-- | ld/emulparams/shlelf_nto.sh | 2 |
22 files changed, 66 insertions, 83 deletions
diff --git a/ld/emulparams/aarch64cloudabi.sh b/ld/emulparams/aarch64cloudabi.sh index 6223f26..1b8ca15 100644 --- a/ld/emulparams/aarch64cloudabi.sh +++ b/ld/emulparams/aarch64cloudabi.sh @@ -27,9 +27,9 @@ DATA_START_SYMBOLS='PROVIDE (__data_start = .);'; # AArch64 does not support .s* sections. NO_SMALL_DATA=yes -OTHER_BSS_SYMBOLS='__bss_start__ = .;' -OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;' -OTHER_END_SYMBOLS='__end__ = . ;' +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};" +OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};" +OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};" OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }' diff --git a/ld/emulparams/aarch64elf.sh b/ld/emulparams/aarch64elf.sh index 952f262..deea7b4 100644 --- a/ld/emulparams/aarch64elf.sh +++ b/ld/emulparams/aarch64elf.sh @@ -23,14 +23,14 @@ SEPARATE_GOTPLT=24 IREL_IN_PLT= TEXT_START_ADDR=0x00400000 -DATA_START_SYMBOLS='__data_start = . ;'; +DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__data_start = .${CREATE_SHLIB+)};" # AArch64 does not support .s* sections. NO_SMALL_DATA=yes -OTHER_BSS_SYMBOLS='__bss_start__ = .;' -OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;' -OTHER_END_SYMBOLS='__end__ = . ;' +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};" +OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; __bss_end__ = .${CREATE_SHLIB+)};" +OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};" OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }' diff --git a/ld/emulparams/aarch64elf32.sh b/ld/emulparams/aarch64elf32.sh index ae96f02..38bcd4b 100644 --- a/ld/emulparams/aarch64elf32.sh +++ b/ld/emulparams/aarch64elf32.sh @@ -23,14 +23,14 @@ SEPARATE_GOTPLT=12 IREL_IN_PLT= TEXT_START_ADDR=0x00400000 -DATA_START_SYMBOLS='__data_start = . ;'; +DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__data_start = .${CREATE_SHLIB+)};" # AArch64 does not support .s* sections. NO_SMALL_DATA=yes -OTHER_BSS_SYMBOLS='__bss_start__ = .;' -OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;' -OTHER_END_SYMBOLS='__end__ = . ;' +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};" +OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};" +OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};" OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }' diff --git a/ld/emulparams/aarch64fbsd.sh b/ld/emulparams/aarch64fbsd.sh index ff36787..4a307cd 100644 --- a/ld/emulparams/aarch64fbsd.sh +++ b/ld/emulparams/aarch64fbsd.sh @@ -27,9 +27,9 @@ DATA_START_SYMBOLS='PROVIDE (__data_start = .);'; # AArch64 does not support .s* sections. NO_SMALL_DATA=yes -OTHER_BSS_SYMBOLS='__bss_start__ = .;' -OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;' -OTHER_END_SYMBOLS='__end__ = . ;' +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};" +OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};" +OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};" OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }' diff --git a/ld/emulparams/aarch64linux.sh b/ld/emulparams/aarch64linux.sh index 9a78828..2ba1d79 100644 --- a/ld/emulparams/aarch64linux.sh +++ b/ld/emulparams/aarch64linux.sh @@ -27,9 +27,9 @@ DATA_START_SYMBOLS='PROVIDE (__data_start = .);'; # AArch64 does not support .s* sections. NO_SMALL_DATA=yes -OTHER_BSS_SYMBOLS='__bss_start__ = .;' -OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;' -OTHER_END_SYMBOLS='__end__ = . ;' +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};" +OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};" +OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};" OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }' diff --git a/ld/emulparams/aarch64linux32.sh b/ld/emulparams/aarch64linux32.sh index 45f84e9..0b4d4c9 100644 --- a/ld/emulparams/aarch64linux32.sh +++ b/ld/emulparams/aarch64linux32.sh @@ -27,9 +27,9 @@ DATA_START_SYMBOLS='PROVIDE (__data_start = .);'; # AArch64 does not support .s* sections. NO_SMALL_DATA=yes -OTHER_BSS_SYMBOLS='__bss_start__ = .;' -OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;' -OTHER_END_SYMBOLS='__end__ = . ;' +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};" +OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};" +OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};" OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }' diff --git a/ld/emulparams/armelf.sh b/ld/emulparams/armelf.sh index f581c68..272a8bc 100644 --- a/ld/emulparams/armelf.sh +++ b/ld/emulparams/armelf.sh @@ -7,9 +7,9 @@ TEXT_START_ADDR=0x8000 TEMPLATE_NAME=elf32 EXTRA_EM_FILE=armelf OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)' -OTHER_BSS_SYMBOLS='__bss_start__ = .;' -OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;' -OTHER_END_SYMBOLS='__end__ = . ;' +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};" +OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};" +OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};" OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }' OTHER_READONLY_SECTIONS=" @@ -18,7 +18,7 @@ OTHER_READONLY_SECTIONS=" .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) } ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }" -DATA_START_SYMBOLS='__data_start = . ;'; +DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__data_start = .${CREATE_SHLIB+)};" GENERATE_SHLIB_SCRIPT=yes GENERATE_PIE_SCRIPT=yes diff --git a/ld/emulparams/armelf_fuchsia.sh b/ld/emulparams/armelf_fuchsia.sh index 8626b0e..36392f1 100644 --- a/ld/emulparams/armelf_fuchsia.sh +++ b/ld/emulparams/armelf_fuchsia.sh @@ -12,9 +12,9 @@ GENERATE_PIE_SCRIPT=yes DATA_START_SYMBOLS='PROVIDE (__data_start = .);'; OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)' -OTHER_BSS_SYMBOLS='__bss_start__ = .;' -OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;' -OTHER_END_SYMBOLS='__end__ = . ;' +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};" +OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};" +OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};" OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' TEXT_START_ADDR=0x00001000 diff --git a/ld/emulparams/armelf_linux.sh b/ld/emulparams/armelf_linux.sh index 280db84..d726d63 100644 --- a/ld/emulparams/armelf_linux.sh +++ b/ld/emulparams/armelf_linux.sh @@ -12,9 +12,9 @@ GENERATE_PIE_SCRIPT=yes DATA_START_SYMBOLS='PROVIDE (__data_start = .);'; OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)' -OTHER_BSS_SYMBOLS='__bss_start__ = .;' -OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;' -OTHER_END_SYMBOLS='__end__ = . ;' +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};" +OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};" +OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};" OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' TEXT_START_ADDR=0x00010000 diff --git a/ld/emulparams/armelf_phoenix.sh b/ld/emulparams/armelf_phoenix.sh index d78edaf..7fb1e2d 100644 --- a/ld/emulparams/armelf_phoenix.sh +++ b/ld/emulparams/armelf_phoenix.sh @@ -12,9 +12,9 @@ GENERATE_PIE_SCRIPT=yes DATA_START_SYMBOLS='PROVIDE (__data_start = .);'; OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)' -OTHER_BSS_SYMBOLS='__bss_start__ = .;' -OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;' -OTHER_END_SYMBOLS='__end__ = . ;' +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};" +OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};" +OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};" OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' TEXT_START_ADDR=0x00001000 diff --git a/ld/emulparams/armnto.sh b/ld/emulparams/armnto.sh index f89f14f..79be999 100644 --- a/ld/emulparams/armnto.sh +++ b/ld/emulparams/armnto.sh @@ -7,11 +7,11 @@ TEXT_START_ADDR=0x00100000 TEMPLATE_NAME=elf32 EXTRA_EM_FILE=armelf OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)' -OTHER_BSS_SYMBOLS='__bss_start__ = .;' -OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;' -OTHER_END_SYMBOLS='__end__ = . ;' +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};" +OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};" +OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};" -DATA_START_SYMBOLS='__data_start = . ;'; +DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__data_start = .${CREATE_SHLIB+)};" GENERATE_SHLIB_SCRIPT=yes diff --git a/ld/emulparams/elf32bmip.sh b/ld/emulparams/elf32bmip.sh index 8da0f8f..da5e7fb 100644 --- a/ld/emulparams/elf32bmip.sh +++ b/ld/emulparams/elf32bmip.sh @@ -29,13 +29,9 @@ OTHER_GOT_RELOC_SECTIONS=" .rel.dyn ${RELOCATING-0} : { *(.rel.dyn) } " # If the output has a GOT section, there must be exactly 0x7ff0 bytes -# between .got and _gp. The ". = ." below stops the orphan code from -# inserting other sections between the assignment to _gp and the start -# of .got. -OTHER_GOT_SYMBOLS=' - . = .; - HIDDEN (_gp = ALIGN (16) + 0x7ff0); -' +# between .got and _gp. +OTHER_GOT_SYMBOLS='HIDDEN (_gp = ALIGN (16) + 0x7ff0);' + # .got.plt is only used for the PLT psABI extension. It should not be # included in the .sdata block with .got, as there is no need to access # the section from _gp. Note that the traditional: @@ -59,9 +55,9 @@ OTHER_SDATA_SECTIONS=" .lit8 ${RELOCATING-0} : { *(.lit8) } .lit4 ${RELOCATING-0} : { *(.lit4) } " -TEXT_START_SYMBOLS='_ftext = . ;' -DATA_START_SYMBOLS='_fdata = . ;' -OTHER_BSS_SYMBOLS='_fbss = .;' +TEXT_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_ftext = .${CREATE_SHLIB+)};" +DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fdata = .${CREATE_SHLIB+)};" +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fbss = .${CREATE_SHLIB+)};" OTHER_SECTIONS=' .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } diff --git a/ld/emulparams/elf32bmipn32-defs.sh b/ld/emulparams/elf32bmipn32-defs.sh index 46b3f83..bd01790 100644 --- a/ld/emulparams/elf32bmipn32-defs.sh +++ b/ld/emulparams/elf32bmipn32-defs.sh @@ -48,13 +48,9 @@ OTHER_GOT_RELOC_SECTIONS=" " # GOT-related settings. # If the output has a GOT section, there must be exactly 0x7ff0 bytes -# between .got and _gp. The ". = ." below stops the orphan code from -# inserting other sections between the assignment to _gp and the start -# of .got. -OTHER_GOT_SYMBOLS=' - . = .; - HIDDEN (_gp = ALIGN (16) + 0x7ff0); -' +# between .got and _gp. +OTHER_GOT_SYMBOLS='HIDDEN (_gp = ALIGN (16) + 0x7ff0);' + # .got.plt is only used for the PLT psABI extension. It should not be # included in the .sdata block with .got, as there is no need to access # the section from _gp. Note that the traditional: @@ -81,9 +77,9 @@ OTHER_SDATA_SECTIONS=" " # Magic symbols. -TEXT_START_SYMBOLS='_ftext = . ;' -DATA_START_SYMBOLS='_fdata = . ;' -OTHER_BSS_SYMBOLS='_fbss = .;' +TEXT_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_ftext = .${CREATE_SHLIB+)};" +DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fdata = .${CREATE_SHLIB+)};" +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fbss = .${CREATE_SHLIB+)};" INITIAL_READONLY_SECTIONS= if test -z "${CREATE_SHLIB}"; then diff --git a/ld/emulparams/elf32frv.sh b/ld/emulparams/elf32frv.sh index 9037072..581b7bc 100644 --- a/ld/emulparams/elf32frv.sh +++ b/ld/emulparams/elf32frv.sh @@ -9,8 +9,8 @@ MAXPAGESIZE=256 ENTRY=_start EMBEDDED=yes OTHER_EXCLUDE_FILES='*frvend.o' -OTHER_END_SYMBOLS='__end = .;' -DATA_START_SYMBOLS='__data_start = . ;' +OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end = .${CREATE_SHLIB+)};" +DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__data_start = .${CREATE_SHLIB+)};" STACK_ADDR=0x200000 NOP=0x80000000 OTHER_GOT_SYMBOLS=' diff --git a/ld/emulparams/elf32lriscv-defs.sh b/ld/emulparams/elf32lriscv-defs.sh index f373ece..91015d4 100644 --- a/ld/emulparams/elf32lriscv-defs.sh +++ b/ld/emulparams/elf32lriscv-defs.sh @@ -30,8 +30,7 @@ TEXT_START_ADDR=0x10000 MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)" -SDATA_START_SYMBOLS="__global_pointer$ = . + 0x800;" -SDATA_START_SYMBOLS="${CREATE_SHLIB-${SDATA_START_SYMBOLS}} +SDATA_START_SYMBOLS="${CREATE_SHLIB-__global_pointer$ = . + 0x800;} *(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*)" INITIAL_READONLY_SECTIONS=".interp : { *(.interp) } ${CREATE_PIE-${INITIAL_READONLY_SECTIONS}}" diff --git a/ld/emulparams/elf32mcore.sh b/ld/emulparams/elf32mcore.sh index 1e14c19..8a09bba 100644 --- a/ld/emulparams/elf32mcore.sh +++ b/ld/emulparams/elf32mcore.sh @@ -21,8 +21,8 @@ EMBEDDED=yes # not matter. NOP=0x0e0e0e0e -OTHER_BSS_SYMBOLS="__bss_start__ = . ;" -OTHER_BSS_END_SYMBOLS="__bss_end__ = . ;" +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};" +OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};" # This sets the stack to the top of the simulator memory (2^19 bytes). STACK_ADDR=0x80000 diff --git a/ld/emulparams/elf32ppccommon.sh b/ld/emulparams/elf32ppccommon.sh index 44edbd0..11a4d53 100644 --- a/ld/emulparams/elf32ppccommon.sh +++ b/ld/emulparams/elf32ppccommon.sh @@ -23,7 +23,7 @@ else unset SBSS_START_SYMBOLS unset SBSS_END_SYMBOLS fi -OTHER_END_SYMBOLS="__end = .;" +OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end = .${CREATE_SHLIB+)};" OTHER_RELRO_SECTIONS=" .fixup ${RELOCATING-0} : { *(.fixup) } .got1 ${RELOCATING-0} : { *(.got1) } diff --git a/ld/emulparams/elf32rl78.sh b/ld/emulparams/elf32rl78.sh index b782d03..d1a00e1 100644 --- a/ld/emulparams/elf32rl78.sh +++ b/ld/emulparams/elf32rl78.sh @@ -11,10 +11,6 @@ ELFSIZE=32 # EXTRA_EM_FILE=needrelax MAXPAGESIZE=256 -STACK_ADDR="(DEFINED(__stack) ? __stack : 0xffedc)" +STACK_ADDR="${CREATE_SHLIB-(DEFINED(__stack) ? __stack : 0xffedc)}" STACK_SENTINEL="LONG(0xdead)" -# We do not need .stack for shared library. -test -n "$CREATE_SHLIB" && unset STACK_ADDR - -OTHER_SYMBOLS="PROVIDE (__rl78_abs__ = 0);" -test -n "$CREATE_SHLIB" && unset OTHER_SYMBOLS +OTHER_SYMBOLS="${CREATE_SHLIB-PROVIDE (__rl78_abs__ = 0);}" diff --git a/ld/emulparams/i386nto.sh b/ld/emulparams/i386nto.sh index 626f9c1..bb685f3 100644 --- a/ld/emulparams/i386nto.sh +++ b/ld/emulparams/i386nto.sh @@ -2,7 +2,7 @@ SCRIPT_NAME=elf OUTPUT_FORMAT="elf32-i386" NO_RELA_RELOCS=yes TEXT_START_ADDR=0x08048000 -TEXT_START_SYMBOLS='_btext = .;' +TEXT_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_btext = .${CREATE_SHLIB+)};" MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" ARCH=i386 MACHINE= diff --git a/ld/emulparams/score3_elf.sh b/ld/emulparams/score3_elf.sh index 4636cd3..8fbd47b 100644 --- a/ld/emulparams/score3_elf.sh +++ b/ld/emulparams/score3_elf.sh @@ -12,17 +12,13 @@ TEXT_START_ADDR=0x00000000 MAXPAGESIZE=256 NONPAGED_TEXT_START_ADDR=0x0400000 SHLIB_TEXT_START_ADDR=0x5ffe0000 -OTHER_GOT_SYMBOLS=' - _gp = ALIGN(16) + 0x3ff0; -' +OTHER_GOT_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_gp = ALIGN(16) + 0x3ff0${CREATE_SHLIB+)};" -OTHER_BSS_START_SYMBOLS='_bss_start__ = . + ALIGN(4);' -OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;' -DATA_START_SYMBOLS='_fdata = . ;' -SDATA_START_SYMBOLS='_sdata_begin = . ;' -OTHER_BSS_SYMBOLS=' - _bss_start = ALIGN(4) ; -' +OTHER_BSS_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_start__ = ALIGN(4)${CREATE_SHLIB+)};" +OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};" +DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fdata = .${CREATE_SHLIB+)};" +SDATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_sdata_begin = .${CREATE_SHLIB+)};" +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_start = ALIGN(4)${CREATE_SHLIB+)};" # This sets the stack to the top of the simulator memory (2^19 bytes). STACK_ADDR=0x8000000 diff --git a/ld/emulparams/shelf_nto.sh b/ld/emulparams/shelf_nto.sh index c4d71aa..1dc5e46 100644 --- a/ld/emulparams/shelf_nto.sh +++ b/ld/emulparams/shelf_nto.sh @@ -7,5 +7,5 @@ ARCH=sh MACHINE= TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes -TEXT_START_SYMBOLS='_btext = .;' +TEXT_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_btext = .${CREATE_SHLIB+)};" ENTRY=_start diff --git a/ld/emulparams/shlelf_nto.sh b/ld/emulparams/shlelf_nto.sh index 16f6508..ddc4fc6 100644 --- a/ld/emulparams/shlelf_nto.sh +++ b/ld/emulparams/shlelf_nto.sh @@ -7,5 +7,5 @@ ARCH=sh MACHINE= TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes -TEXT_START_SYMBOLS='_btext = .;' +TEXT_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_btext = .${CREATE_SHLIB+)};" ENTRY=_start |