Skip to content

Commit 29c6f5c

Browse files
author
Alexander Shaposhnikov
committed
[llvm-objcopy][MachO] Fix build
Some compilers are confused when the same name is used in different contexts. Rename the field Section to unbreak the build. (Caught by the buildbot http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/22374)
1 parent 0db3a5a commit 29c6f5c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

llvm/tools/llvm-objcopy/MachO/MachOReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ void MachOReader::setSymbolInRelocationInfo(Object &O) const {
222222
// if we encounter an invalid relocation.
223223
assert(SymbolNum >= 1 && SymbolNum <= Sections.size() &&
224224
"Invalid section index.");
225-
Reloc.Section = Sections[SymbolNum - 1];
225+
Reloc.Sec = Sections[SymbolNum - 1];
226226
}
227227
}
228228
}

llvm/tools/llvm-objcopy/MachO/MachOWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ void MachOWriter::writeSections() {
243243
if (!RelocInfo.Scattered) {
244244
const uint32_t SymbolNum = RelocInfo.Extern
245245
? (*RelocInfo.Symbol)->Index
246-
: (*RelocInfo.Section)->Index;
246+
: (*RelocInfo.Sec)->Index;
247247
RelocInfo.setPlainRelocationSymbolNum(SymbolNum, IsLittleEndian);
248248
}
249249
if (IsLittleEndian != sys::IsLittleEndianHost)

llvm/tools/llvm-objcopy/MachO/Object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ struct RelocationInfo {
165165
// The referenced symbol entry. Set if !Scattered && Extern.
166166
Optional<const SymbolEntry *> Symbol;
167167
// The referenced section. Set if !Scattered && !Extern.
168-
Optional<const Section *> Section;
168+
Optional<const Section *> Sec;
169169
// True if Info is a scattered_relocation_info.
170170
bool Scattered;
171171
// True if the r_symbolnum points to a section number (i.e. r_extern=0).

0 commit comments

Comments
 (0)