... instead of mapping them to the intermediate object file.
This matches ld64.
Details
- Reviewers
Roger - Group Reviewers
Restricted Project - Commits
- rGb9457330266e: [lld-macho] Map file should map symbols to their original bitcode file
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Looks good !
lld/MachO/MapFile.cpp | ||
---|---|---|
45 | Could we make this name more specific? Like "SymbolEmittingFiles" or "EmittingFilese"? | |
50 | can this function be made static? | |
lld/test/MachO/map-file.ll | ||
5–6 | For my benefit, could you explain more what this sentence means? Why would a "redundant object file" be and how would they be emitted? | |
11 | As I understand, this flag makes the output into a dynamic library. Is this feature specific to dynamic libraries? | |
24–48 | If I understand correctly, these two tests are there to show that the maybe_weak symbol gets attributed to the bar file regardless of the order of the input files (because maybe_weak symbol is not weak in the bar file). Could we write that down as a comment here? |
lld/MachO/MapFile.cpp | ||
---|---|---|
45 | I don't really think that makes things clearer. This entire file contains logic around emitting the map file, and this struct itself is called MapInfo; adding 'emit' here is redundant. We're not writing "emitLiveSymbols" below after all. I think looking at the map file output (of which a sample is contained in the comment at the top of the file) should provide a strong hint as to why this vector exists | |
lld/test/MachO/map-file.ll | ||
5–6 | The intermediate object files referenced in the previous sentence are usually unreferenced, since we are mapping the symbols to the original bitcode files instead. But they may be referenced if they contain a synthesized symbol such as an outlined function. (I'll add a TODO to test that case.) Object files can also become unreferenced if all the symbols defined within are weak definitions that get overridden. But that's not being tested here. I'll remove 'redundant' and just say 'intermediate object files'. | |
11 | no, but I don't want to have to define main | |
24–48 | added a comment above the definition of maybe_weak |
Could we make this name more specific? Like "SymbolEmittingFiles" or "EmittingFilese"?