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,
67
67
InputSection *toIsec, Defined *skip,
68
68
uint64_t fromOff, uint64_t toOff) {
69
69
// 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);
74
79
llvm::erase_if (fromIsec->symbols , [&](Symbol *s) {
75
80
auto *d = cast<Defined>(s);
76
81
if (d->value != fromOff)
You can’t perform that action at this time.
0 commit comments