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: [patch] MIPS gas problems with gcc's explicit relocs


"Maciej W. Rozycki" <macro@ds2.pg.gda.pl> writes:
>  This is actually an independent problem with explicit relocs passed to
> the inside of an asm with the o32 ABI (or REL relocations, to be exact).  
> Consider the following (perhaps a bit useless, but valid) code.
>
> asm(
> 	"lw	%0,%2\n\t"
> 	"lw	%1,%3"
> 	: "=r" (r0), "=&r" (r1)
> 	: "m" (*m0), "m" (*m1));
>
> If built for o32, non-PIC it's bad *by definition* if "%lo" is a part of
> "%2" and "%3", as HI16 and LO16 relocs need to be paired, as you say.  

But relocs don't have to be in increasing address order.  We already reorder
them so that R_MIPS_LO16s follow R_MIPS_HI16s, and have done for years.
See tc-mips.c:mips_frob_file().

Richard


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