Skip to content

Commit a174cf3

Browse files
authored
Merge pull request #333 from zhangwenlong8911/master
support loongarch for patchelf
2 parents a0151ef + 4b87d4f commit a174cf3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/patchelf.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ static int forcedPageSize = DEFAULT_PAGESIZE;
5757
static int forcedPageSize = -1;
5858
#endif
5959

60+
#ifndef EM_LOONGARCH
61+
#define EM_LOONGARCH 258
62+
#endif
63+
6064
using FileContents = std::shared_ptr<std::vector<unsigned char>>;
6165

6266
#define ElfFileParams class Elf_Ehdr, class Elf_Phdr, class Elf_Shdr, class Elf_Addr, class Elf_Off, class Elf_Dyn, class Elf_Sym, class Elf_Verneed, class Elf_Versym
@@ -460,6 +464,7 @@ unsigned int ElfFile<ElfFileParamNames>::getPageSize() const
460464
case EM_PPC64:
461465
case EM_AARCH64:
462466
case EM_TILEGX:
467+
case EM_LOONGARCH:
463468
return 0x10000;
464469
default:
465470
return 0x1000;

0 commit comments

Comments
 (0)