Changeset View
Changeset View
Standalone View
Standalone View
libexec/rtld-elf/mips/rtld_start.S
Show First 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | #endif | ||||
move a0, v1 /* old GP */ | move a0, v1 /* old GP */ | ||||
PTR_SUBU a0, a0, 0x7ff0 /* The offset of $gp from the */ | PTR_SUBU a0, a0, 0x7ff0 /* The offset of $gp from the */ | ||||
/* beginning of the .got section: */ | /* beginning of the .got section: */ | ||||
/* $gp = .got + 0x7ff0, so */ | /* $gp = .got + 0x7ff0, so */ | ||||
/* .got = $gp - 0x7ff0 */ | /* .got = $gp - 0x7ff0 */ | ||||
/* Simple math as you can see. */ | /* Simple math as you can see. */ | ||||
#if defined(__mips_n64) | #if defined(__mips_n64) | ||||
not t0, zero | |||||
srl t0, 1 | |||||
ld a0, 8(a0) /* object = pltgot[1] */ | ld a0, 8(a0) /* object = pltgot[1] */ | ||||
and a0, a0, 0x7fffffffffffffff | and a0, a0, t0 | ||||
sbruno: This syntax doesn't work with clang. The "fixed" version being proposed (thanks Ed!) compiles… | |||||
simon.dardis_imgtec.comUnsubmitted Not Done Inline ActionsThat immediate is bigger than we normally take. It should be simple enough to extend IAS to accept it for N32 / N64. simon.dardis_imgtec.com: That immediate is bigger than we normally take. It should be simple enough to extend IAS to… | |||||
#else | #else | ||||
lw a0, 4(a0) /* object = pltgot[1] & 0x7fffffff */ | lw a0, 4(a0) /* object = pltgot[1] & 0x7fffffff */ | ||||
Done Inline ActionsIn this version there's no load from a0 any more so this is not at all the same thing. You need to restore ld a0, 8(a0) /* object = pltgot[1] */ brooks: In this version there's no load from a0 any more so this is not at all the same thing. You… | |||||
Not Done Inline ActionsRestored ld instruction. sbruno: Restored ld instruction. | |||||
and a0, a0, 0x7fffffff | and a0, a0, 0x7fffffff | ||||
#endif | #endif | ||||
move a1, t8 /* symbol index */ | move a1, t8 /* symbol index */ | ||||
PTR_LA t9, _C_LABEL(_mips_rtld_bind) | PTR_LA t9, _C_LABEL(_mips_rtld_bind) | ||||
jalr t9 | jalr t9 | ||||
nop | nop | ||||
Show All 19 Lines |
This syntax doesn't work with clang. The "fixed" version being proposed (thanks Ed!) compiles with both gcc 4.2 and clang.