[llvm] r205500 - Only clear the thumb bit from function addresses.
Rafael Espindola
rafael.espindola at gmail.com
Wed Apr 2 19:20:44 PDT 2014
Author: rafael
Date: Wed Apr 2 21:20:43 2014
New Revision: 205500
URL: http://llvm.org/viewvc/llvm-project?rev=205500&view=rev
Log:
Only clear the thumb bit from function addresses.
Added:
llvm/trunk/test/Object/Inputs/thumb-symbols.elf.arm
Modified:
llvm/trunk/include/llvm/Object/ELFObjectFile.h
llvm/trunk/test/Object/nm-trivial-object.test
Modified: llvm/trunk/include/llvm/Object/ELFObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELFObjectFile.h?rev=205500&r1=205499&r2=205500&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELFObjectFile.h (original)
+++ llvm/trunk/include/llvm/Object/ELFObjectFile.h Wed Apr 2 21:20:43 2014
@@ -292,7 +292,8 @@ error_code ELFObjectFile<ELFT>::getSymbo
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)
Added: llvm/trunk/test/Object/Inputs/thumb-symbols.elf.arm
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Inputs/thumb-symbols.elf.arm?rev=205500&view=auto
==============================================================================
Binary files llvm/trunk/test/Object/Inputs/thumb-symbols.elf.arm (added) and llvm/trunk/test/Object/Inputs/thumb-symbols.elf.arm Wed Apr 2 21:20:43 2014 differ
Modified: llvm/trunk/test/Object/nm-trivial-object.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/nm-trivial-object.test?rev=205500&r1=205499&r2=205500&view=diff
==============================================================================
--- llvm/trunk/test/Object/nm-trivial-object.test (original)
+++ llvm/trunk/test/Object/nm-trivial-object.test Wed Apr 2 21:20:43 2014
@@ -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
More information about the llvm-commits
mailing list