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-Tag: cygwin-1_7_3-release~314 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3cff7cc71fc25ffa83e7d5ce8f4aeb308fb656db;p=external%2Fbinutils.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 93471ef..33487ff 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 556ff1e..8b3ea0a 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 <