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]
Other format: [Raw text]

Re: NEWABI bogon in 2001-10-04 change to macro_build_lui


cgd@broadcom.com wrote:
[snip]
> "as -non_shared -mabi=n32 -G0" on code like:
> 
> 	.data
>         .text
>         .globl  _start
>         .ent    _start
> _start:
>         .set    noreorder
>         la $2,.data
>         la $2, sym
>         .end _start
> 
> 
> now (because of that change) produces:
> 
> 00000000 <_start>:
>    0:   3c020000        lui     v0,0x0
>    4:   24420000        addiu   v0,v0,0
>                         4: R_MIPS_LO16  .data
>    8:   3c020000        lui     v0,0x0
>    c:   24420000        addiu   v0,v0,0
>                         c: R_MIPS_LO16  sym
> 
> rather than:
> 
> 00000000 <_start>:
>    0:   3c020000        lui     v0,0x0
>                         0: R_MIPS_HI16  .data
>    4:   24420000        addiu   v0,v0,0
>                         4: R_MIPS_LO16  .data
>    8:   3c020000        lui     v0,0x0
>                         8: R_MIPS_HI16  sym
>    c:   24420000        addiu   v0,v0,0
>                         c: R_MIPS_LO16  sym
> 
> (I verified that the latter was what was expected, using the SGI
> assembler.)

:-) It's obviously broken.

> I believe a change like the one below is in order, but cannot test it
> thoroughly...

Ok to me. I should have read this code more carefully.

> Thoughts?  It doesn't look like there are currently _any_ test cases
> for -mabi=32 or -mabi=64, but a non-PIC test should probably be among
> them when there are...

I'm still struggling with getting NewABI support to work on IRIX,
and I want the output from there to verify/model the testcases.

> (FYI, compiling the same test w/o -G0 produced ... fairly interesting
> results for the la of 'sym':
> 
>    8:   3c020000        lui     v0,0x0
>                         8: R_MIPS_GPREL16       sym
>    c:   24420000        addiu   v0,v0,0
> 
> I think this is due to bad use of frag_var() in load_address, but i
> really don't know.  8-)

I haven't cared much about GP optimization (besides of PIC) yet.
There may be more bogosities around there.


Thiemo


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