diff --git a/src/link/Elf2.zig b/src/link/Elf2.zig index f8460dbf7362454171446aa0b93942e74f86972d..1400d0174815615d4f853ebb53ff2bc73dcd7915 100644 --- a/src/link/Elf2.zig +++ b/src/link/Elf2.zig @@ -4753,10 +4753,13 @@ fn ehdrType(elf: *const Elf) EhdrType { fn targetPtrSize(elf: *const Elf) u8 { return elf.identClass().size(); } +/// Page alignment for the target platform. +/// Usually this returns the maximum page size supported on the +/// target to maximize compatibility but there can be exceptions. fn targetPageAlign(elf: *const Elf) std.mem.Alignment { return .fromByteUnits(switch (elf.ehdrMachine()) { .AARCH64 => 0x10000, - .LOONGARCH => 0x4000, + .LOONGARCH => 0x10000, .PPC64 => 0x10000, .RISCV => 0x1000, .SPARCV9 => 0x100000,