summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/patchelf.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/patchelf.cc b/src/patchelf.cc
index 4b7ef43..3ca16c7 100644
--- a/src/patchelf.cc
+++ b/src/patchelf.cc
@@ -1330,6 +1330,11 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op,
{
auto shdrDynamic = findSection(".dynamic");
+ if (rdi(shdrDynamic.sh_type) == SHT_NOBITS) {
+ debug("no dynamic section\n");
+ return;
+ }
+
/* !!! We assume that the virtual address in the DT_STRTAB entry
of the dynamic section corresponds to the .dynstr section. */
auto shdrDynStr = findSection(".dynstr");