Skip to content

Commit 7f431b9

Browse files
Mic92Ericson2314
authored andcommitted
patchelf: correct page size for sparc64/sparc32
(cherry picked from commit da968fb)
1 parent 80335e1 commit 7f431b9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/patchelf.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,14 +309,17 @@ unsigned int ElfFile<ElfFileParamNames>::getPageSize() const noexcept
309309
// current list is extracted from GNU gold's source code (abi_pagesize).
310310
switch (rdi(hdr()->e_machine)) {
311311
case EM_IA_64:
312-
case EM_SPARC:
313312
case EM_MIPS:
314313
case EM_PPC:
315314
case EM_PPC64:
316315
case EM_AARCH64:
317316
case EM_TILEGX:
318317
case EM_LOONGARCH:
319318
return 0x10000;
319+
case EM_SPARC: // This should be sparc 32-bit. According to the linux
320+
// kernel 4KB should be also fine, but it seems that solaris is doing 8KB
321+
case EM_SPARCV9: /* SPARC64 support */
322+
return 0x2000;
320323
default:
321324
return 0x1000;
322325
}

0 commit comments

Comments
 (0)