This is the mail archive of the
mailing list for the binutils project.
[PATCH] also copy symbol attributes when equating an undefined symbol
- From: "Jan Beulich" <JBeulich at novell dot com>
- To: <binutils at sourceware dot org>
- Date: Wed, 18 Nov 2009 12:22:23 +0000
- Subject: [PATCH] also copy symbol attributes when equating an undefined symbol
x86 has in md_estimate_size_before_relax() a check determining whether
a symbol reference can go without relocation, which for 2.20 got added
a check for GNU ifunc symbols. The linker tests would appear to
exercise this code, but in reality the fact that ld-ifunc/lib.c gets
translated correctly merely was due to __GI_library_func2 also being
global. The reason is that this symbol is an equate of an (at the time
of the equation at least) undefined symbol, and for such symbol
attributes weren't copied so far in pseudo_set().
Testsuite was run on 2.20 successfully (i686-linux and x86_64-linux),
but I didn't re-test things on mainline - okay to apply anyway (and
then perhaps also to the 2.20 branch)?
2009-11-18 Jan Beulich <firstname.lastname@example.org>
* read.c (pseudo_set): Also call copy_symbol_attributes() for
undefined target symbol.
--- binutils-2.20/gas/read.c 2009-10-09 15:12:32.000000000 +0200
+++ 2.20/gas/read.c 2009-11-18 12:34:41.000000000 +0100
@@ -3750,6 +3750,7 @@ pseudo_set (symbolS *symbolP)
S_SET_SEGMENT (symbolP, undefined_section);
symbol_set_value_expression (symbolP, &exp);
+ copy_symbol_attributes (symbolP, exp.X_add_symbol);