This matches ld64. Also improve the test for -dead_strip.
Details
Details
- Reviewers
thakis gkm int3 - Group Reviewers
Restricted Project - Commits
- rG005456e5fc67: [lld-macho] Fix an assertion failure when -u specifies an undefined…
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
I don't understand this... shouldn't -u symbols also be marked live? MarkLive.cpp does traverse explicitUndefineds after all. Also I patched this diff, added back the assert, and ran the start-end.s test, and the assert wasn't triggered
Comment Actions
Gotcha, thanks for fixing the test. I still think the assert is correct... as long as we fix MarkLive to mark all explicitUndefineds:
--- a/lld/MachO/MarkLive.cpp +++ b/lld/MachO/MarkLive.cpp @@ -96,8 +96,7 @@ void markLive() { } // -u symbols for (Symbol *sym : config->explicitUndefineds) - if (auto *defined = dyn_cast<Defined>(sym)) - addSym(defined); + addSym(sym); // local symbols explicitly marked .no_dead_strip for (const InputFile *file : inputFiles) if (auto *objFile = dyn_cast<ObjFile>(file))