[PATCH] D88827: [llvm-objcopy][NFC] Move core implementation of llvm-objcopy into separate library.

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 14 04:54:38 PST 2022


mstorsjo added a comment.

In D88827#3243298 <https://reviews.llvm.org/D88827#3243298>, @avl wrote:

>> This isn't generally true: even in debug builds and without --gc-sections, linkers tend not to link in unused objects into the final executable.
>
> I remember there was a patch to make it possible - https://reviews.llvm.org/D54747 . Which finally was not applied and current behavior that it is not working(if I did not miss something new).

The difference here is that if you feed the linker a specific set of object files, it will include all of them (minus what `--gc-sections` removes). But if you feed the linker a static library, it will only include the object files that actually are referenced (unless the library is added with the `--whole-archive` option or something similar).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88827



More information about the llvm-commits mailing list