diff options
author | Alan Modra <amodra@gmail.com> | 2009-07-29 14:59:23 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2009-07-29 14:59:23 +0000 |
commit | 8dfab6dd9a9cc74aac4657633e6410af4c0f6641 (patch) | |
tree | 361bd8b6c685b7a7dbde4fd8fa48633cc74650c9 /ld | |
parent | 25f231068e4cddb11c8129980dc40cba1d42e4c5 (diff) | |
download | gdb-8dfab6dd9a9cc74aac4657633e6410af4c0f6641.zip gdb-8dfab6dd9a9cc74aac4657633e6410af4c0f6641.tar.gz gdb-8dfab6dd9a9cc74aac4657633e6410af4c0f6641.tar.bz2 |
* emulparams/elf32ppc.sh (PLT): Don't include ".iplt".
* emulparams/elf_i386.sh (IREL_IN_PLT): Define.
* emulparams/elf_x86_64.sh (IREL_IN_PLT): Define.
* scripttempl/elf.sc: Create separate .iplt and .rela.iplt sections
when !IREL_IN_PLT.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 8 | ||||
-rw-r--r-- | ld/emulparams/elf32ppc.sh | 2 | ||||
-rw-r--r-- | ld/emulparams/elf_i386.sh | 1 | ||||
-rw-r--r-- | ld/emulparams/elf_x86_64.sh | 1 | ||||
-rw-r--r-- | ld/scripttempl/elf.sc | 36 |
5 files changed, 38 insertions, 10 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index d9ec3ba..65ac902 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2009-07-30 Alan Modra <amodra@bigpond.net.au> + + * emulparams/elf32ppc.sh (PLT): Don't include ".iplt". + * emulparams/elf_i386.sh (IREL_IN_PLT): Define. + * emulparams/elf_x86_64.sh (IREL_IN_PLT): Define. + * scripttempl/elf.sc: Create separate .iplt and .rela.iplt sections + when !IREL_IN_PLT. + 2009-07-29 Hans-Peter Nilsson <hp@bitrange.com> * scripttempl/mmo.sc: For relocateable links, set $OUTPUT_FORMAT to diff --git a/ld/emulparams/elf32ppc.sh b/ld/emulparams/elf32ppc.sh index 49cc950..e638815 100644 --- a/ld/emulparams/elf32ppc.sh +++ b/ld/emulparams/elf32ppc.sh @@ -11,7 +11,7 @@ SEPARATE_GOTPLT=0 BSS_PLT= GOT=".got ${RELOCATING-0} : SPECIAL { *(.got) }" GOTPLT=".plt ${RELOCATING-0} : SPECIAL { *(.plt) }" -PLT=".plt ${RELOCATING-0} : SPECIAL { *(.plt) *(.iplt) } +PLT=".plt ${RELOCATING-0} : SPECIAL { *(.plt) } .iplt ${RELOCATING-0} : { *(.iplt) }" OTHER_TEXT_SECTIONS="*(.glink)" EXTRA_EM_FILE=ppc32elf diff --git a/ld/emulparams/elf_i386.sh b/ld/emulparams/elf_i386.sh index 05d31a8..d480811 100644 --- a/ld/emulparams/elf_i386.sh +++ b/ld/emulparams/elf_i386.sh @@ -12,3 +12,4 @@ GENERATE_SHLIB_SCRIPT=yes GENERATE_PIE_SCRIPT=yes NO_SMALL_DATA=yes SEPARATE_GOTPLT=12 +IREL_IN_PLT= diff --git a/ld/emulparams/elf_x86_64.sh b/ld/emulparams/elf_x86_64.sh index 4b24710..0e93ad8 100644 --- a/ld/emulparams/elf_x86_64.sh +++ b/ld/emulparams/elf_x86_64.sh @@ -14,6 +14,7 @@ GENERATE_PIE_SCRIPT=yes NO_SMALL_DATA=yes LARGE_SECTIONS=yes SEPARATE_GOTPLT=24 +IREL_IN_PLT= if [ "x${host}" = "x${target}" ]; then case " $EMULATION_LIBPATH " in diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc index 0d6cae9..69e25c3 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc @@ -113,7 +113,9 @@ if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }" fi if test -z "$PLT"; then - PLT=".plt ${RELOCATING-0} : { *(.plt) *(.iplt)}" + IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }" + PLT=".plt ${RELOCATING-0} : { *(.plt)${IREL_IN_PLT+ *(.iplt)} } + ${IREL_IN_PLT-$IPLT}" fi test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes if test -z "$GOT"; then @@ -124,6 +126,20 @@ if test -z "$GOT"; then GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) }" fi fi +REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }" +RELA_IFUNC=".rela.ifunc ${RELOCATING-0} : { *(.rela.ifunc) }" +REL_IPLT=".rel.iplt ${RELOCATING-0} : + { + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}} + *(.rel.iplt) + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}} + }" +RELA_IPLT=".rela.iplt ${RELOCATING-0} : + { + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}} + *(.rela.iplt) + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}} + }" DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }" @@ -326,8 +342,10 @@ eval $COMBRELOCCAT <<EOF .rel.bss ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) } .rela.bss ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) } ${REL_LARGE} - .rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) } - .rela.ifunc ${RELOCATING-0} : { *(.rela.ifunc) } + ${IREL_IN_PLT+$REL_IFUNC} + ${IREL_IN_PLT+$RELA_IFUNC} + ${IREL_IN_PLT-$REL_IPLT} + ${IREL_IN_PLT-$RELA_IPLT} EOF if [ -n "$COMBRELOC" ]; then @@ -351,16 +369,16 @@ cat >> ldscripts/dyntmp.$$ <<EOF .rel.plt ${RELOCATING-0} : { *(.rel.plt) - ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}} - *(.rel.iplt) - ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}} + ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}}} + ${IREL_IN_PLT+${RELOCATING+*(.rel.iplt)}} + ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}}} } .rela.plt ${RELOCATING-0} : { *(.rela.plt) - ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}} - *(.rela.iplt) - ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}} + ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}}} + ${IREL_IN_PLT+${RELOCATING+*(.rela.iplt)}} + ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}}} } ${OTHER_PLT_RELOC_SECTIONS} EOF |