On Thu, 10 Nov 2011 15:16:55 +0100
Andreas Krebbel <[email protected]> wrote:
> On 11/09/2011 08:21 PM, Neale Ferguson wrote:
>
> Hi,
>
> your cmdlines to build the shared lib look correct. The assembler code shows
> that the code
> has been built correctly with -fPIC. However, the relocations in the .o and
> .so files look
> like non-pic code. With -fPIC it should be R_390_PLT32DBL in the .o and there
> has to be a
> R_390_JMP_SLOT relocation in the .so. The R_390_PC32DBL is not sufficient to
> reach the symbol.
>
> So it looks like AS ignores the "@PLT" modifier completely. But your system
> would not work
> at all if this really would be the case.
That is pretty much impossible. md_gather_operands does this for @PLT:
else if (suffix == ELF_SUFFIX_PLT)
{
if ((operand->flags & S390_OPERAND_PCREL)
&& (operand->bits == 16))
reloc = BFD_RELOC_390_PLT16DBL;
else if ((operand->flags & S390_OPERAND_PCREL)
&& (operand->bits == 32))
reloc = BFD_RELOC_390_PLT32DBL;
}
A BFD_RELOC_390_PLT32DBL relocation is always emitted as a R_390_PLT32DBL. On
final link
the bfd code will either convert that to a direct call without any kind of
relocation
or it will create a PLT slot and a R_390_JMP_SLOT.
If the final shared library has a R_390_PC32DBL there must have been an object
file that
contained the relocation.
> What distro are you using? I wasn't able to reproduce it on the system I have
> access to.
Me neither, a simple library that wraps gettimeofday just works.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/