diff options
Diffstat (limited to 'poky/meta/recipes-devtools/patchelf')
-rw-r--r-- | poky/meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch | 45 | ||||
-rw-r--r-- | poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch | 18 | ||||
-rw-r--r-- | poky/meta/recipes-devtools/patchelf/patchelf_0.12.bb (renamed from poky/meta/recipes-devtools/patchelf/patchelf_0.10.bb) | 3 |
3 files changed, 11 insertions, 55 deletions
diff --git a/poky/meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch b/poky/meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch deleted file mode 100644 index a0988423f..000000000 --- a/poky/meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 1630d3f846c7721b1e7cd3b005bb2b34816e1d0f Mon Sep 17 00:00:00 2001 -From: Ed Bartosh <ed.bartosh@linux.intel.com> -Date: Fri, 21 Jul 2017 12:33:53 +0300 -Subject: [PATCH] patchelf: fix segfault for binaries linked by gold - -commit 1cc234fea5600190d872329aca60e2365cefc39e - -fix adjusting startPage - -startPage is adjusted unconditionally for all executables. -This results in incorrect addresses assigned to INTERP and LOAD -program headers, which breaks patched executable. - -Adjusting startPage variable only when startOffset > startPage -should fix this. - -This change is related to the issue NixOS#10 - -Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> - -Github PR: https://github.com/NixOS/patchelf/pull/127 - -Upstream-Status: Submitted - ---- - src/patchelf.cc | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/src/patchelf.cc b/src/patchelf.cc -index a63e3a11c61f..2483d25d78f1 100644 ---- a/src/patchelf.cc -+++ b/src/patchelf.cc -@@ -756,10 +756,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; - } - diff --git a/poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch b/poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch index 03b0d18a8..bf721c1af 100644 --- a/poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch +++ b/poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch @@ -14,30 +14,32 @@ Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br> src/patchelf.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) -diff --git a/src/patchelf.cc b/src/patchelf.cc -index 0b4965adff83..b5db2aef0e8a 100644 ---- a/src/patchelf.cc -+++ b/src/patchelf.cc -@@ -497,7 +497,17 @@ void ElfFile<ElfFileParamNames>::sortShdrs() +Index: git/src/patchelf.cc +=================================================================== +--- git.orig/src/patchelf.cc ++++ git/src/patchelf.cc +@@ -499,9 +499,19 @@ void ElfFile<ElfFileParamNames>::sortShd static void writeFile(std::string fileName, FileContents contents) { -- int fd = open(fileName.c_str(), O_TRUNC | O_WRONLY); + struct stat st; + int fd; + + debug("writing %s\n", fileName.c_str()); + +- int fd = open(fileName.c_str(), O_CREAT | O_TRUNC | O_WRONLY, 0777); + if (stat(fileName.c_str(), &st) != 0) + error("stat"); + + if (chmod(fileName.c_str(), 0600) != 0) + error("chmod"); + -+ fd = open(fileName.c_str(), O_TRUNC | O_WRONLY); ++ fd = open(fileName.c_str(), O_CREAT | O_TRUNC | O_WRONLY, 0777); + if (fd == -1) error("open"); -@@ -511,6 +521,10 @@ static void writeFile(std::string fileName, FileContents contents) +@@ -515,6 +525,10 @@ static void writeFile(std::string fileNa if (close(fd) != 0) error("close"); diff --git a/poky/meta/recipes-devtools/patchelf/patchelf_0.10.bb b/poky/meta/recipes-devtools/patchelf/patchelf_0.12.bb index d29e094ed..43de90877 100644 --- a/poky/meta/recipes-devtools/patchelf/patchelf_0.10.bb +++ b/poky/meta/recipes-devtools/patchelf/patchelf_0.12.bb @@ -1,12 +1,11 @@ SRC_URI = "git://github.com/NixOS/patchelf;protocol=https \ file://handle-read-only-files.patch \ - file://fix-adjusting-startPage.patch \ " LICENSE = "GPLv3" SUMMARY = "Tool to allow editing of RPATH and interpreter fields in ELF binaries" -SRCREV = "e1e39f3639e39360ceebb2f7ed533cede4623070" +SRCREV = "8d3a16e97294e3c5521c61b4c8835499c9918264" S = "${WORKDIR}/git" |