mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
Only clear the thumb bit from function addresses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205500 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
96b816800e
commit
ee2bf5b607
@ -292,7 +292,8 @@ error_code ELFObjectFile<ELFT>::getSymbolAddress(DataRefImpl Symb,
|
||||
Result = ESym->st_value;
|
||||
|
||||
// Clear the ARM/Thumb indicator flag.
|
||||
if (Header->e_machine == ELF::EM_ARM)
|
||||
if (EF.getHeader()->e_machine == ELF::EM_ARM &&
|
||||
ESym->getType() == ELF::STT_FUNC)
|
||||
Result &= ~1;
|
||||
|
||||
if (Header->e_type == ELF::ET_REL)
|
||||
|
BIN
test/Object/Inputs/thumb-symbols.elf.arm
Normal file
BIN
test/Object/Inputs/thumb-symbols.elf.arm
Normal file
Binary file not shown.
@ -18,6 +18,9 @@ RUN: llvm-nm %p/Inputs/common.coff-i386 \
|
||||
RUN: | FileCheck %s -check-prefix COFF-COMMON
|
||||
RUN: llvm-nm %p/Inputs/relocatable-with-section-address.elf-x86-64 \
|
||||
RUN: | FileCheck %s -check-prefix ELF-SEC-ADDR
|
||||
RUN: llvm-nm %p/Inputs/thumb-symbols.elf.arm \
|
||||
RUN: | FileCheck %s -check-prefix ELF-THUMB
|
||||
|
||||
|
||||
COFF: 00000000 d .data
|
||||
COFF: 00000000 t .text
|
||||
@ -64,3 +67,8 @@ ELF-SEC-ADDR-NEXT: 0000005c D b
|
||||
ELF-SEC-ADDR-NEXT: 00000040 T f
|
||||
ELF-SEC-ADDR-NEXT: 00000050 T g
|
||||
ELF-SEC-ADDR-NEXT: 00000060 D p
|
||||
|
||||
|
||||
Test that we drop the thumb bit only from function addresses.
|
||||
ELF-THUMB: 00000000 t f
|
||||
ELF-THUMB: 00000003 t g
|
||||
|
Loading…
x
Reference in New Issue
Block a user