mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 12:50:30 +00:00
[Object][Mips] Return address of MIPS symbol with cleared microMIPS indicator bit
llvm-svn: 222726
This commit is contained in:
parent
906b92c9d0
commit
b1231365ea
@ -280,8 +280,9 @@ std::error_code ELFObjectFile<ELFT>::getSymbolAddress(DataRefImpl Symb,
|
||||
const Elf_Ehdr *Header = EF.getHeader();
|
||||
Result = ESym->st_value;
|
||||
|
||||
// Clear the ARM/Thumb indicator flag.
|
||||
if (Header->e_machine == ELF::EM_ARM && ESym->getType() == ELF::STT_FUNC)
|
||||
// Clear the ARM/Thumb or microMIPS indicator flag.
|
||||
if ((Header->e_machine == ELF::EM_ARM || Header->e_machine == ELF::EM_MIPS) &&
|
||||
ESym->getType() == ELF::STT_FUNC)
|
||||
Result &= ~1;
|
||||
|
||||
if (Header->e_type == ELF::ET_REL)
|
||||
|
BIN
test/Object/Inputs/micro-mips.elf-mipsel
Executable file
BIN
test/Object/Inputs/micro-mips.elf-mipsel
Executable file
Binary file not shown.
12
test/Object/Mips/objdump-micro-mips.test
Normal file
12
test/Object/Mips/objdump-micro-mips.test
Normal file
@ -0,0 +1,12 @@
|
||||
RUN: llvm-objdump -d -mattr=micromips %p/../Inputs/micro-mips.elf-mipsel \
|
||||
RUN: | FileCheck %s
|
||||
|
||||
CHECK: foo:
|
||||
CHECK-NEXT: 330: bd 33 f8 ff addiu $sp, $sp, -8
|
||||
CHECK-NEXT: 334: dd fb 04 00 sw $fp, 4($sp)
|
||||
CHECK-NEXT: 338: 1d 00 50 f1 addu $fp, $sp, $zero
|
||||
|
||||
CHECK: bar:
|
||||
CHECK-NEXT: 350: a2 41 02 00 lui $2, 2
|
||||
CHECK-NEXT: 354: 42 30 8f 80 addiu $2, $2, -32625
|
||||
CHECK-NEXT: 358: bd 33 e8 ff addiu $sp, $sp, -24
|
Loading…
Reference in New Issue
Block a user