forked from OSchip/llvm-project
[MIPS] Setup less-significant bit in a symbol value in microMIPS thunks
The less-significant bit signals about microMIPS code for jump/branch instructions. llvm-svn: 317778
This commit is contained in:
parent
60d74e4588
commit
3a7044ef78
|
@ -258,7 +258,7 @@ InputSection *MipsThunk::getTargetInputSection() const {
|
|||
// Write microMIPS R2-R5 LA25 thunk code
|
||||
// to call PIC function from the non-PIC one.
|
||||
void MicroMipsThunk::writeTo(uint8_t *Buf, ThunkSection &) const {
|
||||
uint64_t S = Destination.getVA();
|
||||
uint64_t S = Destination.getVA() | 1;
|
||||
write16(Buf, 0x41b9, Config->Endianness); // lui $25, %hi(func)
|
||||
write16(Buf + 4, 0xd400, Config->Endianness); // j func
|
||||
write16(Buf + 8, 0x3339, Config->Endianness); // addiu $25, $25, %lo(func)
|
||||
|
@ -283,7 +283,7 @@ InputSection *MicroMipsThunk::getTargetInputSection() const {
|
|||
// Write microMIPS R6 LA25 thunk code
|
||||
// to call PIC function from the non-PIC one.
|
||||
void MicroMipsR6Thunk::writeTo(uint8_t *Buf, ThunkSection &) const {
|
||||
uint64_t S = Destination.getVA();
|
||||
uint64_t S = Destination.getVA() | 1;
|
||||
uint64_t P = ThunkSym->getVA();
|
||||
write16(Buf, 0x1320, Config->Endianness); // lui $25, %hi(func)
|
||||
write16(Buf + 4, 0x3339, Config->Endianness); // addiu $25, $25, %lo(func)
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
# EB: __microLA25Thunk_foo:
|
||||
# EB-NEXT: 20008: 41 b9 00 02 lui $25, 2
|
||||
# EB-NEXT: 2000c: d4 01 00 10 j 131104
|
||||
# EB-NEXT: 20010: 33 39 00 20 addiu $25, $25, 32
|
||||
# EB-NEXT: 20010: 33 39 00 21 addiu $25, $25, 33
|
||||
# EB-NEXT: 20014: 0c 00 nop
|
||||
|
||||
# EL: __start:
|
||||
|
@ -37,7 +37,7 @@
|
|||
# EL: __microLA25Thunk_foo:
|
||||
# EL-NEXT: 20008: b9 41 02 00 lui $25, 2
|
||||
# EL-NEXT: 2000c: 01 d4 10 00 j 131104
|
||||
# EL-NEXT: 20010: 39 33 20 00 addiu $25, $25, 32
|
||||
# EL-NEXT: 20010: 39 33 21 00 addiu $25, $25, 33
|
||||
# EL-NEXT: 20014: 00 0c nop
|
||||
|
||||
.text
|
||||
|
|
Loading…
Reference in New Issue