[lld/mac] Fix issues around thin archives
- most importantly, fix a use-after-free when using thin archives, by putting the archive unique_ptr to the arena allocator. This ports D65565 to MachO - correctly demangle symbol namess from archives in diagnostics - add a test for thin archives -- it finds this UaF, but only when running it under asan (it also finds the demangling fix) - make forceLoadArchive() use addFile() with a bool to have the archive loading code in fewer places. no behavior change; matches COFF port a bit better Differential Revision: https://reviews.llvm.org/D92360
Showing
- lld/MachO/Driver.cpp 19 additions, 20 deletionslld/MachO/Driver.cpp
- lld/MachO/InputFiles.cpp 3 additions, 3 deletionslld/MachO/InputFiles.cpp
- lld/MachO/Symbols.cpp 15 additions, 7 deletionslld/MachO/Symbols.cpp
- lld/MachO/Symbols.h 2 additions, 0 deletionslld/MachO/Symbols.h
- lld/test/MachO/thin-archive.s 41 additions, 0 deletionslld/test/MachO/thin-archive.s
Loading
Please register or sign in to comment