[PATCH] D96735: [llvm-objdump] Map STT_TLS to ST_Other (previously ST_Data)
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 15 15:49:42 PST 2021
MaskRay created this revision.
MaskRay added a reviewer: jhenderson.
Herald added subscribers: rupprecht, emaste.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
ST_Data is used to model BFD `BFD_OBJECT`.
A STT_TLS symbol does not have the `BFD_OBJECT` flag in BFD.
This makes sense because a STT_TLS symbol is like in a different address space,
normal data/object properties do not apply on them.
With this change, a STT_TLS symbol will not be displayed as 'O'.
This new behavior matches objdump.
I think llvm-objdump is the only affected component by this change.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D96735
Files:
llvm/include/llvm/Object/ELFObjectFile.h
llvm/test/tools/llvm-objdump/ELF/symbol-table.test
Index: llvm/test/tools/llvm-objdump/ELF/symbol-table.test
===================================================================
--- llvm/test/tools/llvm-objdump/ELF/symbol-table.test
+++ llvm/test/tools/llvm-objdump/ELF/symbol-table.test
@@ -14,7 +14,7 @@
# CHECK-NEXT:0000000000000000 g O .data 0000000000000010 object
# CHECK-NEXT:0000000000000000 g F .text 000000000000000f func
# CHECK-NEXT:0000000000000000 g O *COM* 0000000000000000 common
-# CHECK-NEXT:0000000000000000 g O .data 0000000000000000 tls
+# CHECK-NEXT:0000000000000000 g .data 0000000000000000 tls
# CHECK-NEXT:0000000000000000 g i .text 0000000000000000 ifunc
# CHECK-NEXT:0000000000000000 g .text 0000000000000000 invalid_type
# CHECK-NEXT:0000000000000000 g .text 0000000000000000 STT_HIOS
Index: llvm/include/llvm/Object/ELFObjectFile.h
===================================================================
--- llvm/include/llvm/Object/ELFObjectFile.h
+++ llvm/include/llvm/Object/ELFObjectFile.h
@@ -670,8 +670,8 @@
return SymbolRef::ST_Function;
case ELF::STT_OBJECT:
case ELF::STT_COMMON:
- case ELF::STT_TLS:
return SymbolRef::ST_Data;
+ case ELF::STT_TLS:
default:
return SymbolRef::ST_Other;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96735.323839.patch
Type: text/x-patch
Size: 1243 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210215/93f92296/attachment.bin>
More information about the llvm-commits
mailing list