Skip to content

Commit 4ee62cb

Browse files
authored
Merge pull request #269 from telent/endianness-fix-for-shrink-rpath
convert endian when checking library machine type
2 parents 4e1b46a + 013ce84 commit 4ee62cb

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
@@ -1350,7 +1350,8 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op,
13501350
if (!neededLibFound[j]) {
13511351
std::string libName = dirName + "/" + neededLibs[j];
13521352
try {
1353-
if (getElfType(readFile(libName, sizeof(Elf32_Ehdr))).machine == rdi(hdr->e_machine)) {
1353+
Elf32_Half library_e_machine = getElfType(readFile(libName, sizeof(Elf32_Ehdr))).machine;
1354+
if (rdi(library_e_machine) == rdi(hdr->e_machine)) {
13541355
neededLibFound[j] = true;
13551356
libFound = true;
13561357
} else

0 commit comments

Comments
 (0)