This diff is a part of the bigger project which goal is to improve common profiling tools support (perf) for GHC binaries.
A similar job was already done and reverted in the past:
Perf and similar tools build in memory symbol table from the .symtab section of the ELF file to
display human-readable function names instead of the addresses in the output. Perf uses only
two types of symbols: @function and @notype but GHC is not capable to produce any @function
symbols so the perf output is pretty useless (All the haskell symbols that you can see in perf now are @notype
internal symbols extracted by mistake/hack).
- mark code related symbols as @function
- small hack to mark InfoTable symbols as code if TABLES_NEXT_TO_CODE is true
- The perf symbolization support is not complete after this patch but I'm working on the second patch.
- Constructor symbols are not supported. To fix that we can issue extra local symbols which mark code sections as code and will be only used for debug.