File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -67,10 +67,15 @@ static void transplantSymbolsAtOffset(InputSection *fromIsec,
6767 InputSection *toIsec, Defined *skip,
6868 uint64_t fromOff, uint64_t toOff) {
6969 // Ensure the symbols will still be in address order after our insertions.
70- auto insertIt = llvm::upper_bound (toIsec->symbols , toOff,
71- [](uint64_t off, const Symbol *s) {
72- return cast<Defined>(s)->value < off;
73- });
70+ auto symSucceedsOff = [](uint64_t off, const Symbol *s) {
71+ return cast<Defined>(s)->value > off;
72+ };
73+ assert (std::is_partitioned (toIsec->symbols .begin (), toIsec->symbols .end (),
74+ [symSucceedsOff, toOff](const Symbol *s) {
75+ return !symSucceedsOff (toOff, s);
76+ }) &&
77+ " Symbols in toIsec must be partitioned by toOff." );
78+ auto insertIt = llvm::upper_bound (toIsec->symbols , toOff, symSucceedsOff);
7479 llvm::erase_if (fromIsec->symbols , [&](Symbol *s) {
7580 auto *d = cast<Defined>(s);
7681 if (d->value != fromOff)
You can’t perform that action at this time.
0 commit comments