Skip to content

Commit 7353c9b

Browse files
bjopecarlocab
authored andcommitted
[lld][MachO] Fix symbol insertion in transplantSymbolsAtOffset
The existing comparison does not insert symbols in the intended place. Unfortunately, it is not very clear how to test this. Suggestions appreciated. Closes #120559.
1 parent 54309b1 commit 7353c9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lld/MachO/SymbolTable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static void transplantSymbolsAtOffset(InputSection *fromIsec,
6969
// Ensure the symbols will still be in address order after our insertions.
7070
auto insertIt = llvm::upper_bound(toIsec->symbols, toOff,
7171
[](uint64_t off, const Symbol *s) {
72-
return cast<Defined>(s)->value < off;
72+
return cast<Defined>(s)->value > off;
7373
});
7474
llvm::erase_if(fromIsec->symbols, [&](Symbol *s) {
7575
auto *d = cast<Defined>(s);

0 commit comments

Comments
 (0)