https://bugs.llvm.org/show_bug.cgi?id=50689

            Bug ID: 50689
           Summary: Finish / clean up MapFile implementation
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: MachO
          Assignee: unassignedb...@nondot.org
          Reporter: jezr...@gmail.com
                CC: g...@fb.com, jezr...@gmail.com,
                    llvm-bugs@lists.llvm.org, smee...@fb.com

These are probably good tasks for someone looking to get familiarized with the
LLD codebase, since the mapfile isn't critical to what we are working on at the
moment. (Please ping me first before starting on these.)

1. Dump dead-stripped symbols, as per this TODO:
https://github.com/llvm/llvm-project/blob/main/lld/MachO/MapFile.cpp#L153.
Essentially, symbols for which `isLive()` returns false.

2. getSectionSyms() puts all the symbols into a map of section -> symbols, but
this seems unnecessary. This was likely copied from the ELF port, which prints
a section header before the list of symbols it contains. But the Mach-O map
file doesn't print these headers.

3. Parallelize the symbol sort. We can use LLVM's `parallel_sort` for this. If
two symbols have the same address, we can use their symbol name to tie-break;
the end result should be deterministic.

4. Dump the cstring / fixed-width literals (from CStringInputSection and
WordLiteralInputSection respectively) into the map file.

To see the expected map file output, download the tar attachment from
https://bugs.llvm.org/show_bug.cgi?id=48657. Unpack and link it like so: `ld
-map mapfile @response.txt`. This will generate a "mapfile" file in the CWD.
This mapfile will contain examples dead symbols and literals (grep for "literal
string" in the file).

That said, this file is pretty large (since Chromium is pretty large), so you
may want to construct smaller test programs for a better understanding.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to