aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/XCOFFObjectFile.cpp
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2022-11-19 09:58:14 -0800
committerVitaly Buka <vitalybuka@google.com>2022-11-19 09:58:14 -0800
commitbe954243f4c29842a4ea882a04477881f2770855 (patch)
tree4f624182636b8f0d45a9df05c57f80207947312c /llvm/lib/Object/XCOFFObjectFile.cpp
parent7c188afde1f056c98b9577d42b49459c09b19a66 (diff)
downloadllvm-be954243f4c29842a4ea882a04477881f2770855.zip
llvm-be954243f4c29842a4ea882a04477881f2770855.tar.gz
llvm-be954243f4c29842a4ea882a04477881f2770855.tar.bz2
Revert "[XCOFF] llvvm-readobj support display symbol table of loader section of xcoff object file."
Use of uninitialized value. This reverts commit 037f5c283a2278ef156189be48db0738323206bd.
Diffstat (limited to 'llvm/lib/Object/XCOFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/XCOFFObjectFile.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp
index 061c47d..c758e35 100644
--- a/llvm/lib/Object/XCOFFObjectFile.cpp
+++ b/llvm/lib/Object/XCOFFObjectFile.cpp
@@ -89,34 +89,6 @@ uint8_t XCOFFRelocation<AddressType>::getRelocatedLength() const {
template struct ExceptionSectionEntry<support::ubig32_t>;
template struct ExceptionSectionEntry<support::ubig64_t>;
-template <typename T>
-Expected<StringRef> getLoaderSecSymNameInStrTbl(const T *LoaderSecHeader,
- uint64_t Offset) {
- if (LoaderSecHeader->LengthOfStrTbl > Offset)
- return (reinterpret_cast<const char *>(LoaderSecHeader) +
- LoaderSecHeader->OffsetToStrTbl + Offset);
-
- return createError("entry with offset 0x" + Twine::utohexstr(Offset) +
- " in the loader section's string table with size 0x" +
- Twine::utohexstr(LoaderSecHeader->LengthOfStrTbl) +
- " is invalid");
-}
-
-Expected<StringRef> LoaderSectionSymbolEntry32::getSymbolName(
- const LoaderSectionHeader32 *LoaderSecHeader32) const {
- const NameOffsetInStrTbl *NameInStrTbl =
- reinterpret_cast<const NameOffsetInStrTbl *>(SymbolName);
- if (NameInStrTbl->IsNameInStrTbl != XCOFFSymbolRef::NAME_IN_STR_TBL_MAGIC)
- return generateXCOFFFixedNameStringRef(SymbolName);
-
- return getLoaderSecSymNameInStrTbl(LoaderSecHeader32, NameInStrTbl->Offset);
-}
-
-Expected<StringRef> LoaderSectionSymbolEntry64::getSymbolName(
- const LoaderSectionHeader64 *LoaderSecHeader64) const {
- return getLoaderSecSymNameInStrTbl(LoaderSecHeader64, Offset);
-}
-
uintptr_t
XCOFFObjectFile::getAdvancedSymbolEntryAddress(uintptr_t CurrentAddress,
uint32_t Distance) {