aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/XCOFFObjectFile.cpp
diff options
context:
space:
mode:
authordiggerlin <digger.llvm@gmail.com>2020-04-06 10:09:12 -0400
committerdiggerlin <digger.llvm@gmail.com>2020-04-06 10:10:10 -0400
commita26a441b99ff313a56c3e35ee526342d3f43c8b8 (patch)
tree07bc61735f4bebd4559fcc0662a8322f9b259553 /llvm/lib/Object/XCOFFObjectFile.cpp
parent9072df8ac1431dba51394b77ead766aada82867f (diff)
downloadllvm-a26a441b99ff313a56c3e35ee526342d3f43c8b8.zip
llvm-a26a441b99ff313a56c3e35ee526342d3f43c8b8.tar.gz
llvm-a26a441b99ff313a56c3e35ee526342d3f43c8b8.tar.bz2
[llvm-objdump][XCOFF] Use symbol index+symbol name + storage mapping class as label for -D
SUMMARY: For the llvm-objdump -D, the symbol name is used as a label in the disassembly for the specific address (when a symbol address is equal to the virtual address in the dump). In XCOFF, multiple symbols may have the same name, being differentiated by their storage mapping class. It is helpful to print the QualName and not just the name when forming the output label for a csect symbol. The symbol index further removes any ambiguity caused by duplicate names. To maintain compatibility with the binutils objdump, the XCOFF-specific --symbol-description option is added to enable the enhanced format. Reviewers: hubert.reinterpretcast, James Henderson, Jason Liu ,daltenty Subscribers: wuzish, nemanjai, hiraditya Differential Revision: https://reviews.llvm.org/D72973
Diffstat (limited to 'llvm/lib/Object/XCOFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/XCOFFObjectFile.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp
index d56c168..3ec19c0 100644
--- a/llvm/lib/Object/XCOFFObjectFile.cpp
+++ b/llvm/lib/Object/XCOFFObjectFile.cpp
@@ -766,6 +766,8 @@ uint8_t XCOFFSymbolRef::getNumberOfAuxEntries() const {
return OwningObjectPtr->toSymbolEntry(SymEntDataRef)->NumberOfAuxEntries;
}
+// TODO: The function needs to return an error if there is no csect auxiliary
+// entry.
const XCOFFCsectAuxEnt32 *XCOFFSymbolRef::getXCOFFCsectAuxEnt32() const {
assert(!OwningObjectPtr->is64Bit() &&
"32-bit interface called on 64-bit object file.");
@@ -791,6 +793,8 @@ int16_t XCOFFSymbolRef::getSectionNumber() const {
return OwningObjectPtr->toSymbolEntry(SymEntDataRef)->SectionNumber;
}
+// TODO: The function name needs to be changed to express the purpose of the
+// function.
bool XCOFFSymbolRef::hasCsectAuxEnt() const {
XCOFF::StorageClass SC = getStorageClass();
return (SC == XCOFF::C_EXT || SC == XCOFF::C_WEAKEXT ||