link: change default executable mode to 0o777
Jonathan S writes: On common systems with a 022 umask, this will still result in a file created with 755 permissions, but it works appropriately if the system is configured more leniently. (As another data point, C's fopen seems to open files with the 666 mode.)master
parent
058937e44d
commit
9ebf25d145
|
@ -2061,7 +2061,7 @@ pub fn alignBackward(addr: usize, alignment: usize) usize {
|
||||||
/// The alignment must be a power of 2 and greater than 0.
|
/// The alignment must be a power of 2 and greater than 0.
|
||||||
pub fn alignBackwardGeneric(comptime T: type, addr: T, alignment: T) T {
|
pub fn alignBackwardGeneric(comptime T: type, addr: T, alignment: T) T {
|
||||||
assert(@popCount(T, alignment) == 1);
|
assert(@popCount(T, alignment) == 1);
|
||||||
// 000010000 // example addr
|
// 000010000 // example alignment
|
||||||
// 000001111 // subtract 1
|
// 000001111 // subtract 1
|
||||||
// 111110000 // binary not
|
// 111110000 // binary not
|
||||||
return addr & ~(alignment - 1);
|
return addr & ~(alignment - 1);
|
||||||
|
|
|
@ -7,7 +7,11 @@ const fs = std.fs;
|
||||||
const elf = std.elf;
|
const elf = std.elf;
|
||||||
const codegen = @import("codegen.zig");
|
const codegen = @import("codegen.zig");
|
||||||
|
|
||||||
const executable_mode = 0o755;
|
/// On common systems with a 0o022 umask, 0o777 will still result in a file created
|
||||||
|
/// with 0o755 permissions, but it works appropriately if the system is configured
|
||||||
|
/// more leniently. As another data point, C's fopen seems to open files with the
|
||||||
|
/// 666 mode.
|
||||||
|
const executable_mode = 0o777;
|
||||||
const default_entry_addr = 0x8000000;
|
const default_entry_addr = 0x8000000;
|
||||||
|
|
||||||
pub const ErrorMsg = struct {
|
pub const ErrorMsg = struct {
|
||||||
|
|
Loading…
Reference in New Issue