-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add relro-level tests #48388
Add relro-level tests #48388
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
This is basically a stabilization. Is there a tracking issue for this feature? |
I know nothing about this, so it's hard for me to judge if we are happy enough with its implementation to be ready to stabilize. =) cc @rust-lang/compiler |
No tracking issue. This is essentially just a flag to be able to disable RELRO, or use only partial RELRO. Full RELRO has been on by default as of #43170 being merged, but @alexcrichton wanted the flag to disable it to stay unstable for a while at the time. |
9645d1f
to
336484d
Compare
Ok. Usually for a stabilization I like to see a little report that shows the test cases that show that this feature is indeed working as expected -- based on the the diffs in this PR, I take it that there are no tests at all for this (i.e., nothing had to be changed from |
Not really sure how to test this from rust honestly. To actually check that it is functioning properly we'd essentially need to actually do a compile and then parse the ELF binary and check for the |
@kyrias usually we would make a |
Maybe it's not worth the trouble, I don't know, but I am a big believer in "if it ain't tested, it's broken". |
Interesting, didn't know about Is there any specific list of dependencies that are guaranteed to exist when they're run? |
So I figured that when you specify Since this is a very small change I just added it in this PR, but if you would prefer I can split it out and file a PR for it separately. |
57a994d
to
29db3bc
Compare
☔ The latest upstream changes (presumably #48531) made this pull request unmergeable. Please resolve the merge conflicts. |
29db3bc
to
838bc07
Compare
Thanks @kyrias! For stabilizatin purposes could you also detail a bit what your plans are with the stable flag? I'm realizing now that we don't have a ton of specific paltform-specific options stabilized in the sense that |
Hi @kyrias, ping from the release team! @alexcrichton asked you more details about the stabilization in #48388 (comment), can you please reply so we can move forward with this PR? |
Hey, sorry for the delay, been away for a week. Now that I think about it I don't really have any specific plans for it, I just thought that it can be useful to be able to disable it in some rare circumstances. Since the executables end up being slightly bigger, disabling RELRO can be useful for extremely low memory targets. (And BIND_NOW additionally causes some performance impact as it has to resolve all symbols at load time, even if there is a large number of symbols that end up not being used.) But other than that I guess there aren't anything in specific I can think off. |
Ah ok thanks for the info @kyrias! In that case I wonder if it's best left unstable for now? That way it's there to tinker with if necessary but otherwise we may want to hold out as it may inform how we stabilize this. |
Yeah, might make sense until the problems become more real. I think I'm mostly just bothered by the fact that Anyway, I could drop the move of the option and just keep the tests and the |
Sounds great to me! |
Previously relro-level=off would just not tell the linker to use RELRO, but when you want to disable RELRO you most likely want to entirely prevent. Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
@bors: r+ |
📌 Commit 1dbce4b has been approved by |
⌛ Testing commit 1dbce4b with merge 7f6687d357f136197ea8285137bfddb7cd99c231... |
💔 Test failed - status-travis |
⌛ Testing commit 1dbce4b with merge 211c155e8eb32ad9e147edf35471e6a2c73c30b5... |
💔 Test failed - status-travis |
Add relro-level tests The `relro-level` debugging flag was added in #43170 which was merged in July 2017. This PR moves this flag to be a proper codegen flag.
☀️ Test successful - status-appveyor, status-travis |
The
relro-level
debugging flag was added in #43170 which was merged in July 2017. This PR moves this flag to be a proper codegen flag.