This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PR13311
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 19 Oct 2011 15:55:19 +1030
- Subject: PR13311
Applied. The segfault was caused by accessing h->root.u.def.section
for something other than a defined or def_weak symbol. Testing
def_regular ought to be enough to cover this case. Also, !shared is
the wrong test if we want this warning on pies, and I can't see why we
would want pies to be treated any differently to normal executables
here.
PR ld/13311
* elflink.c (elf_link_output_extsym): Correct test for warning when
forced local executable syms are referenced from shared libraries.
Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.426
diff -u -p -r1.426 elflink.c
--- bfd/elflink.c 19 Oct 2011 04:13:28 -0000 1.426
+++ bfd/elflink.c 19 Oct 2011 05:00:46 -0000
@@ -8659,10 +8659,11 @@ elf_link_output_extsym (struct bfd_hash_
/* We should also warn if a forced local symbol is referenced from
shared libraries. */
- if (! finfo->info->relocatable
- && (! finfo->info->shared)
+ if (!finfo->info->relocatable
+ && finfo->info->executable
&& h->forced_local
&& h->ref_dynamic
+ && h->def_regular
&& !h->dynamic_def
&& !h->dynamic_weak
&& ! elf_link_check_versioned_symbol (finfo->info, bed, h))
--
Alan Modra
Australia Development Lab, IBM