mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
d12ae1eaf8
Currently when .llvm.call-graph-profile is created by llvm it explicitly encodes the symbol indices. This section is basically a black box for post processing tools. For example, if we run strip -s on the object files the symbol table changes, but indices in that section do not. In non-visible behavior indices point to wrong symbols. The visible behavior indices point outside of Symbol table: "invalid symbol index". This patch changes the format by using R_*_NONE relocations to indicate the from/to symbols. The Frequency (Weight) will still be in the .llvm.call-graph-profile, but symbol information will be in relocation section. In LLD information from both sections is used to reconstruct call graph profile. Relocations themselves will never be applied. With this approach post processing tools that handle relocations correctly work for this section also. Tools can add/remove symbols and as long as they handle relocation sections with this approach information stays correct. Doing a quick experiment with clang-13. The size went up from 107KB to 322KB, aggregate of all the input sections. Size of clang-13 binary is ~118MB. For users of -fprofile-use/-fprofile-sample-use the size of object files will go up slightly, it will not impact final binary size. Reviewed By: jhenderson, MaskRay Differential Revision: https://reviews.llvm.org/D104080 |
||
---|---|---|
.. | ||
ArchiveYAML.h | ||
CodeViewYAMLDebugSections.h | ||
CodeViewYAMLSymbols.h | ||
CodeViewYAMLTypeHashing.h | ||
CodeViewYAMLTypes.h | ||
COFFYAML.h | ||
DWARFEmitter.h | ||
DWARFYAML.h | ||
ELFYAML.h | ||
MachOYAML.h | ||
MinidumpYAML.h | ||
ObjectYAML.h | ||
WasmYAML.h | ||
XCOFFYAML.h | ||
yaml2obj.h | ||
YAML.h |