| ... | ... | @@ -271,9 +271,7 @@ pub const GotIndirectionKey = struct { |
| 271 | 271 | const ideal_factor = 2; |
| 272 | 272 | |
| 273 | 273 | /// Default path to dyld |
| 274 | | /// TODO instead of hardcoding it, we should probably look through some env vars and search paths |
| 275 | | /// instead but this will do for now. |
| 276 | | const DEFAULT_DYLD_PATH: [*:0]const u8 = "/usr/lib/dyld"; |
| 274 | const default_dyld_path: [*:0]const u8 = "/usr/lib/dyld"; |
| 277 | 275 | |
| 278 | 276 | /// In order for a slice of bytes to be considered eligible to keep metadata pointing at |
| 279 | 277 | /// it as a possible place to put new symbols, it must have enough room for this many bytes |
| ... | ... | @@ -4315,7 +4313,7 @@ pub fn populateMissingMetadata(self: *MachO) !void { |
| 4315 | 4313 | self.dylinker_cmd_index = @intCast(u16, self.load_commands.items.len); |
| 4316 | 4314 | const cmdsize = @intCast(u32, mem.alignForwardGeneric( |
| 4317 | 4315 | u64, |
| 4318 | | @sizeOf(macho.dylinker_command) + mem.lenZ(DEFAULT_DYLD_PATH), |
| 4316 | @sizeOf(macho.dylinker_command) + mem.lenZ(default_dyld_path), |
| 4319 | 4317 | @sizeOf(u64), |
| 4320 | 4318 | )); |
| 4321 | 4319 | var dylinker_cmd = commands.emptyGenericCommandWithData(macho.dylinker_command{ |
| ... | ... | @@ -4325,7 +4323,7 @@ pub fn populateMissingMetadata(self: *MachO) !void { |
| 4325 | 4323 | }); |
| 4326 | 4324 | dylinker_cmd.data = try self.base.allocator.alloc(u8, cmdsize - dylinker_cmd.inner.name); |
| 4327 | 4325 | mem.set(u8, dylinker_cmd.data, 0); |
| 4328 | | mem.copy(u8, dylinker_cmd.data, mem.spanZ(DEFAULT_DYLD_PATH)); |
| 4326 | mem.copy(u8, dylinker_cmd.data, mem.spanZ(default_dyld_path)); |
| 4329 | 4327 | try self.load_commands.append(self.base.allocator, .{ .Dylinker = dylinker_cmd }); |
| 4330 | 4328 | self.load_commands_dirty = true; |
| 4331 | 4329 | } |