1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/tools/llvm-readobj
Alexander Yermolovich d12ae1eaf8 [LLD][LLVM] CG Graph profile using relocations
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
2021-06-24 09:09:33 -07:00
..
ARMEHABIPrinter.h [llvm-readobj][ARM] - Improve support of printing unwind (-u) information for non-relocatable objects. 2020-09-30 11:43:34 +03:00
ARMWinEHPrinter.cpp [llvm-readobj] [ARMWinEH] Try to resolve label symbols into regular ones 2021-05-04 22:22:18 +03:00
ARMWinEHPrinter.h [llvm-readobj] [ARMWinEH] Try to resolve label symbols into regular ones 2021-05-04 22:22:18 +03:00
CMakeLists.txt [llvm-readobj] - Remove Error.cpp,.h and drop dependencies in the code. 2020-09-01 16:46:17 +03:00
COFFDumper.cpp [LLD] Implement /guard:[no]ehcont 2021-04-14 15:06:49 +08:00
COFFImportDumper.cpp
DwarfCFIEHPrinter.h [lib/Object, tools] - Make ELFObjectFile::getELFFile return reference. 2020-12-04 16:02:29 +03:00
ELFDumper.cpp [LLD][LLVM] CG Graph profile using relocations 2021-06-24 09:09:33 -07:00
llvm-readobj.cpp [llvm-readelf] Unhide short options to match the command guide 2021-05-12 12:09:08 +01:00
llvm-readobj.h
MachODumper.cpp [llvm-readobj] Recognize N_THUMB_DEF as a symbol flag 2021-04-30 17:39:56 -04:00
ObjDumper.cpp [llvm-readobj] - Introduce ObjDumper::reportUniqueWarning(const Twine &Msg). 2020-12-01 12:36:44 +03:00
ObjDumper.h [llvm-readelf] Support dumping the BB address map section with --bb-addr-map. 2021-03-08 16:20:11 -08:00
StackMapPrinter.h
WasmDumper.cpp [WebAssembly] Rename event to tag 2021-06-17 20:34:19 -07:00
Win64EHDumper.cpp [llvm-readobj] - Remove Error.cpp,.h and drop dependencies in the code. 2020-09-01 16:46:17 +03:00
Win64EHDumper.h
WindowsResourceDumper.cpp [llvm-readobj] - Remove Error.cpp,.h and drop dependencies in the code. 2020-09-01 16:46:17 +03:00
WindowsResourceDumper.h
XCOFFDumper.cpp [XCOFF][AIX] Enable tooling support for 64 bit symbol table parsing 2021-06-07 17:24:13 +00:00