[lld] 2461804 - [lld-macho] Symbol::value should always be uint64_t
Jez Ng via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 6 14:54:19 PDT 2021
Author: Jez Ng
Date: 2021-04-06T17:54:11-04:00
New Revision: 2461804b484e53e448632de0b195ce187e9b0b04
URL: https://github.com/llvm/llvm-project/commit/2461804b484e53e448632de0b195ce187e9b0b04
DIFF: https://github.com/llvm/llvm-project/commit/2461804b484e53e448632de0b195ce187e9b0b04.diff
LOG: [lld-macho] Symbol::value should always be uint64_t
D98837 migrated a bunch of `value`s to uint64_t, but missed these.
Added:
Modified:
lld/MachO/InputFiles.cpp
lld/MachO/SymbolTable.cpp
lld/MachO/SymbolTable.h
Removed:
################################################################################
diff --git a/lld/MachO/InputFiles.cpp b/lld/MachO/InputFiles.cpp
index 66dcca085cb5..8e554637f951 100644
--- a/lld/MachO/InputFiles.cpp
+++ b/lld/MachO/InputFiles.cpp
@@ -485,7 +485,8 @@ void ObjFile::parseSymbols(ArrayRef<typename LP::section> sectionHeaders,
nextIsec->data = isec->data.slice(symbolOffset);
isec->data = isec->data.slice(0, symbolOffset);
- // By construction, the symbol will be at offset zero in the new section.
+ // By construction, the symbol will be at offset zero in the new
+ // subsection.
symbols[symIndex] =
createDefined(sym, name, nextIsec, /*value=*/0, symbolSize);
// TODO: ld64 appears to preserve the original alignment as well as each
diff --git a/lld/MachO/SymbolTable.cpp b/lld/MachO/SymbolTable.cpp
index 127d513d1dda..76d4289e627b 100644
--- a/lld/MachO/SymbolTable.cpp
+++ b/lld/MachO/SymbolTable.cpp
@@ -159,7 +159,7 @@ Symbol *SymbolTable::addLazy(StringRef name, ArchiveFile *file,
}
Defined *SymbolTable::addSynthetic(StringRef name, InputSection *isec,
- uint32_t value, bool isPrivateExtern,
+ uint64_t value, bool isPrivateExtern,
bool includeInSymtab) {
Defined *s = addDefined(name, nullptr, isec, value, /*size=*/0,
/*isWeakDef=*/false, isPrivateExtern);
diff --git a/lld/MachO/SymbolTable.h b/lld/MachO/SymbolTable.h
index 8a5c16ca06aa..29aa03ec884b 100644
--- a/lld/MachO/SymbolTable.h
+++ b/lld/MachO/SymbolTable.h
@@ -52,7 +52,7 @@ class SymbolTable {
Symbol *addLazy(StringRef name, ArchiveFile *file,
const llvm::object::Archive::Symbol &sym);
- Defined *addSynthetic(StringRef name, InputSection *, uint32_t value,
+ Defined *addSynthetic(StringRef name, InputSection *, uint64_t value,
bool isPrivateExtern, bool includeInSymtab);
ArrayRef<Symbol *> getSymbols() const { return symVector; }
More information about the llvm-commits
mailing list