From 5253f23b62d3cc15e2c9110ce711f0ee9b19feb3 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 9 Aug 2001 14:25:59 +0000 Subject: [PATCH] * scripttempl/elf.sc: Move non-text .dynamic section before .plt/.got/.sdata* group. (OTHER_GOT_SECTIONS): Move to immediately after .got. (OTHER_SDATA_SECTIONS): Add. * emulparams/criself.sh: Use OTHER_SDATA_SECTIONS rather than OTHER_GOT_SECTIONS. * emulparams/crislinux.sh: Likewise. * emulparams/elf32b4300.sh: Likewise. * emulparams/elf32bmip.sh: Likewise. * emulparams/elf32bmipn32.sh: Likewise. * emulparams/elf32bsmip.sh: Likewise. * emulparams/elf32btsmip.sh: Likewise. * emulparams/elf32ebmip.sh: Likewise. * emulparams/elf32elmip.sh: Likewise. * emulparams/elf32l4300.sh: Likewise. * emulparams/elf32lmip.sh: Likewise. * emulparams/elf32lsmip.sh: Likewise. * emulparams/elf32ltsmip.sh: Likewise. * emulparams/elf64bmip.sh: Likewise. * emulparams/elf64btsmip.sh: Likewise. * emulparams/elf64ltsmip.sh: Likewise. --- ld/ChangeLog | 24 ++++++++++++++++++++++++ ld/emulparams/criself.sh | 2 +- ld/emulparams/crislinux.sh | 2 +- ld/emulparams/elf32b4300.sh | 2 +- ld/emulparams/elf32bmip.sh | 2 +- ld/emulparams/elf32bmipn32.sh | 2 +- ld/emulparams/elf32bsmip.sh | 2 +- ld/emulparams/elf32btsmip.sh | 2 +- ld/emulparams/elf32ebmip.sh | 2 +- ld/emulparams/elf32elmip.sh | 2 +- ld/emulparams/elf32l4300.sh | 2 +- ld/emulparams/elf32lmip.sh | 2 +- ld/emulparams/elf32lsmip.sh | 2 +- ld/emulparams/elf32ltsmip.sh | 2 +- ld/emulparams/elf64bmip.sh | 2 +- ld/emulparams/elf64btsmip.sh | 2 +- ld/emulparams/elf64ltsmip.sh | 2 +- ld/scripttempl/elf.sc | 8 +++++--- 18 files changed, 45 insertions(+), 19 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 27e96573da5..683c6eed9e5 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,27 @@ +2001-08-09 Alan Modra + + * scripttempl/elf.sc: Move non-text .dynamic section before + .plt/.got/.sdata* group. + (OTHER_GOT_SECTIONS): Move to immediately after .got. + (OTHER_SDATA_SECTIONS): Add. + * emulparams/criself.sh: Use OTHER_SDATA_SECTIONS rather than + OTHER_GOT_SECTIONS. + * emulparams/crislinux.sh: Likewise. + * emulparams/elf32b4300.sh: Likewise. + * emulparams/elf32bmip.sh: Likewise. + * emulparams/elf32bmipn32.sh: Likewise. + * emulparams/elf32bsmip.sh: Likewise. + * emulparams/elf32btsmip.sh: Likewise. + * emulparams/elf32ebmip.sh: Likewise. + * emulparams/elf32elmip.sh: Likewise. + * emulparams/elf32l4300.sh: Likewise. + * emulparams/elf32lmip.sh: Likewise. + * emulparams/elf32lsmip.sh: Likewise. + * emulparams/elf32ltsmip.sh: Likewise. + * emulparams/elf64bmip.sh: Likewise. + * emulparams/elf64btsmip.sh: Likewise. + * emulparams/elf64ltsmip.sh: Likewise. + 2001-08-08 Alan Modra * genscripts.sh: Source the emulparams script before each output diff --git a/ld/emulparams/criself.sh b/ld/emulparams/criself.sh index b2576342a1a..141ab518a25 100644 --- a/ld/emulparams/criself.sh +++ b/ld/emulparams/criself.sh @@ -36,7 +36,7 @@ OTHER_READONLY_SECTIONS='PROVIDE (__Etext = .);' DATA_START_SYMBOLS='PROVIDE (__Sdata = .);' # Smuggle an "OTHER_DATA_END_SYMBOLS" here. -OTHER_GOT_SECTIONS='PROVIDE (__Edata = .);' +OTHER_SDATA_SECTIONS='PROVIDE (__Edata = .);' # If .bss does not immediately follow .data but has its own start # address, we can't get to it with OTHER_BSS_SYMBOLS, neither can we diff --git a/ld/emulparams/crislinux.sh b/ld/emulparams/crislinux.sh index c5ff27f5686..e33b462d4bb 100644 --- a/ld/emulparams/crislinux.sh +++ b/ld/emulparams/crislinux.sh @@ -26,7 +26,7 @@ OTHER_READONLY_SECTIONS='PROVIDE (__Etext = .);' DATA_START_SYMBOLS='PROVIDE (__Sdata = .);' # Smuggle an "OTHER_DATA_END_SYMBOLS" here. -OTHER_GOT_SECTIONS='PROVIDE (__Edata = .);' +OTHER_SDATA_SECTIONS='PROVIDE (__Edata = .);' OTHER_BSS_SYMBOLS='PROVIDE (__Sbss = .);' OTHER_BSS_END_SYMBOLS='PROVIDE (__Ebss = .);' diff --git a/ld/emulparams/elf32b4300.sh b/ld/emulparams/elf32b4300.sh index 24f8d98eab0..88626a49241 100644 --- a/ld/emulparams/elf32b4300.sh +++ b/ld/emulparams/elf32b4300.sh @@ -9,7 +9,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff --git a/ld/emulparams/elf32bmip.sh b/ld/emulparams/elf32bmip.sh index 473c41169e0..0c07663dc92 100644 --- a/ld/emulparams/elf32bmip.sh +++ b/ld/emulparams/elf32bmip.sh @@ -13,7 +13,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff --git a/ld/emulparams/elf32bmipn32.sh b/ld/emulparams/elf32bmipn32.sh index 56f42a9b296..b0608081b9f 100755 --- a/ld/emulparams/elf32bmipn32.sh +++ b/ld/emulparams/elf32bmipn32.sh @@ -17,7 +17,7 @@ ENTRY=__start OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } .srdata : { *(.srdata) } diff --git a/ld/emulparams/elf32bsmip.sh b/ld/emulparams/elf32bsmip.sh index 09f13076437..78421d19e66 100644 --- a/ld/emulparams/elf32bsmip.sh +++ b/ld/emulparams/elf32bsmip.sh @@ -13,7 +13,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff --git a/ld/emulparams/elf32btsmip.sh b/ld/emulparams/elf32btsmip.sh index f6d1cf265be..9c8e344a748 100644 --- a/ld/emulparams/elf32btsmip.sh +++ b/ld/emulparams/elf32btsmip.sh @@ -13,7 +13,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff --git a/ld/emulparams/elf32ebmip.sh b/ld/emulparams/elf32ebmip.sh index 00ea8fd9c96..14eb3186e82 100644 --- a/ld/emulparams/elf32ebmip.sh +++ b/ld/emulparams/elf32ebmip.sh @@ -10,7 +10,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff --git a/ld/emulparams/elf32elmip.sh b/ld/emulparams/elf32elmip.sh index cf008c8f117..865553c924c 100644 --- a/ld/emulparams/elf32elmip.sh +++ b/ld/emulparams/elf32elmip.sh @@ -10,7 +10,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff --git a/ld/emulparams/elf32l4300.sh b/ld/emulparams/elf32l4300.sh index 690de88b3aa..4bd48e8fad1 100644 --- a/ld/emulparams/elf32l4300.sh +++ b/ld/emulparams/elf32l4300.sh @@ -9,7 +9,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff --git a/ld/emulparams/elf32lmip.sh b/ld/emulparams/elf32lmip.sh index 23312f44aca..99a9dd8338e 100644 --- a/ld/emulparams/elf32lmip.sh +++ b/ld/emulparams/elf32lmip.sh @@ -13,7 +13,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff --git a/ld/emulparams/elf32lsmip.sh b/ld/emulparams/elf32lsmip.sh index 4bdc8a10e69..4f792e24022 100644 --- a/ld/emulparams/elf32lsmip.sh +++ b/ld/emulparams/elf32lsmip.sh @@ -13,7 +13,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff --git a/ld/emulparams/elf32ltsmip.sh b/ld/emulparams/elf32ltsmip.sh index 90d7d64e896..443b98fbbe7 100644 --- a/ld/emulparams/elf32ltsmip.sh +++ b/ld/emulparams/elf32ltsmip.sh @@ -13,7 +13,7 @@ OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff --git a/ld/emulparams/elf64bmip.sh b/ld/emulparams/elf64bmip.sh index a4852d53cf4..8610e2b3e9d 100755 --- a/ld/emulparams/elf64bmip.sh +++ b/ld/emulparams/elf64bmip.sh @@ -20,7 +20,7 @@ ENTRY=__start OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } .srdata : { *(.srdata) } diff --git a/ld/emulparams/elf64btsmip.sh b/ld/emulparams/elf64btsmip.sh index f3d917cfb76..69edab9d292 100644 --- a/ld/emulparams/elf64btsmip.sh +++ b/ld/emulparams/elf64btsmip.sh @@ -25,7 +25,7 @@ ENTRY=__start OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff --git a/ld/emulparams/elf64ltsmip.sh b/ld/emulparams/elf64ltsmip.sh index ac2dcfc76b4..c6d0e570159 100644 --- a/ld/emulparams/elf64ltsmip.sh +++ b/ld/emulparams/elf64ltsmip.sh @@ -25,7 +25,7 @@ ENTRY=__start OTHER_GOT_SYMBOLS=' _gp = ALIGN(16) + 0x7ff0; ' -OTHER_GOT_SECTIONS=' +OTHER_SDATA_SECTIONS=' .lit8 : { *(.lit8) } .lit4 : { *(.lit4) } ' diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc index 3c1bfb40c19..9c03dd6c3d7 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc @@ -17,7 +17,8 @@ # DATA_START_SYMBOLS - symbols that appear at the start of the # .data section. # OTHER_GOT_SYMBOLS - symbols defined just before .got. -# OTHER_GOT_SECTIONS - sections just after .got and .sdata. +# OTHER_GOT_SECTIONS - sections just after .got. +# OTHER_SDATA_SECTIONS - sections just after .sdata. # OTHER_BSS_SYMBOLS - symbols that appear at the start of the # .bss section besides __bss_start. # DATA_PLT - .plt should be in data segment, not text segment. @@ -308,14 +309,15 @@ SECTIONS .gcc_except_table : { *(.gcc_except_table) } ${WRITABLE_RODATA+${RODATA}} ${RELOCATING+${OTHER_READWRITE_SECTIONS}} + ${TEXT_DYNAMIC-${DYNAMIC}} ${RELOCATING+${CTOR}} ${RELOCATING+${DTOR}} ${DATA_PLT+${PLT}} ${RELOCATING+${OTHER_GOT_SYMBOLS}} .got ${RELOCATING-0} : { *(.got.plt) *(.got) } + ${RELOCATING+${OTHER_GOT_SECTIONS}} ${CREATE_SHLIB+${SDATA2}} ${CREATE_SHLIB+${SBSS2}} - ${TEXT_DYNAMIC-${DYNAMIC}} /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ @@ -326,7 +328,7 @@ SECTIONS ${RELOCATING+*(.sdata.*)} ${RELOCATING+*(.gnu.linkonce.s.*)} } - ${RELOCATING+${OTHER_GOT_SECTIONS}} + ${RELOCATING+${OTHER_SDATA_SECTIONS}} ${RELOCATING+_edata = .;} ${RELOCATING+PROVIDE (edata = .);} ${RELOCATING+__bss_start = .;} -- 2.30.2