diff options
Diffstat (limited to 'meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch')
-rw-r--r-- | meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch | 45 |
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 @@ | |||
1 | From 1630d3f846c7721b1e7cd3b005bb2b34816e1d0f Mon Sep 17 00:00:00 2001 | ||
2 | From: Ed Bartosh <ed.bartosh@linux.intel.com> | ||
3 | Date: Fri, 21 Jul 2017 12:33:53 +0300 | ||
4 | Subject: [PATCH] patchelf: fix segfault for binaries linked by gold | ||
5 | |||
6 | commit 1cc234fea5600190d872329aca60e2365cefc39e | ||
7 | |||
8 | fix adjusting startPage | ||
9 | |||
10 | startPage is adjusted unconditionally for all executables. | ||
11 | This results in incorrect addresses assigned to INTERP and LOAD | ||
12 | program headers, which breaks patched executable. | ||
13 | |||
14 | Adjusting startPage variable only when startOffset > startPage | ||
15 | should fix this. | ||
16 | |||
17 | This change is related to the issue NixOS#10 | ||
18 | |||
19 | Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> | ||
20 | |||
21 | Github PR: https://github.com/NixOS/patchelf/pull/127 | ||
22 | |||
23 | Upstream-Status: Submitted | ||
24 | |||
25 | --- | ||
26 | src/patchelf.cc | 6 ++---- | ||
27 | 1 file changed, 2 insertions(+), 4 deletions(-) | ||
28 | |||
29 | diff --git a/src/patchelf.cc b/src/patchelf.cc | ||
30 | index 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 | |||