summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordcoppa <dcoppa@openbsd.org>2013-03-23 09:35:48 +0000
committerdcoppa <dcoppa@openbsd.org>2013-03-23 09:35:48 +0000
commite838f9329a20a21d8bbd598cefd31a8938b6d061 (patch)
tree88da2f9f4066f63b4867ed6d58685fd11212af54
parentIgnore client-identifier option in leases from a server. They're not supposed (diff)
downloadwireguard-openbsd-e838f9329a20a21d8bbd598cefd31a8938b6d061.tar.xz
wireguard-openbsd-e838f9329a20a21d8bbd598cefd31a8938b6d061.zip
Fix a bug in ld --gc-sections: it strips out .note sections, while
it should never do so. This can cause global constructors and destructors to not be executed at run-time, resulting in crashes and other strange behaviour. From FreeBSD: http://svnweb.freebsd.org/base?view=revision&revision=244600 This unbreaks building chromium with binutils-2.17 ok miod@, sthen@
-rw-r--r--gnu/usr.bin/binutils-2.17/bfd/elflink.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gnu/usr.bin/binutils-2.17/bfd/elflink.c b/gnu/usr.bin/binutils-2.17/bfd/elflink.c
index 99f044b783b..9645bdb32ed 100644
--- a/gnu/usr.bin/binutils-2.17/bfd/elflink.c
+++ b/gnu/usr.bin/binutils-2.17/bfd/elflink.c
@@ -8987,6 +8987,7 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info)
{
/* Keep debug and special sections. */
if ((o->flags & (SEC_DEBUGGING | SEC_LINKER_CREATED)) != 0
+ || elf_section_data (o)->this_hdr.sh_type == SHT_NOTE
|| (o->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0)
o->gc_mark = 1;