summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Barlow <dan@telent.net>2021-03-31 22:27:40 +0100
committerDaniel Barlow <dan@telent.net>2021-03-31 22:27:40 +0100
commit013ce840abe2fd2f1dd346900629c7d7c0cbbacb (patch)
tree7df5a01589b78c5303ae291f862f02476df11185
parentf376fe61bae57e9e50f4622f5a44febb4f5bfd3c (diff)
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 287fea8..9498bfc 100644
--- a/src/patchelf.cc
+++ b/src/patchelf.cc
@@ -1346,7 +1346,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