[PATCH] D146534: [llvm-nm] Print EC symbol map.

Jacek Caban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 13:57:22 PDT 2023

jacek added a comment.

In D146534#4217452 <https://reviews.llvm.org/D146534#4217452>, @efriedma wrote:

>> I wasn't sure what to do when the map is invalid. We could treat it as an error in Archive constructor, but I decided to just ignore the map instead assuming that the archive may still be useful.
> Actually, hmm... maybe we should reject in this case.  I mean, the archive might be "useful" in the sense that it contains interesting object files someone might want to use, but what's the linker supposed to do if symbol map is malformed?  If we eat the error, it'll just assume there just aren't any symbols, so it'll produce weird link errors or an invalid executable.

My thinking was that things like llvm-lib -extract or merging with llvm-lib (which would generate a new map) could still work. Linker could do whole archive import and build pure ARM64 binaries (although I guess we should also have validation for regular map, which has similar consequences). I think we could move validation to ec_symbols() so that callers that need it may handle error.



More information about the llvm-commits mailing list