Use symcheck to locate writeable+executable object files#934
Open
tgross35 wants to merge 3 commits intorust-lang:mainfrom
Open
Use symcheck to locate writeable+executable object files#934tgross35 wants to merge 3 commits intorust-lang:mainfrom
tgross35 wants to merge 3 commits intorust-lang:mainfrom
Conversation
ada5714 to
9f44c32
Compare
Contributor
Author
|
Thumb makes sense to skip as a bare metal target. Note sure about ppc64 |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Contributor
Author
|
It seems like the PowerPC behavior is intentional; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21098 |
b6e06fd to
fea76d5
Compare
adfbd2f to
1531b9d
Compare
From what I have been able to find, compilers that try to emit object files compatible with a GNU linker appear to add a `.note.GNU-stack` section if the stack should not be writeable (this section is empty). We never want a writeable stack, so extend the object file check to verify that object files with any executable sections also have this `.note.GNU-stack` section. This appears to match what is done by `scanelf` to emit `!WX` [2], which is the tool used to create the output in the issue. Closes: rust-lang#183 [1]: https://github.com/gentoo/pax-utils/blob/9ef54b472e42ba2c5479fbd86b8be2275724b064/scanelf.c#L428-L512 update update debug update fix asm file
f6d4714 to
52e4faf
Compare
fdb8c4e to
03b30f3
Compare
03b30f3 to
9fbb3cc
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.
From what I have been able to find, compilers that try to emit object files compatible with a GNU linker appear to add a
.note.GNU-stacksection if the stack should not be executable (this section is empty). We never want an executable stack, so extend the object file check to verify that object files with any executable sections also have this.note.GNU-stacksection.This appears to match what is done by
scanelfto emit!WX1, which is the tool used to create the output in the issue.Closes: #183