summaryrefslogtreecommitdiffstats
path: root/contrib/binutils
diff options
context:
space:
mode:
authortijl <tijl@FreeBSD.org>2015-02-11 17:25:23 +0000
committertijl <tijl@FreeBSD.org>2015-02-11 17:25:23 +0000
commita388798850d3da8b1faeca1f76b113b9e5bfeaa4 (patch)
tree71772fe6b78520145e578ac49154b572290033a0 /contrib/binutils
parent3461fbe32665b5f744106b6dd662696565762672 (diff)
downloadFreeBSD-src-a388798850d3da8b1faeca1f76b113b9e5bfeaa4.zip
FreeBSD-src-a388798850d3da8b1faeca1f76b113b9e5bfeaa4.tar.gz
Fix ldscripts such that ld(1) collects the .fini_array section in the same
order as the .init_array section. Finalisation routines need to be called in the opposite order as their corresponding initialisation routines but rtld(1) handles that by calling the function pointers in .fini_array in reverse order. Reviewed by: kib MFC after: 2 weeks
Diffstat (limited to 'contrib/binutils')
-rw-r--r--contrib/binutils/ld/scripttempl/elf.sc2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/binutils/ld/scripttempl/elf.sc b/contrib/binutils/ld/scripttempl/elf.sc
index 205d162..6060c3e 100644
--- a/contrib/binutils/ld/scripttempl/elf.sc
+++ b/contrib/binutils/ld/scripttempl/elf.sc
@@ -402,8 +402,8 @@ cat <<EOF
.fini_array ${RELOCATING-0} :
{
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}}
- KEEP (*(.fini_array))
KEEP (*(SORT(.fini_array.*)))
+ KEEP (*(.fini_array))
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_end = .);}}
}
${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
OpenPOWER on IntegriCloud