Initial support for static PIE executables#3960
Initial support for static PIE executables#3960LemonBoy wants to merge 1 commit intoziglang:masterfrom
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.
Case-styling? Or is this a traditional name from somewhere?
There was a problem hiding this comment.
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.
Would it make sense to pass in auxv instead of using it indirectly via the global?
andrewrk
left a comment
There was a problem hiding this comment.
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: