From: Jie Zhang Date: Sat, 27 Feb 2010 12:34:25 +0000 (+0000) Subject: * scripttempl/armbpabi.sc: Don't combine .init_array.* or X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3cff7cc71fc25ffa83e7d5ce8f4aeb308fb656db;p=binutils-gdb.git * scripttempl/armbpabi.sc: Don't combine .init_array.* or .fini_array.* when do relocatable linking. * scripttempl/elf.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. testsuite/ * ld-elf/init-fini-arrays.s: New test. * ld-elf/init-fini-arrays.d: New test. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 93471ef2218..33487ffc7ad 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,12 @@ +2010-02-27 Jie Zhang + + * scripttempl/armbpabi.sc: Don't combine .init_array.* or + .fini_array.* when do relocatable linking. + * scripttempl/elf.sc: Likewise. + * scripttempl/elf32sh-symbian.sc: Likewise. + * scripttempl/elf64hppa.sc: Likewise. + * scripttempl/elfxtensa.sc: Likewise. + 2010-02-26 Alan Modra * scripttempl/elf.sc (.fini_array): Place input .fini_array after diff --git a/ld/scripttempl/armbpabi.sc b/ld/scripttempl/armbpabi.sc index 556ff1e44eb..8b3ea0a95a1 100644 --- a/ld/scripttempl/armbpabi.sc +++ b/ld/scripttempl/armbpabi.sc @@ -64,6 +64,24 @@ else NO_SMALL_DATA=" " fi test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " +INIT_ARRAY=".init_array ${RELOCATING-0} : + { + /* SymbianOS uses this symbol. */ + ${RELOCATING+PROVIDE (SHT\$\$INIT_ARRAY\$\$Base = .);} + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_start = .);}} + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_end = .);}} + /* SymbianOS uses this symbol. */ + ${RELOCATING+PROVIDE (SHT\$\$INIT_ARRAY\$\$Limit = .);} + }" +FINI_ARRAY=".fini_array ${RELOCATING-0} : + { + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_start = .);}} + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array)) + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_end = .);}} + }" CTOR=".ctors ${CONSTRUCTING-0} : { ${CONSTRUCTING+${CTOR_START}} @@ -218,24 +236,8 @@ cat <