[PATCH] D75536: [LLD] Add support for --unique option

Dave Bozier via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 13:14:11 PST 2020


davidb added a comment.

In D75536#1903727 <https://reviews.llvm.org/D75536#1903727>, @MaskRay wrote:

> Do you have a plan to implement `--unique=pattern` (overrides output section descriptions)? It is different from `--unique` (only applies to orphan sections).


I don't have a plan to implement --unique=pattern, as the default is good enough for me needs.

>> The merging of these sections in the case of a partial link (-r) inhibits deadstripping.
> 
> Dead stripping is a Mach-O term. Non --unique does not inhibit --gc-sections (without -r).
>  Without --unique, some orphan sections may be unnecessarily kept (as a whole their "liveness" can be larger than the composing parts).
> 
> Note that -r --gc-sections is not implemented in lld.

Sorry, force of habit. PlayStation toolchains also use the term dead-stripping for ELF binaries. I did indeed mean gc-sections.

The current workflow involves multiple link stages, involving a partial link and then an executable link. It is the second link that performs -gc-sections. We would like to keep all functions in their own individual sections after the partial link.

I could update the test to demonstrate this if it is at all useful.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75536





More information about the llvm-commits mailing list