bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug gas/20427] Solaris rtld on SPARC does not allow R_SPARC_UA64 or


From: Nick Clifton
Subject: Re: [Bug gas/20427] Solaris rtld on SPARC does not allow R_SPARC_UA64 or R_SPARC_64 relocations in 32-bit executables
Date: Tue, 2 Aug 2016 15:17:07 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

Hi Stefan,

> So, this is what happens if i re-write the test32.S program for the Sun
> SPARC assembler:


>     .comm .gomp_critical_user_, 64, 8

> Relocation section '.rela.data' at offset 0xf8 contains 1 entries:
>  Offset     Info    Type                Sym. Value  Symbol's Name + Addend
> 00000004  00000303 R_SPARC_32             00000008   .gomp_critical_user_ + 0

Interesting.  I wonder if this is a bug in the Solaris assembler ?  

Maybe it knows that a symbol's value can only ever be 32-bits, so in this
particular case the reloc will work.  But what if the test really needed a
(non-zero) 64-bit value to be installed into the memory location.

For example, how does the Solaris assembler handle this:

 .data
    .global __kmp_unnamed_critical_addr

 __kmp_unnamed_critical_addr:
    .xword .gomp_critical_user_ + 0x1234567890
    .type __kmp_unnamed_critical_addr,#object
    .size __kmp_unnamed_critical_addr, .-__kmp_unnamed_critical_addr


Looking at the output for GAS, it seems that the addition in the reloc 
is truncated:

  00000000 R_SPARC_UA64      .gomp_critical_user_+0x34567890

This is not reported as an error, either, so presumably it is expected
behaviour.  Which makes me think that your patch will be OK.  But I would
like to know the results of your search for other 64-bit tests.

Cheers
  Nick




reply via email to

[Prev in Thread] Current Thread [Next in Thread]