-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Initial support for static PIE executables #3960
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
Conversation
The use case for this is Address Space Layout Randomization, right? Anything else? |
return @intToPtr([*]elf.Dyn, addr); | ||
} | ||
|
||
pub fn apply_relocations() void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Case-styling? Or is this a traditional name from somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not used to camelCase all the identifiers, will change it later :)
|
||
// Do this as early as possible, the aux vector is needed | ||
if (builtin.position_independent_executable) { | ||
@import("os/linux/start_pie.zig").apply_relocations(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to pass in auxv instead of using it indirectly via the global?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good to merge once it's passing the CI.
I do want to know what the use case is though, to better understand how defaults should work, and to understand why people might want to enable this feature. Is it just for ASLR?
This depends on #3971 landing
Yep |
I opened #4503 so that this diff doesn't get lost. Closing the PR since it's not merge-ready and hasn't been for over a month. |
This is the part of #3960 that has to be rewritten to apply to latest master branch code.
Caveats: