Created
July 21, 2017 07:31
-
-
Save bartosh/aacbdc5140149e408e3639f1edc60fca to your computer and use it in GitHub Desktop.
patchelf.cc.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/patchelf.cc b/src/patchelf.cc | |
index 55b38e3..7196908 100644 | |
--- a/src/patchelf.cc | |
+++ b/src/patchelf.cc | |
@@ -721,10 +721,8 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsLibrary() | |
since DYN executables tend to start at virtual address 0, so | |
rewriteSectionsExecutable() won't work because it doesn't have | |
any virtual address space to grow downwards into. */ | |
- if (isExecutable) { | |
- if (startOffset >= startPage) { | |
- debug("shifting new PT_LOAD segment by %d bytes to work around a Linux kernel bug\n", startOffset - startPage); | |
- } | |
+ if (isExecutable && startOffset > startPage) { | |
+ debug("shifting new PT_LOAD segment by %d bytes to work around a Linux kernel bug\n", startOffset - startPage); | |
startPage = startOffset; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment