This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] also copy symbol attributes when equating an undefined symbol
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Beulich <JBeulich at novell dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 18 Nov 2009 06:32:45 -0800
- Subject: Re: [PATCH] also copy symbol attributes when equating an undefined symbol
- References: <4B03F50F0200007800020654@vpn.id2.novell.com>
On Wed, Nov 18, 2009 at 4:22 AM, Jan Beulich <JBeulich@novell.com> wrote:
> 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().
Do you have a testcase which fails without your patch?
> 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 ?<email@example.com>
> ? ? ? ?* 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);
> ? ? ? set_zero_frag (symbolP);
> ? ? ? break;