[PATCH] D142163: [LLD][ELF] Add --lto-export-symbol-list

Sami Tolvanen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 14:46:52 PST 2023


samitolvanen added a comment.

So, I looked into applying this to all object files with by adding similar code to `Writer<ELFT>::finalizeSections()`. This is not quite what we want in the kernel though. The primary goal is to better optimize bitcode during a relocatable link, and while we can conveniently generate a list of functions exported to kernel modules, we don't necessarily have a complete list of symbols (typically defined in stand-alone assembly) that are later needed in linker scripts or whose bindings objtool etc. assume to remain untouched, for example. In order to avoid additional hacks in the kernel, I would prefer to keep this flag specific to LTO. I do see the value in having a similar option for all object files, but perhaps that can be a separate option?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142163/new/

https://reviews.llvm.org/D142163



More information about the llvm-commits mailing list