[llvm] r178676 - When dumping clear the arm/thumb flag for now.
Eric Christopher
echristo at gmail.com
Wed Apr 3 11:31:12 PDT 2013
Author: echristo
Date: Wed Apr 3 13:31:12 2013
New Revision: 178676
URL: http://llvm.org/viewvc/llvm-project?rev=178676&view=rev
Log:
When dumping clear the arm/thumb flag for now.
Patch by Nico Rieck!
Added:
llvm/trunk/test/Object/ARM/
llvm/trunk/test/Object/ARM/symbol-addr.ll
Modified:
llvm/trunk/include/llvm/Object/ELF.h
Modified: llvm/trunk/include/llvm/Object/ELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELF.h?rev=178676&r1=178675&r2=178676&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELF.h (original)
+++ llvm/trunk/include/llvm/Object/ELF.h Wed Apr 3 13:31:12 2013
@@ -1058,6 +1058,11 @@ error_code ELFObjectFile<ELFT>::getSymbo
IsRelocatable = true;
}
Result = symb->st_value;
+
+ // Clear the ARM/Thumb indicator flag.
+ if (Header->e_machine == ELF::EM_ARM)
+ Result &= ~1;
+
if (IsRelocatable && Section != 0)
Result += Section->sh_addr;
return object_error::success;
Added: llvm/trunk/test/Object/ARM/symbol-addr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/ARM/symbol-addr.ll?rev=178676&view=auto
==============================================================================
--- llvm/trunk/test/Object/ARM/symbol-addr.ll (added)
+++ llvm/trunk/test/Object/ARM/symbol-addr.ll Wed Apr 3 13:31:12 2013
@@ -0,0 +1,12 @@
+; RUN: llc %s -mtriple=arm-unknown-unknown -filetype=obj -o - \
+; RUN: | llvm-objdump -t - | FileCheck %s
+; RUN: llc %s -mtriple=thumb-unknown-unknown -filetype=obj -o - \
+; RUN: | llvm-objdump -t - | FileCheck %s
+
+; Check that the symbol address does not include the ARM/Thumb instruction
+; indicator bit.
+; CHECK: 00000000 g F .text {{[0-9]+}} test
+
+define i32 @test() {
+ ret i32 1
+}
More information about the llvm-commits
mailing list