[PATCH] D114830: [ELF] Hint -z nostart-stop-gc for __start_ undefined references

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 3 14:12:48 PST 2021


dblaikie added a comment.

In D114830#3169336 <https://reviews.llvm.org/D114830#3169336>, @peter.smith wrote:

> I'm happy to approve in post; my apologies for not getting to it in time. Regardless of the opinion on the default value of start-stop-gc this particular change adds a useful warning and documentation.
>
> As an aside Arm's proprietary linker introduced a "weakly live" value for sections referenced by the equivalent of `__start` and `__stop`. The linker would follow relocations from a "weakly live" section to see if it could reach an existing "live" section from the same object file, where "live" is the result of classic garbage collection assuming `--start-stop-gc` . This heuristic kind of worked for what we needed it do, which was to permit all exception tables (reachable via __start and __stop) to be thrown away if no object called throw. We didn't have any real rigorous theory to back up the heuristic though other than it was conservative enough to keep what we need to keep and gave good enough GC results in most cases. I'd not recommend LLD follow that though as it was a heuristic tuned to a system library.

Ah, thanks for weighing in. Sounds good to me!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114830



More information about the llvm-commits mailing list