This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: binutils: "unexpected reloc type 0x17" on sparc


"David S. Miller" <davem@redhat.com> writes:

> Ian Lance Taylor writes:
>  > "David S. Miller" <davem@redhat.com> writes:
>  > > What I'm really trying to understand is why we've gotten away with not
>  > > having this for all this time. :-)
>  > > 
>  > > Is this being emitted for something new like stack unwind info or
>  > > dwarf2 debugging stuff?
>  > 
>  > The GNU assembler was recently (May 28) fixed to use R_SPARC_UA32 and
>  > friends for .ualong and friends.  That was always correct--compare
>  > with the Solaris assembler--but for a long time the GNU assembler
>  > incorrectly used R_SPARC_32.
> 
> Ok, and you've shown that sol2.h in GCC uses these directives for
> ASM_LONG.  But this isn't Linux.

Hmmm.  Yeah.

> Actually, it is even more confusing now, because things worked
> perfectly fine under Linux previously as far as we know right?
> It was emitting R_SPARC_32 and not R_SPARC_UA32.

That was going to happen no matter what gcc used, because until
recently the GNU assembler emitted R_SPARC_32 for both .word and
.uaword.

> I mean, I'll tool around in the gcc-3.0 and cvs binutils sources
> to try and figure this out, but someone here can probably dig into
> it more quickly than I at the moment.

A little grep shows that SPARC gcc will use .uaword for
UNALIGNED_INT_ASM_OP, but that is only used by DWARF.

Looking at the code in gas, it looks buggy to me.  It looks to me like
this:
    .uaword 0
    .word foo
will cause R_SPARC_UA32 for the latter when it shouldn't.  Does
anybody want to build a SPARC gas to test?

If that is in fact the case, the easy fix would be to define
md_flush_pending_output to clear sparc_no_align_cons.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]