-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[LLD][ELF] Add --why-live flag to report GC liveness reason #119279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7d9c0d9 to
c03809d
Compare
6581eb2 to
bf7cb60
Compare
You can test this locally with the following command:git-clang-format --diff 8942d5ee6f73f00b9ccb1a1e4c27d4ff43fc41fe 59f826ba63825d4ecd6e6e9bd77bac4ab49120ee --extensions cpp,h -- lld/ELF/Config.h lld/ELF/Driver.cpp lld/ELF/MarkLive.cppView the diff from clang-format here.diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp
index 679817fb38..1ab2ebad68 100644
--- a/lld/ELF/MarkLive.cpp
+++ b/lld/ELF/MarkLive.cpp
@@ -265,7 +265,8 @@ template <class ELFT> void MarkLive<ELFT>::printWhyLive(Symbol *s) const {
return;
cur = *it->second;
} else {
- // TODO: Some sections are enqueued without symbols, so maybe cur could be a section?
+ // TODO: Some sections are enqueued without symbols, so maybe cur could be
+ // a section?
auto *d = dyn_cast<Defined>(std::get<Symbol *>(cur));
if (!d)
return;
|
a024487 to
fc0007d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a loose port of the MachO why-live flag to ELF LLD.
This flag takes a glob matching symbols for which to report liveness information. The flag can be specified multiple times. For each symbol, a chain of objects is reported from GC root to that symbol.
A reported object is either a symbol or a section. Sections might be alive by virtue of some symbol within them being alive. Symbols might be alive either by being directly referenced by another symbol or just by virtue of being within a live section. Both symbols and sections may intrinsically be alive for various internal or flag reasons; these are the GC roots.