llvm.org GIT mirror llvm / c5e9bf5
[Object][Mips] Return address of MIPS symbol with cleared microMIPS indicator bit git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222726 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Atanasyan 6 years ago
3 changed file(s) with 15 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
279279 const Elf_Ehdr *Header = EF.getHeader();
280280 Result = ESym->st_value;
281281
282 // Clear the ARM/Thumb indicator flag.
283 if (Header->e_machine == ELF::EM_ARM && ESym->getType() == ELF::STT_FUNC)
282 // Clear the ARM/Thumb or microMIPS indicator flag.
283 if ((Header->e_machine == ELF::EM_ARM || Header->e_machine == ELF::EM_MIPS) &&
284 ESym->getType() == ELF::STT_FUNC)
284285 Result &= ~1;
285286
286287 if (Header->e_type == ELF::ET_REL)
0 RUN: llvm-objdump -d -mattr=micromips %p/../Inputs/micro-mips.elf-mipsel \
1 RUN: | FileCheck %s
2
3 CHECK: foo:
4 CHECK-NEXT: 330: bd 33 f8 ff addiu $sp, $sp, -8
5 CHECK-NEXT: 334: dd fb 04 00 sw $fp, 4($sp)
6 CHECK-NEXT: 338: 1d 00 50 f1 addu $fp, $sp, $zero
7
8 CHECK: bar:
9 CHECK-NEXT: 350: a2 41 02 00 lui $2, 2
10 CHECK-NEXT: 354: 42 30 8f 80 addiu $2, $2, -32625
11 CHECK-NEXT: 358: bd 33 e8 ff addiu $sp, $sp, -24