db-move: moved libdex from [staging] to [testing] (x86_64)
[arch-packages.git] / syslinux / trunk / 0017-single-load-segment.patch
blob7fd53b1603410d19d9e48f6b29b91048a56188a9
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
10 ---
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")
20 OUTPUT_ARCH(i386)
21 ENTRY(_start)
23 +PHDRS
25 + all PT_LOAD ;
28 SECTIONS
30 . = 0;
31 @@ -31,7 +36,7 @@ SECTIONS
32 *(.text)
33 *(.text.*)
34 __text_end = .;
35 - }
36 + } :all
38 . = ALIGN(16);
40 @@ -40,7 +45,7 @@ SECTIONS
41 *(.rodata)
42 *(.rodata.*)
43 __rodata_end = .;
44 - }
45 + } :all
47 . = ALIGN(4);
49 @@ -49,14 +54,14 @@ SECTIONS
50 KEEP (*(SORT(.ctors.*)))
51 KEEP (*(.ctors))
52 __ctors_end = .;
53 - }
54 + } :all
56 .dtors : {
57 __dtors_start = .;
58 KEEP (*(SORT(.dtors.*)))
59 KEEP (*(.dtors))
60 __dtors_end = .;
61 - }
62 + } :all
64 . = ALIGN(4096);
65 .rel : {
66 @@ -64,7 +69,7 @@ SECTIONS
67 *(.rel.data)
68 *(.rel.data.*)
69 *(.rel.ctors)
70 - }
71 + } :all
73 . = ALIGN(4);
75 @@ -72,14 +77,14 @@ SECTIONS
76 __gnu_hash_start = .;
77 *(.gnu.hash)
78 __gnu_hash_end = .;
79 - }
80 + } :all
83 .dynsym : {
84 __dynsym_start = .;
85 *(.dynsym)
86 __dynsym_end = .;
87 - }
88 + } :all
90 . = ALIGN(4);
92 @@ -87,7 +92,7 @@ SECTIONS
93 __dynstr_start = .;
94 *(.dynstr)
95 __dynstr_end = .;
96 - }
97 + } :all
99 . = ALIGN(4);
101 @@ -104,7 +109,7 @@ SECTIONS
102 KEEP (*(.got.plt))
103 KEEP (*(.got))
104 __got_end = .;
106 + } :all
108 . = ALIGN(4);
110 @@ -112,7 +117,7 @@ SECTIONS
111 __dynamic_start = .;
112 *(.dynamic)
113 __dynamic_end = .;
115 + } :all
117 . = ALIGN(16);
119 @@ -122,19 +127,19 @@ SECTIONS
120 *(.data.*)
121 *(.lowmem)
122 __data_end = .;
124 + } :all
126 .reloc : {
127 *(.reloc)
129 + } :all
131 .symtab : {
132 *(.symtab)
134 + } :all
136 .strtab : {
137 *(.strtab)
139 + } :all
141 .bss (NOLOAD) : {
142 /* the EFI loader doesn't seem to like a .bss section,
143 @@ -148,7 +153,7 @@ SECTIONS
144 __bss_end = .;
145 *(.sbss)
146 *(.scommon)
148 + } :all
149 __bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start);
150 __bss_dwords = (__bss_len + 3) >> 2;
152 @@ -161,7 +166,7 @@ SECTIONS
153 *(.hugebss)
154 *(.hugebss.*)
155 __hugebss_end = .;
157 + } :all
159 _end = .;
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)
167 ENTRY(_start)
169 +PHDRS
171 + all PT_LOAD ;
174 SECTIONS
176 . = 0;
177 @@ -31,7 +36,7 @@ SECTIONS
178 *(.text)
179 *(.text.*)
180 __text_end = .;
182 + } :all
184 . = ALIGN(16);
186 @@ -40,7 +45,7 @@ SECTIONS
187 *(.rodata)
188 *(.rodata.*)
189 __rodata_end = .;
191 + } :all
193 . = ALIGN(4);
195 @@ -49,14 +54,14 @@ SECTIONS
196 KEEP (*(SORT(.ctors.*)))
197 KEEP (*(.ctors))
198 __ctors_end = .;
200 + } :all
202 .dtors : {
203 __dtors_start = .;
204 KEEP (*(SORT(.dtors.*)))
205 KEEP (*(.dtors))
206 __dtors_end = .;
208 + } :all
210 . = ALIGN(4096);
211 .rel : {
212 @@ -64,7 +69,7 @@ SECTIONS
213 *(.rel.data)
214 *(.rel.data.*)
215 *(.rel.ctors)
217 + } :all
219 . = ALIGN(4);
221 @@ -72,14 +77,14 @@ SECTIONS
222 __gnu_hash_start = .;
223 *(.gnu.hash)
224 __gnu_hash_end = .;
226 + } :all
229 .dynsym : {
230 __dynsym_start = .;
231 *(.dynsym)
232 __dynsym_end = .;
234 + } :all
236 . = ALIGN(4);
238 @@ -87,7 +92,7 @@ SECTIONS
239 __dynstr_start = .;
240 *(.dynstr)
241 __dynstr_end = .;
243 + } :all
245 . = ALIGN(4);
247 @@ -104,7 +109,7 @@ SECTIONS
248 KEEP (*(.got.plt))
249 KEEP (*(.got))
250 __got_end = .;
252 + } :all
254 . = ALIGN(4);
256 @@ -112,7 +117,7 @@ SECTIONS
257 __dynamic_start = .;
258 *(.dynamic)
259 __dynamic_end = .;
261 + } :all
263 . = ALIGN(16);
265 @@ -122,19 +127,19 @@ SECTIONS
266 *(.data.*)
267 *(.lowmem)
268 __data_end = .;
270 + } :all
272 .reloc : {
273 *(.reloc)
275 + } :all
277 .symtab : {
278 *(.symtab)
280 + } :all
282 .strtab : {
283 *(.strtab)
285 + } :all
287 .bss (NOLOAD) : {
288 /* the EFI loader doesn't seem to like a .bss section,
289 @@ -148,7 +153,7 @@ SECTIONS
290 __bss_end = .;
291 *(.sbss)
292 *(.scommon)
294 + } :all
295 __bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start);
296 __bss_dwords = (__bss_len + 3) >> 2;
298 @@ -161,7 +166,7 @@ SECTIONS
299 *(.hugebss)
300 *(.hugebss.*)
301 __hugebss_end = .;
303 + } :all
305 _end = .;