[linker-script] Error when dot assignment exceeds UINT32_MAX#1116
Open
deepakshirkem wants to merge 1 commit intoqualcomm:mainfrom
Open
[linker-script] Error when dot assignment exceeds UINT32_MAX#1116deepakshirkem wants to merge 1 commit intoqualcomm:mainfrom
deepakshirkem wants to merge 1 commit intoqualcomm:mainfrom
Conversation
ELD was silently truncating dot assignment values greater than UINT32_MAX causing incorrect section addresses. Added error when dot assignment creates padding that exceeds UINT32_MAX as such large padding values are not valid. Fixes qualcomm#386 Signed-off-by: deepakshirkem <deepakshirke509@gmail.com>
Contributor
|
Hi @deepakshirkem, Thank you for the pull-request. The original issue does not state that we should error-out if the padding due to dot assignment is greater than UINT32_MAX, instead it is about the symbol values being incorrect when there is a huge padding. Erroring out when there is a huge padding is a workaround and not a fix for this issue. The huge padding in the original issue can be replaced by any other huge-content that takes up space in the image layout and we will still see the same issue. |
Contributor
Author
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.
Problem
Fixes #386
ELD assigns incorrect addresses when the padding due to dot assignment is greater than
UINT32_MAX. When a linker script uses:. = . + 0x400000000;Fix
Added validation in
Assignment::assign()to error out when dot assignment creates padding that exceedsUINT32_MAXas such large padding values are not meaningful.
Testing
Added test
DotAssignmentOverflowthat verifies ELD emits a clear error when dot assignment value exceedsUINT32_MAX.cc @quic-seaswara @parth-07