Skip to content

Commit da968fb

Browse files
committed
patchelf: correct page size for sparc64/sparc32
1 parent c3682eb commit da968fb

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
@@ -319,14 +319,17 @@ unsigned int ElfFile<ElfFileParamNames>::getPageSize() const
319319
// current list is extracted from GNU gold's source code (abi_pagesize).
320320
switch (rdi(hdr()->e_machine)) {
321321
case EM_IA_64:
322-
case EM_SPARC:
323322
case EM_MIPS:
324323
case EM_PPC:
325324
case EM_PPC64:
326325
case EM_AARCH64:
327326
case EM_TILEGX:
328327
case EM_LOONGARCH:
329328
return 0x10000;
329+
case EM_SPARC: // This should be sparc 32-bit. According to the linux
330+
// kernel 4KB should be also fine, but it seems that solaris is doing 8KB
331+
case EM_SPARCV9: /* SPARC64 support */
332+
return 0x2000;
330333
default:
331334
return 0x1000;
332335
}

0 commit comments

Comments
 (0)