[llvm] r205200 - [mips] Implement missing relocations in the integrated assembler.

Daniel Sanders Daniel.Sanders at imgtec.com
Mon Mar 31 10:03:21 PDT 2014


Thanks for the link. The information I've found (https://dmz-portal.mips.com/wiki/MIPS_relocation_types) seems to be saying that they don’t need to be next to each other:
	"An R_MIPS_LO16 entry which does not immediately follow a R_MIPS_HI16 is combined with the most recent one encountered"
but that could just be an omission from our wiki and it does go on to say that there is a GNU extension that allows multiple R_MIPS_HI16's to use the same R_MIPS_LO16.

> It looks like R_MIPS_HI16 must be immediately followed by the
> "corresponding" LO16. It is not exactly clear what "corresponding"
> means. Does it need to use the same symbol?

I'm not sure either at the moment. I'd guess that it means on the same address, but on the same symbol makes sense too.

> -----Original Message-----
> From: Rafael Espíndola [mailto:rafael.espindola at gmail.com]
> Sent: 31 March 2014 17:49
> To: Daniel Sanders
> Cc: Simon Atanasyan; llvm-commits
> Subject: Re: [llvm] r205200 - [mips] Implement missing relocations in the
> integrated assembler.
> 
> From
> 
> http://www.linux-mips.org/pub/linux/mips/doc/ABI/psABI_mips3.0.pdf
> 
> It looks like R_MIPS_HI16 must be immediately followed by the
> "corresponding" LO16. It is not exactly clear what "corresponding"
> means. Does it need to use the same symbol?
> 
> In the testcase the relocations are  R_MIPS_CALL_HI16 and
> R_MIPS_CALL_LO16. Is it an undocumented requirement that the same
> restriction applies to them?
> 
> 
> On 31 March 2014 12:24, Daniel Sanders <Daniel.Sanders at imgtec.com>
> wrote:
> > I'll have to look into this (or Simon might know).  When I read the test, it
> seemed obvious to me that the relocations would be emitted in the order
> they were read in the input file but it appears that gas isn't doing that.
> >
> > Thanks for pointing that out.
> >
> >> -----Original Message-----
> >> From: Rafael Espíndola [mailto:rafael.espindola at gmail.com]
> >> Sent: 31 March 2014 17:08
> >> To: Daniel Sanders
> >> Cc: llvm-commits
> >> Subject: Re: [llvm] r205200 - [mips] Implement missing relocations in
> >> the integrated assembler.
> >>
> >> >  // Check that the appropriate relocations were created.
> >> >  // For the xgot case we want to see R_MIPS_[GOT|CALL]_[HI|LO]16.
> >> >
> >> > @@ -12,8 +9,8 @@
> >> >  // CHECK:     0x{{[0-9,A-F]+}} R_MIPS_GOT_HI16
> >> >  // CHECK:     0x{{[0-9,A-F]+}} R_MIPS_GOT_LO16
> >> >  // CHECK:     0x{{[0-9,A-F]+}} R_MIPS_CALL_HI16
> >> > -// CHECK:     0x{{[0-9,A-F]+}} R_MIPS_CALL_LO16
> >> >  // CHECK:     0x{{[0-9,A-F]+}} R_MIPS_GOT16
> >> > +// CHECK:     0x{{[0-9,A-F]+}} R_MIPS_CALL_LO16
> >> >  // CHECK:     0x{{[0-9,A-F]+}} R_MIPS_LO16
> >> >  // CHECK: ]
> >>
> >> I get a different relocation order with gas. Are the order
> >> restrictions documented anywhere? Could a link to that document be
> >> added to http://llvm.org/docs/CompilerWriterInfo.html?
> >>
> >> Cheers,
> >> Rafael




More information about the llvm-commits mailing list