authorgravatar for xtex@astrafall.orgxtex <xtex@astrafall.org> 2026-08-18 10:32:55+08:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-18 09:03:05+02:00
log8e2d6e211bdf2d534281b7cee2dfdf88dc220910
tree5457432848b2e6d798a29ef7b005a17eb75a18b2
parentf73d7aa1821d6c7d71b89157afc045e04b10e96e

Elf2: fix default page alignment of LoongArch


1 files changed, 4 insertions(+), 1 deletions(-)

src/link/Elf2.zig+4-1
......@@ -4753,10 +4753,13 @@ fn ehdrType(elf: *const Elf) EhdrType {
47534753fn targetPtrSize(elf: *const Elf) u8 {
47544754 return elf.identClass().size();
47554755}
4756/// Page alignment for the target platform.
4757/// Usually this returns the maximum page size supported on the
4758/// target to maximize compatibility but there can be exceptions.
47564759fn targetPageAlign(elf: *const Elf) std.mem.Alignment {
47574760 return .fromByteUnits(switch (elf.ehdrMachine()) {
47584761 .AARCH64 => 0x10000,
4759 .LOONGARCH => 0x4000,
4762 .LOONGARCH => 0x10000,
47604763 .PPC64 => 0x10000,
47614764 .RISCV => 0x1000,
47624765 .SPARCV9 => 0x100000,