summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDomen Kožar <domen@dev.si>2021-08-05 12:03:48 +0200
committerGitHub <noreply@github.com>2021-08-05 12:03:48 +0200
commit4ee62cbd52e0fa49f834b6c4abfb616a4043ce71 (patch)
treecf647c87c2a37bf6bd0cc9ce8a8d2e717a7f22da
parent4e1b46a334babcafc69d8d6a40936585ae9ec2b1 (diff)
parent013ce840abe2fd2f1dd346900629c7d7c0cbbacb (diff)
Merge pull request #269 from telent/endianness-fix-for-shrink-rpath
convert endian when checking library machine type
-rw-r--r--src/patchelf.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/patchelf.cc b/src/patchelf.cc
index 2230bdb..ff8d638 100644
--- a/src/patchelf.cc
+++ b/src/patchelf.cc
@@ -1350,7 +1350,8 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op,
if (!neededLibFound[j]) {
std::string libName = dirName + "/" + neededLibs[j];
try {
- if (getElfType(readFile(libName, sizeof(Elf32_Ehdr))).machine == rdi(hdr->e_machine)) {
+ Elf32_Half library_e_machine = getElfType(readFile(libName, sizeof(Elf32_Ehdr))).machine;
+ if (rdi(library_e_machine) == rdi(hdr->e_machine)) {
neededLibFound[j] = true;
libFound = true;
} else