Patch genode_dyn.ld to not emit PHDR segments

This is important, because otherwise binutils will refuse to strip
Genode binaries, which causes runtime closures to explode, which
causes a giant image.elf, which takes so long to load that tests
break.
This commit is contained in:
Ehmry - 2021-01-28 14:11:50 +01:00
parent 8d22ff4eb3
commit f12d27872a
2 changed files with 32 additions and 1 deletions

View File

@ -35,7 +35,11 @@ let
version = builtins.substring 0 7 upstreamSources.rev; version = builtins.substring 0 7 upstreamSources.rev;
src = upstreamSources; src = upstreamSources;
nativeBuildInputs = [ expect gnumake tcl ]; nativeBuildInputs = [ expect gnumake tcl ];
patches = [ ./patches/binary-labels.patch ./patches/label-fail.patch ]; patches = [
./patches/binary-labels.patch
./patches/label-fail.patch
./patches/phdr.patch
];
configurePhase = '' configurePhase = ''
patchShebangs ./tool patchShebangs ./tool
substituteInPlace repos/base/etc/tools.conf \ substituteInPlace repos/base/etc/tools.conf \

View File

@ -0,0 +1,27 @@
From 45c73b01d4609f59ca576141bc836baad8e468ed Mon Sep 17 00:00:00 2001
From: Emery Hemingway <ehmry@posteo.net>
Date: Thu, 28 Jan 2021 13:39:29 +0100
Subject: [PATCH] genode_dyn.ld: do not emit PHDR segment
Recent version of binutils check that PHDR segments are covered
by a LOAD segment. In this case the unloaded PHDR segment can be
ommited.
---
repos/base/src/ld/genode_dyn.ld | 1 -
1 file changed, 1 deletion(-)
diff --git a/repos/base/src/ld/genode_dyn.ld b/repos/base/src/ld/genode_dyn.ld
index 5fa6ddc29e..57ec92f0f6 100644
--- a/repos/base/src/ld/genode_dyn.ld
+++ b/repos/base/src/ld/genode_dyn.ld
@@ -18,7 +18,6 @@
PHDRS
{
- phdr PT_PHDR PHDRS;
interp PT_INTERP;
ro PT_LOAD;
rw PT_LOAD;
--
2.29.2