summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch')
-rw-r--r--meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch45
1 files changed, 0 insertions, 45 deletions
diff --git a/meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch b/meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch
deleted file mode 100644
index a0988423fe..0000000000
--- a/meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch
+++ /dev/null
@@ -1,45 +0,0 @@
1From 1630d3f846c7721b1e7cd3b005bb2b34816e1d0f Mon Sep 17 00:00:00 2001
2From: Ed Bartosh <ed.bartosh@linux.intel.com>
3Date: Fri, 21 Jul 2017 12:33:53 +0300
4Subject: [PATCH] patchelf: fix segfault for binaries linked by gold
5
6commit 1cc234fea5600190d872329aca60e2365cefc39e
7
8fix adjusting startPage
9
10startPage is adjusted unconditionally for all executables.
11This results in incorrect addresses assigned to INTERP and LOAD
12program headers, which breaks patched executable.
13
14Adjusting startPage variable only when startOffset > startPage
15should fix this.
16
17This change is related to the issue NixOS#10
18
19Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
20
21Github PR: https://github.com/NixOS/patchelf/pull/127
22
23Upstream-Status: Submitted
24
25---
26 src/patchelf.cc | 6 ++----
27 1 file changed, 2 insertions(+), 4 deletions(-)
28
29diff --git a/src/patchelf.cc b/src/patchelf.cc
30index a63e3a11c61f..2483d25d78f1 100644
31--- a/src/patchelf.cc
32+++ b/src/patchelf.cc
33@@ -756,10 +756,8 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsLibrary()
34 since DYN executables tend to start at virtual address 0, so
35 rewriteSectionsExecutable() won't work because it doesn't have
36 any virtual address space to grow downwards into. */
37- if (isExecutable) {
38- if (startOffset >= startPage) {
39- debug("shifting new PT_LOAD segment by %d bytes to work around a Linux kernel bug\n", startOffset - startPage);
40- }
41+ if (isExecutable && startOffset > startPage) {
42+ debug("shifting new PT_LOAD segment by %d bytes to work around a Linux kernel bug\n", startOffset - startPage);
43 startPage = startOffset;
44 }
45