[lld] 3f82caf - [lld] Fix a warning
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 30 13:33:38 PDT 2022
Author: Kazu Hirata
Date: 2022-10-30T13:33:33-07:00
New Revision: 3f82caf7b1654ede5be8e48bc6b8a2c75c96c345
URL: https://github.com/llvm/llvm-project/commit/3f82caf7b1654ede5be8e48bc6b8a2c75c96c345
DIFF: https://github.com/llvm/llvm-project/commit/3f82caf7b1654ede5be8e48bc6b8a2c75c96c345.diff
LOG: [lld] Fix a warning
This patch fixes:
lld/MachO/SyntheticSections.cpp: In member function ‘virtual void
lld::macho::ChainedFixupsSection::writeTo(uint8_t*) const’:
Added:
Modified:
lld/MachO/SyntheticSections.cpp
Removed:
################################################################################
diff --git a/lld/MachO/SyntheticSections.cpp b/lld/MachO/SyntheticSections.cpp
index cc1b8f1d9789..c1da64179026 100644
--- a/lld/MachO/SyntheticSections.cpp
+++ b/lld/MachO/SyntheticSections.cpp
@@ -2174,8 +2174,9 @@ void ChainedFixupsSection::writeTo(uint8_t *buf) const {
uint64_t nameOffset = 0;
for (auto [import, idx] : bindings) {
const Symbol &sym = *import.first;
- int16_t libOrdinal = needsWeakBind(sym) ? BIND_SPECIAL_DYLIB_WEAK_LOOKUP
- : ordinalForSymbol(sym);
+ int16_t libOrdinal = needsWeakBind(sym)
+ ? (int64_t)BIND_SPECIAL_DYLIB_WEAK_LOOKUP
+ : ordinalForSymbol(sym);
buf += writeImport(buf, importFormat, libOrdinal, sym.isWeakRef(),
nameOffset, import.second);
nameOffset += sym.getName().size() + 1;
More information about the llvm-commits
mailing list