This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix generic linker symbol output when weak is overridden by strong


This fixes defined6 failures for ELF targets using the generic linker.
When a weak symbol is overridden by a strong one, we want the output
symbol to be strong rather than weak.  Yes, I know this also affects
bfd_link_hash_indirect due to the fall through, but output of indirect
and warning symbols looks quite broken anyway.  Presumably no one
cares about such things.

	* linker.c (_bfd_generic_link_output_symbols): Remove BSF_WEAK
	flag from bfd_link_hash_defined symbols.

diff --git a/bfd/linker.c b/bfd/linker.c
index 9223810..083a250 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -2136,7 +2136,7 @@ _bfd_generic_link_output_symbols (bfd *output_bfd,
 		  /* fall through */
 		case bfd_link_hash_defined:
 		  sym->flags |= BSF_GLOBAL;
-		  sym->flags &=~ BSF_CONSTRUCTOR;
+		  sym->flags &=~ (BSF_WEAK | BSF_CONSTRUCTOR);
 		  sym->value = h->root.u.def.value;
 		  sym->section = h->root.u.def.section;
 		  break;

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]