Skip to content

Commit 013ce84

Browse files
committed
convert endian when checking library machine type
1 parent f376fe6 commit 013ce84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/patchelf.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,8 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op,
13461346
if (!neededLibFound[j]) {
13471347
std::string libName = dirName + "/" + neededLibs[j];
13481348
try {
1349-
if (getElfType(readFile(libName, sizeof(Elf32_Ehdr))).machine == rdi(hdr->e_machine)) {
1349+
Elf32_Half library_e_machine = getElfType(readFile(libName, sizeof(Elf32_Ehdr))).machine;
1350+
if (rdi(library_e_machine) == rdi(hdr->e_machine)) {
13501351
neededLibFound[j] = true;
13511352
libFound = true;
13521353
} else

0 commit comments

Comments
 (0)