[PATCH] D75536: [LLD] Add support for --unique option
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 3 14:24:44 PST 2020
MaskRay added a comment.
In D75536#1903914 <https://reviews.llvm.org/D75536#1903914>, @davidb wrote:
> 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 my needs. However I would consider getting back and doing it when I next have some free cycles.
>
> >> 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.
A test is not needed. Just make the test minimal (for example, as I suggested).
Please update SUMMARY by mentioning the --gc-sections scenario and delete the mention of deadstripping.
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