Fix incorrect NEEDED entry due to unneeded shared lib reference#683
Open
parth-07 wants to merge 1 commit intoqualcomm:mainfrom
Open
Fix incorrect NEEDED entry due to unneeded shared lib reference#683parth-07 wants to merge 1 commit intoqualcomm:mainfrom
parth-07 wants to merge 1 commit intoqualcomm:mainfrom
Conversation
0044f52 to
27ca78c
Compare
|
|
||
| InputSym->setResolveInfo(*(ResolvedResult.Info)); | ||
|
|
||
| if (ResolvedResult.Overriden || !ResolvedResult.Existent) { |
Contributor
There was a problem hiding this comment.
Should the condition be changed here ?
Contributor
Author
There was a problem hiding this comment.
No, this does not need to be changed.
27ca78c to
881932d
Compare
Contributor
|
Fails with this test Try with ld.bfd and ld.eld. I think lld also has an issue here. |
Contributor
Author
|
Hi @quic-seaswara, Here lib2.so should always be marked as NEEDED because it is not enclosed within In issue #668, eld marks as NEEDED an used shared library that is enclosed within |
881932d to
1f933da
Compare
1f933da to
f315cf4
Compare
Contributor
Author
|
Thank you for finding the issue and sharing the test case. I have improved the fix to correctly handle the case shared by you. |
8e19e03 to
e781972
Compare
This commit fixes the incorrect NEEDED entry when --as-needed is used and a shared library symbol is referenced by an another unneeded shared library. The root cause of the issue was the incorrect logic of adding a shared library symbol to the dynamic symbol table when it satisfies a reference of an unneeded shared library symbol. Resolves qualcomm#668 Signed-off-by: Parth Arora <partaror@qti.qualcomm.com>
e781972 to
11b4d5f
Compare
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.
This commit fixes the incorrect NEEDED entry when --as-needed is used and a shared library symbol is referenced by an another unneeded shared library.
The root cause of the issue was the logic that was used to determine whether a shared library symbol ResolveInfo should have an outSymbol or not.
Resolves #668