This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Support VER_FLG_INFO in readelf
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date: Mon, 08 Mar 2010 19:01:03 +0100
> David Miller <davem@davemloft.net> writes:
>
>> From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
>> Date: Mon, 08 Mar 2010 12:49:19 +0100
>>
>>> gcctestdir/ld: error: /vol/gcc-4.4/lib/gcc/sparc-sun-solaris2.10/4.4.2/../../../libstdc++.a(class_type_info.o): unsupported reloc 18 against local symbol
>>
>> This relocation is R_SPARC_WPLT30, I wonder why it appears against a
>> local symbol since by definition a local symbol should never go
>> through the PLT.
>>
>> Was libstdc++.a built using Sun's as and ld?
>
> Indeed, which is what I usually do on SPARC. I've recently started
> trying either gas and Sun ld or gas and gld to compare results, but I'm
> much further along on x86 here.
Ok, was libstdc++.a built using -fPIC?
The assembler should never emit R_SPARC_WPLT30 for a call instruction
unless PIC was specified on the command line.
R_SPARC_WPLT30 specifically instructs the linker to create a PLT entry
for the symbol reference.
If Sun's assembler is emitting this for a non-PIC build, that's
extremely unfortunate.
Ugh! From bfd/elfxx-sparc.c:
case R_SPARC_WPLT30:
...
if (h == NULL)
{
if (! ABI_64_P (abfd))
{
/* The Solaris native assembler will generate a WPLT30
reloc for a local symbol if you assemble a call from
one section to another when using -K pic. We treat
it as WDISP30. */
if (ELF32_R_TYPE (rel->r_info) == R_SPARC_PLT32)
goto r_sparc_plt32;
break;
}
/* PR 7027: We need similar behaviour for 64-bit binaries. */
else if (r_type == R_SPARC_WPLT30)
break;
/* It does not make sense to have a procedure linkage
table entry for a local symbol. */
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
So I guess I'll have to add something to GOLD to handle this too.