Message ID | 67afeb7f-c91f-4702-bf3e-97d9d22bd9b7@BAMAIL02.ba.imgtec.org |
---|---|
State | New |
Headers | show |
On Fri, 19 Dec 2014, Steve Ellcey wrote: > @@ -138,7 +138,11 @@ elf_machine_load_address (void) > #ifndef __mips16 > asm (" .set noreorder\n" > " " STRINGXP (PTR_LA) " %0, 0f\n" > +#if __mips_isa_rev < 6 > " bltzal $0, 0f\n" > +#else > + " bal 0f\n" > +#endif Correct preprocessor indentation, since inside #ifndef __mips16, i.e. a single space between "#" and if/else/endif. > @@ -241,6 +245,11 @@ do { \ > and not just plain _start. */ > > #ifndef __mips16 > +#if __mips_isa_rev < 6 > +#define LOAD_31 STRINGXP(bltzal $8) "," STRINGXP(.Lcoff) > +#else > +#define LOAD_31 STRINGXP(bal .Lcoff) > +#endif Likewise (one space before if/else/endif, two before define). OK with that change.
> diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h > index 5000d2a..8885c80 100644 > --- a/sysdeps/mips/dl-machine.h > +++ b/sysdeps/mips/dl-machine.h > @@ -138,7 +138,11 @@ elf_machine_load_address (void) > #ifndef __mips16 > asm (" .set noreorder\n" > " " STRINGXP (PTR_LA) " %0, 0f\n" > +#if __mips_isa_rev < 6 > " bltzal $0, 0f\n" > +#else > + " bal 0f\n" > +#endif > " nop\n" > "0: " STRINGXP (PTR_SUBU) " %0, $31, %0\n" > " .set reorder\n" I never got to reviewing this internally. We should switch this to using ADDIUPC. The goal of this code I believe is to determine the relative offset from the static and dynamic locations of ld.so. " STRINGXP (PTR_LA) " %0, 0f\n" 0: addiupc <reg>, 0 " STRINGXP (PTR_SUBU) " %0, <reg>, %0\n" We should also do something similar with the other case. Thanks, Matthew
diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h index 5000d2a..8885c80 100644 --- a/sysdeps/mips/dl-machine.h +++ b/sysdeps/mips/dl-machine.h @@ -138,7 +138,11 @@ elf_machine_load_address (void) #ifndef __mips16 asm (" .set noreorder\n" " " STRINGXP (PTR_LA) " %0, 0f\n" +#if __mips_isa_rev < 6 " bltzal $0, 0f\n" +#else + " bal 0f\n" +#endif " nop\n" "0: " STRINGXP (PTR_SUBU) " %0, $31, %0\n" " .set reorder\n" @@ -241,6 +245,11 @@ do { \ and not just plain _start. */ #ifndef __mips16 +#if __mips_isa_rev < 6 +#define LOAD_31 STRINGXP(bltzal $8) "," STRINGXP(.Lcoff) +#else +#define LOAD_31 STRINGXP(bal .Lcoff) +#endif # define RTLD_START asm (\ ".text\n\ " _RTLD_PROLOGUE(ENTRY_POINT) "\ @@ -256,7 +265,7 @@ do { \ " STRINGXP(PTR_SUBIU) " $29, 16\n\ \n\ " STRINGXP(PTR_LA) " $8, .Lcoff\n\ - bltzal $8, .Lcoff\n\ + " LOAD_31 "\n\ .Lcoff: " STRINGXP(PTR_SUBU) " $8, $31, $8\n\ \n\ " STRINGXP(PTR_LA) " $25, _dl_start\n\