[ELD] Identify ELD in .comment section - #2062
Open
Ricardo Alves de Souza (ricardoasouz) wants to merge 1 commit into
Open
Ricardo Alves de Souza (ricardoasouz) wants to merge 1 commit into
Ricardo Alves de Souza (ricardoasouz) wants to merge 1 commit into
Conversation
Emit the linker identification in the LLD style, "Linker: [<vendor> ]ELD <version> [(<revision>)]", instead of "[<vendor>] Linker <version> (<revision>)", so that images linked by ELD are easy to recognize with readelf -p .comment. The revision is formatted with getELDRepositoryVersion(), as --repository-version already does, so no empty "()" is emitted when the build has no revision information. Fixes qualcomm#2038 Signed-off-by: Ricardo Alves de Souza <ricardoasouz@hotmail.com>
Ricardo Alves de Souza (ricardoasouz)
requested a review
from Shankar Easwaran (quic-seaswara)
as a code owner
October 4, 2026 10:31
Shankar Easwaran (quic-seaswara)
requested changes
Oct 5, 2026
| VersionString += ELDRepositoryVersion; | ||
| } | ||
| if (m_Module.needLTOToBeInvoked() || config().options().hasLTO()) | ||
| VersionString += " LTO Enabled "; |
Contributor
There was a problem hiding this comment.
We can remove the LTO enabled from the version output.
This branch has not been deployed
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
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.
Summary
Update the
.commentlinker identification to follow the LLD-style format and make binaries linked by ELD easy to recognize.Before:
After:
When a vendor is configured, it is emitted before
ELD:The revision information is formatted with
getELDRepositoryVersion(), consistent with--repository-version. This also avoids emitting an empty()when revision information is unavailable.Tests
Updated the existing
.commentchecks to verify the ELD identity in both normal and LTO outputs.RevisionInfoUpdateOnBuildis currently marked unsupported because it rebuildsld.eldand can race with other tests. Its updated FileCheck pattern was therefore validated directly against the.commentoutput from the patched linker.Validation performed:
The generated ELF
.commentsection was also manually verified to contain:Fixes #2038