mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-14 15:28:20 +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:
@@ -292,7 +292,8 @@ error_code ELFObjectFile<ELFT>::getSymbolAddress(DataRefImpl Symb,
|
|||||||
Result = ESym->st_value;
|
Result = ESym->st_value;
|
||||||
|
|
||||||
// Clear the ARM/Thumb indicator flag.
|
// 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;
|
Result &= ~1;
|
||||||
|
|
||||||
if (Header->e_type == ELF::ET_REL)
|
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: | FileCheck %s -check-prefix COFF-COMMON
|
||||||
RUN: llvm-nm %p/Inputs/relocatable-with-section-address.elf-x86-64 \
|
RUN: llvm-nm %p/Inputs/relocatable-with-section-address.elf-x86-64 \
|
||||||
RUN: | FileCheck %s -check-prefix ELF-SEC-ADDR
|
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 d .data
|
||||||
COFF: 00000000 t .text
|
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: 00000040 T f
|
||||||
ELF-SEC-ADDR-NEXT: 00000050 T g
|
ELF-SEC-ADDR-NEXT: 00000050 T g
|
||||||
ELF-SEC-ADDR-NEXT: 00000060 D p
|
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
|
||||||
|
Reference in New Issue
Block a user