1 From: Lukas Schwaighofer <lukas@schwaighofer.name>
2 Date: Sat, 18 Aug 2018 16:56:35 +0200
3 Subject: Force the linker to put all sections into a single PT_LOAD segment
5 This is required when using binutils >= 2.31 which writes two PT_LOAD segments
6 by default. This is not supported by the wrapper.c script used to convert the
7 shared object into an elf binary.
9 Forwarded: https://www.syslinux.org/archives/2018-August/026167.html
11 efi/i386/syslinux.ld | 37 +++++++++++++++++++++----------------
12 efi/x86_64/syslinux.ld | 37 +++++++++++++++++++++----------------
13 2 files changed, 42 insertions(+), 32 deletions(-)
15 diff --git a/efi/i386/syslinux.ld b/efi/i386/syslinux.ld
16 index bab3fc7..19c1647 100644
17 --- a/efi/i386/syslinux.ld
18 +++ b/efi/i386/syslinux.ld
19 @@ -19,6 +19,11 @@ OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
31 @@ -31,7 +36,7 @@ SECTIONS
40 @@ -40,7 +45,7 @@ SECTIONS
49 @@ -49,14 +54,14 @@ SECTIONS
50 KEEP (*(SORT(.ctors.*)))
58 KEEP (*(SORT(.dtors.*)))
66 @@ -64,7 +69,7 @@ SECTIONS
75 @@ -72,14 +77,14 @@ SECTIONS
92 @@ -87,7 +92,7 @@ SECTIONS
101 @@ -104,7 +109,7 @@ SECTIONS
110 @@ -112,7 +117,7 @@ SECTIONS
119 @@ -122,19 +127,19 @@ SECTIONS
142 /* the EFI loader doesn't seem to like a .bss section,
143 @@ -148,7 +153,7 @@ SECTIONS
149 __bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start);
150 __bss_dwords = (__bss_len + 3) >> 2;
152 @@ -161,7 +166,7 @@ SECTIONS
161 diff --git a/efi/x86_64/syslinux.ld b/efi/x86_64/syslinux.ld
162 index 450641c..a2c124f 100644
163 --- a/efi/x86_64/syslinux.ld
164 +++ b/efi/x86_64/syslinux.ld
165 @@ -19,6 +19,11 @@ OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
166 OUTPUT_ARCH(i386:x86-64)
177 @@ -31,7 +36,7 @@ SECTIONS
186 @@ -40,7 +45,7 @@ SECTIONS
195 @@ -49,14 +54,14 @@ SECTIONS
196 KEEP (*(SORT(.ctors.*)))
204 KEEP (*(SORT(.dtors.*)))
212 @@ -64,7 +69,7 @@ SECTIONS
221 @@ -72,14 +77,14 @@ SECTIONS
222 __gnu_hash_start = .;
238 @@ -87,7 +92,7 @@ SECTIONS
247 @@ -104,7 +109,7 @@ SECTIONS
256 @@ -112,7 +117,7 @@ SECTIONS
265 @@ -122,19 +127,19 @@ SECTIONS
288 /* the EFI loader doesn't seem to like a .bss section,
289 @@ -148,7 +153,7 @@ SECTIONS
295 __bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start);
296 __bss_dwords = (__bss_len + 3) >> 2;
298 @@ -161,7 +166,7 @@ SECTIONS