| ... | ... | @@ -65,7 +65,7 @@ phdr_load_rw_index: ?u16 = null, |
| 65 | 65 | phdr_shdr_table: std.AutoHashMapUnmanaged(u16, u16) = .{}, |
| 66 | 66 | |
| 67 | 67 | entry_addr: ?u64 = null, |
| 68 | | page_size: u16, |
| 68 | page_size: u32, |
| 69 | 69 | |
| 70 | 70 | shstrtab: std.ArrayListUnmanaged(u8) = std.ArrayListUnmanaged(u8){}, |
| 71 | 71 | shstrtab_index: ?u16 = null, |
| ... | ... | @@ -304,7 +304,12 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*Elf { |
| 304 | 304 | }; |
| 305 | 305 | const self = try gpa.create(Elf); |
| 306 | 306 | errdefer gpa.destroy(self); |
| 307 | | const page_size: u16 = 0x1000; // TODO ppc64le requires 64KB |
| 307 | |
| 308 | const page_size: u32 = switch (options.target.cpu.arch) { |
| 309 | .powerpc64le => 0x10000, |
| 310 | .sparcv9 => 0x2000, |
| 311 | else => 0x1000, |
| 312 | }; |
| 308 | 313 | |
| 309 | 314 | var dwarf: ?Dwarf = if (!options.strip and options.module != null) |
| 310 | 315 | Dwarf.init(gpa, .elf, options.target) |
| ... | ... | @@ -472,7 +477,7 @@ pub fn allocatedSize(self: *Elf, start: u64) u64 { |
| 472 | 477 | return min_pos - start; |
| 473 | 478 | } |
| 474 | 479 | |
| 475 | | pub fn findFreeSpace(self: *Elf, object_size: u64, min_alignment: u16) u64 { |
| 480 | pub fn findFreeSpace(self: *Elf, object_size: u64, min_alignment: u32) u64 { |
| 476 | 481 | var start: u64 = 0; |
| 477 | 482 | while (self.detectAllocCollision(start, object_size)) |item_end| { |
| 478 | 483 | start = mem.alignForwardGeneric(u64, item_end, min_alignment); |