Skip to content

Commit d05eac1

Browse files
TheAssassinprobonopd
authored andcommitted
Fix ARM 32-bit builds (#399)
1 parent 968fc61 commit d05eac1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

getsection.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ int get_elf_section_offset_and_lenghth(char* fname, char* section_name, unsigned
1414
int fd = open(fname, O_RDONLY);
1515
data = mmap(NULL, lseek(fd, 0, SEEK_END), PROT_READ, MAP_SHARED, fd, 0);
1616

17-
#ifdef __i386__
17+
// optionally add more architectures for 32-bit builds so that it doesn't fall back to Elf64_*
18+
// see e.g. https://sourceforge.net/p/predef/wiki/Architectures/ for more predefined macro names
19+
#if defined(__i386__) || defined(__arm__)
1820
Elf32_Ehdr *elf;
1921
Elf32_Shdr *shdr;
2022
elf = (Elf32_Ehdr *) data;

0 commit comments

Comments
 (0)