aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Debugify.cpp
diff options
context:
space:
mode:
authorGarvit Gupta <quic_garvgupt@quicinc.com>2025-06-30 08:47:37 +0530
committerGitHub <noreply@github.com>2025-06-30 08:47:37 +0530
commita17f63590ac077a5705c9bed8d4e025b3ef4b299 (patch)
tree09b0eed14574b796051fd2c298ff1779d18cdb51 /llvm/lib/Transforms/Utils/Debugify.cpp
parent59eaffe93aec6dc116ab7db5ebfee84a6e36112d (diff)
downloadllvm-a17f63590ac077a5705c9bed8d4e025b3ef4b299.zip
llvm-a17f63590ac077a5705c9bed8d4e025b3ef4b299.tar.gz
llvm-a17f63590ac077a5705c9bed8d4e025b3ef4b299.tar.bz2
Reland [Driver] Fix link order of BareMetal toolchain object (#146291)
The linker job in BareMetal toolchain object will be used by GNU ld and lld both. However, gnuld process the arguments in the order in which they appear on command line, whereas there is no such restriction with lld. The previous order was: LibraryPaths -> Libraries -> LTOOptions -> LinkerInputs The new order is: LibraryPaths -> LTOOptions -> LinkerInputs -> Libraries LTO options need to be added before adding any linker inputs because file format after compile stage during LTO is bitcode which gnuld natively cannot process. Hence will need to pass appropriate plugins before adding any bitcode file on the command line. Object files that are getting linked need to be passed before processing any libraries so that gnuld can appropriately do symbol resolution for the symbols for which no definition is provided through user code. Similar link order is also followed by other linker jobs for gnuld such as in gnutools::Linker in Gnu.cpp This is the 3rd patch in the series of patches of merging RISCVToolchain into BareMetal toolchain object. RFC: https: //discourse.llvm.org/t/merging-riscvtoolchain-and-baremetal-toolchains/75524
Diffstat (limited to 'llvm/lib/Transforms/Utils/Debugify.cpp')
0 files changed, 0 insertions, 0 deletions