R_SPARC_RELATIVE vs R_SPARC_UA32 & unaligned unwind tables - again

Jakub Jelinek jakub@redhat.com
Wed Dec 19 06:14:00 GMT 2001


On Thu, Dec 20, 2001 at 12:24:10AM +1030, Alan Modra wrote:
> On Wed, Dec 19, 2001 at 02:18:57PM +0100, Jakub Jelinek wrote:
> > 
> > 2) glibc code matches what does Solaris 8 ld.so and what Solaris ld creates:
> >    relocs against STB_LOCAL symbols have addend which is relative to
> >    library VMA, not the actual STB_LOCAL symbol value
> 
> ie. behave as a reloc against STN_UNDEF.  Sounds like your idea of
> avoiding any section symbol relocs is the cure.

I'd prefer to find out first what exactly is broken in Solars 2.5 ld.so.
DJ, can you try to build a shared library from say:
.data
1: .word 0xdeadbeef, 0xbeefdead, 0xabcdef01
.section ".textw", #alloc, #write, #execinstr
.global foo
foo:
sethi %hi(1b + 4), %o0
retl
or %o0, %lo(1b + 4), %o0
.byte 1
.uaword 1b + 8

and see what the dynamic linker does?
Current binutils end up with:
Relocation section '.rela.textw' at offset 0x2a0 contains 3 entries:
 Offset     Info    Type            Symbol's Value  Symbol's Name          Addend
000002c4  00000609 R_SPARC_HI22          000102d8  .data                     + 102dc
000002cc  0000060c R_SPARC_LO10          000102d8  .data                     + 102dc
000002d1  00000617 R_SPARC_UA32          000102d8  .data                     + 102d8

Symbol table '.dynsym' contains 18 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 00000094     0 SECTION LOCAL  DEFAULT    1
     2: 00000128     0 SECTION LOCAL  DEFAULT    2
     3: 00000248     0 SECTION LOCAL  DEFAULT    3
     4: 000002a0     0 SECTION LOCAL  DEFAULT    4
     5: 000002c4     0 SECTION LOCAL  DEFAULT    5
     6: 000102d8     0 SECTION LOCAL  DEFAULT    6
     7: 000102e0     0 SECTION LOCAL  DEFAULT    7
     8: 00010358     0 SECTION LOCAL  DEFAULT    8
     9: 00010358     0 SECTION LOCAL  DEFAULT    9
    10: 0001035c     0 SECTION LOCAL  DEFAULT   10

and as far as I could see, this worked well both on sparc linux and Solaris 2.8.

	Jakub



More information about the Binutils mailing list