1 |
vapier 07/09/18 04:48:34 |
2 |
|
3 |
Modified: 63_all_binutils-2.18-pt-pax-flags-20070828.patch |
4 |
Added: 33_all_binutils-gnu-relro-fixups.patch |
5 |
Log: |
6 |
fix from upstream for RELRO handling with PIEs and other situations |
7 |
|
8 |
Revision Changes Path |
9 |
1.2 src/patchsets/binutils/2.18/63_all_binutils-2.18-pt-pax-flags-20070828.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.18/63_all_binutils-2.18-pt-pax-flags-20070828.patch?rev=1.2&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.18/63_all_binutils-2.18-pt-pax-flags-20070828.patch?rev=1.2&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.18/63_all_binutils-2.18-pt-pax-flags-20070828.patch?r1=1.1&r2=1.2 |
14 |
|
15 |
Index: 63_all_binutils-2.18-pt-pax-flags-20070828.patch |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo/src/patchsets/binutils/2.18/63_all_binutils-2.18-pt-pax-flags-20070828.patch,v |
18 |
retrieving revision 1.1 |
19 |
retrieving revision 1.2 |
20 |
diff -u -r1.1 -r1.2 |
21 |
--- 63_all_binutils-2.18-pt-pax-flags-20070828.patch 29 Aug 2007 04:16:27 -0000 1.1 |
22 |
+++ 63_all_binutils-2.18-pt-pax-flags-20070828.patch 18 Sep 2007 04:48:33 -0000 1.2 |
23 |
@@ -84,9 +84,9 @@ |
24 |
--- binutils-2.18/bfd/elflink.c |
25 |
+++ binutils-2.18/bfd/elflink.c |
26 |
@@ -5328,16 +5328,30 @@ bfd_elf_size_dynamic_sections (bfd *outp |
27 |
+ return TRUE; |
28 |
|
29 |
bed = get_elf_backend_data (output_bfd); |
30 |
- elf_tdata (output_bfd)->relro = info->relro; |
31 |
+ elf_tdata (output_bfd)->pax_flags = PF_NORANDEXEC; |
32 |
+ |
33 |
+ if (info->execheap) |
34 |
|
35 |
|
36 |
|
37 |
1.1 src/patchsets/binutils/2.18/33_all_binutils-gnu-relro-fixups.patch |
38 |
|
39 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.18/33_all_binutils-gnu-relro-fixups.patch?rev=1.1&view=markup |
40 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.18/33_all_binutils-gnu-relro-fixups.patch?rev=1.1&content-type=text/plain |
41 |
|
42 |
Index: 33_all_binutils-gnu-relro-fixups.patch |
43 |
=================================================================== |
44 |
http://bugs.gentoo.org/192584 |
45 |
http://sourceware.org/bugzilla/show_bug.cgi?id=5037 |
46 |
http://sourceware.org/ml/binutils/2007-09/msg00208.html |
47 |
|
48 |
bfd/ |
49 |
|
50 |
2007-09-16 H.J. Lu <hongjiu.lu@×××××.com> |
51 |
|
52 |
PR binutils/3281 |
53 |
PR binutils/5037 |
54 |
* elf-bfd.h (elf_obj_tdata): Remove relro. |
55 |
|
56 |
* elf.c (get_program_header_size): Check info->relro instead |
57 |
of elf_tdata (abfd)->relro. |
58 |
(_bfd_elf_map_sections_to_segments): Likewise. |
59 |
(assign_file_positions_for_load_sections): Don't set |
60 |
PT_GNU_RELRO segment alignment here. |
61 |
(assign_file_positions_for_non_load_sections): Properly set up |
62 |
PT_GNU_RELRO segment for copying executable/shared library. |
63 |
(rewrite_elf_program_header): Remove PT_GNU_RELRO segment. |
64 |
(copy_elf_program_header): Set p_size and p_size_valid fields for |
65 |
PT_GNU_RELRO segment. |
66 |
|
67 |
include/elf/ |
68 |
|
69 |
2007-09-16 H.J. Lu <hongjiu.lu@×××××.com> |
70 |
|
71 |
PR binutils/3281 |
72 |
PR binutils/5037 |
73 |
* internal.h (elf_segment_map): Add p_size and p_size_valid. |
74 |
(ELF_IS_SECTION_IN_SEGMENT): Allow SHF_TLS sections in |
75 |
PT_GNU_RELRO segments. |
76 |
|
77 |
ld/ |
78 |
|
79 |
2007-09-16 H.J. Lu <hongjiu.lu@×××××.com> |
80 |
|
81 |
PR binutils/3281 |
82 |
PR binutils/5037 |
83 |
* ldexp.h (ldexp_control): Add relro, relro_start_stat and |
84 |
relro_end_stat. |
85 |
|
86 |
* ldexp.c (fold_binary): Set expld.dataseg.relro to |
87 |
exp_dataseg_relro_start or exp_dataseg_relro_end when |
88 |
seeing DATA_SEGMENT_ALIGN or DATA_SEGMENT_RELRO_END, |
89 |
respectively. |
90 |
|
91 |
* ldlang.c (lang_size_sections_1): Properly set |
92 |
expld.dataseg.relro_start_stat and |
93 |
expld.dataseg.relro_end_stat. |
94 |
(find_relro_section_callback): New function. |
95 |
(lang_find_relro_sections_1): Likewise. |
96 |
(lang_find_relro_sections): Likewise. |
97 |
(lang_process): Call lang_find_relro_sections for |
98 |
non-relocatable link. |
99 |
|
100 |
ld/testsuite/ |
101 |
|
102 |
2007-09-16 H.J. Lu <hongjiu.lu@×××××.com> |
103 |
|
104 |
PR binutils/3281 |
105 |
PR binutils/5037 |
106 |
* ld-elf/binutils.exp: Update "-z relro" tests to use relro1.s. |
107 |
Add "-z relro" tests with relro2.s. Add "-z relro" tests with |
108 |
TLS for objcopy. |
109 |
|
110 |
* ld-elf/relro1.s: New file. |
111 |
* ld-elf/relro2.s: Likewise. |
112 |
|
113 |
--- binutils/bfd/elf-bfd.h.relro 2007-09-17 06:49:32.000000000 -0700 |
114 |
+++ binutils/bfd/elf-bfd.h 2007-09-17 06:49:32.000000000 -0700 |
115 |
@@ -1427,9 +1427,6 @@ struct elf_obj_tdata |
116 |
/* Segment flags for the PT_GNU_STACK segment. */ |
117 |
unsigned int stack_flags; |
118 |
|
119 |
- /* Should the PT_GNU_RELRO segment be emitted? */ |
120 |
- bfd_boolean relro; |
121 |
- |
122 |
/* Symbol version definitions in external objects. */ |
123 |
Elf_Internal_Verdef *verdef; |
124 |
|
125 |
--- binutils/bfd/elf.c.relro 2007-09-17 06:49:32.000000000 -0700 |
126 |
+++ binutils/bfd/elf.c 2007-09-17 07:23:12.000000000 -0700 |
127 |
@@ -3361,7 +3361,7 @@ get_program_header_size (bfd *abfd, stru |
128 |
/* We need a PT_DYNAMIC segment. */ |
129 |
++segs; |
130 |
|
131 |
- if (elf_tdata (abfd)->relro) |
132 |
+ if (info->relro) |
133 |
{ |
134 |
/* We need a PT_GNU_RELRO segment only when there is a |
135 |
PT_DYNAMIC segment. */ |
136 |
@@ -3989,7 +3989,7 @@ _bfd_elf_map_sections_to_segments (bfd * |
137 |
pm = &m->next; |
138 |
} |
139 |
|
140 |
- if (dynsec != NULL && elf_tdata (abfd)->relro) |
141 |
+ if (dynsec != NULL && info->relro) |
142 |
{ |
143 |
/* We make a PT_GNU_RELRO segment only when there is a |
144 |
PT_DYNAMIC segment. */ |
145 |
@@ -4491,12 +4491,10 @@ assign_file_positions_for_load_sections |
146 |
p->p_memsz += this_hdr->sh_size; |
147 |
} |
148 |
|
149 |
- if (p->p_type == PT_GNU_RELRO) |
150 |
- p->p_align = 1; |
151 |
- else if (align > p->p_align |
152 |
- && !m->p_align_valid |
153 |
- && (p->p_type != PT_LOAD |
154 |
- || (abfd->flags & D_PAGED) == 0)) |
155 |
+ if (align > p->p_align |
156 |
+ && !m->p_align_valid |
157 |
+ && (p->p_type != PT_LOAD |
158 |
+ || (abfd->flags & D_PAGED) == 0)) |
159 |
p->p_align = align; |
160 |
} |
161 |
|
162 |
@@ -4646,18 +4644,53 @@ assign_file_positions_for_non_load_secti |
163 |
if (m->count != 0) |
164 |
{ |
165 |
if (p->p_type != PT_LOAD |
166 |
- && (p->p_type != PT_NOTE || bfd_get_format (abfd) != bfd_core)) |
167 |
+ && (p->p_type != PT_NOTE |
168 |
+ || bfd_get_format (abfd) != bfd_core)) |
169 |
{ |
170 |
Elf_Internal_Shdr *hdr; |
171 |
+ asection *sect; |
172 |
+ |
173 |
BFD_ASSERT (!m->includes_filehdr && !m->includes_phdrs); |
174 |
|
175 |
- hdr = &elf_section_data (m->sections[m->count - 1])->this_hdr; |
176 |
- p->p_filesz = (m->sections[m->count - 1]->filepos |
177 |
- - m->sections[0]->filepos); |
178 |
+ sect = m->sections[m->count - 1]; |
179 |
+ hdr = &elf_section_data (sect)->this_hdr; |
180 |
+ p->p_filesz = sect->filepos - m->sections[0]->filepos; |
181 |
if (hdr->sh_type != SHT_NOBITS) |
182 |
p->p_filesz += hdr->sh_size; |
183 |
|
184 |
- p->p_offset = m->sections[0]->filepos; |
185 |
+ if (p->p_type == PT_GNU_RELRO) |
186 |
+ { |
187 |
+ /* When we get here, we are copying executable |
188 |
+ or shared library. But we need to use the same |
189 |
+ linker logic. */ |
190 |
+ Elf_Internal_Phdr *lp; |
191 |
+ |
192 |
+ for (lp = phdrs; lp < phdrs + count; ++lp) |
193 |
+ { |
194 |
+ if (lp->p_type == PT_LOAD |
195 |
+ && lp->p_paddr == p->p_paddr) |
196 |
+ break; |
197 |
+ } |
198 |
+ |
199 |
+ if (lp < phdrs + count) |
200 |
+ { |
201 |
+ /* We should use p_size if it is valid since it |
202 |
+ may contain the first few bytes of the next |
203 |
+ SEC_ALLOC section. */ |
204 |
+ if (m->p_size_valid) |
205 |
+ p->p_filesz = m->p_size; |
206 |
+ else |
207 |
+ abort (); |
208 |
+ p->p_vaddr = lp->p_vaddr; |
209 |
+ p->p_offset = lp->p_offset; |
210 |
+ p->p_memsz = p->p_filesz; |
211 |
+ p->p_align = 1; |
212 |
+ } |
213 |
+ else |
214 |
+ abort (); |
215 |
+ } |
216 |
+ else |
217 |
+ p->p_offset = m->sections[0]->filepos; |
218 |
} |
219 |
} |
220 |
else |
221 |
@@ -5246,7 +5279,12 @@ rewrite_elf_program_header (bfd *ibfd, b |
222 |
} |
223 |
|
224 |
if (segment->p_type != PT_LOAD) |
225 |
- continue; |
226 |
+ { |
227 |
+ /* Remove PT_GNU_RELRO segment. */ |
228 |
+ if (segment->p_type == PT_GNU_RELRO) |
229 |
+ segment->p_type = PT_NULL; |
230 |
+ continue; |
231 |
+ } |
232 |
|
233 |
/* Determine if this segment overlaps any previous segments. */ |
234 |
for (j = 0, segment2 = elf_tdata (ibfd)->phdr; j < i; j++, segment2 ++) |
235 |
@@ -5770,6 +5808,17 @@ copy_elf_program_header (bfd *ibfd, bfd |
236 |
map->p_align_valid = 1; |
237 |
map->p_vaddr_offset = 0; |
238 |
|
239 |
+ if (map->p_type == PT_GNU_RELRO |
240 |
+ && segment->p_filesz == segment->p_memsz) |
241 |
+ { |
242 |
+ /* The PT_GNU_RELRO segment may contain the first a few |
243 |
+ bytes in the .got.plt section even if the whole .got.plt |
244 |
+ section isn't in the PT_GNU_RELRO segment. We won't |
245 |
+ change the size of the PT_GNU_RELRO segment. */ |
246 |
+ map->p_size = segment->p_filesz; |
247 |
+ map->p_size_valid = 1; |
248 |
+ } |
249 |
+ |
250 |
/* Determine if this segment contains the ELF file header |
251 |
and if it contains the program headers themselves. */ |
252 |
map->includes_filehdr = (segment->p_offset == 0 |
253 |
--- binutils/bfd/elflink.c.relro 2007-09-17 06:49:32.000000000 -0700 |
254 |
+++ binutils/bfd/elflink.c 2007-09-17 06:49:32.000000000 -0700 |
255 |
@@ -5397,7 +5397,6 @@ bfd_elf_size_dynamic_sections (bfd *outp |
256 |
return TRUE; |
257 |
|
258 |
bed = get_elf_backend_data (output_bfd); |
259 |
- elf_tdata (output_bfd)->relro = info->relro; |
260 |
if (info->execstack) |
261 |
elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X; |
262 |
else if (info->noexecstack) |
263 |
--- binutils/include/elf/internal.h.relro 2007-05-03 14:07:31.000000000 -0700 |
264 |
+++ binutils/include/elf/internal.h 2007-09-17 06:49:32.000000000 -0700 |
265 |
@@ -239,6 +239,8 @@ struct elf_segment_map |
266 |
bfd_vma p_vaddr_offset; |
267 |
/* Program segment alignment. */ |
268 |
bfd_vma p_align; |
269 |
+ /* Segment size in file and memory */ |
270 |
+ bfd_vma p_size; |
271 |
/* Whether the p_flags field is valid; if not, the flags are based |
272 |
on the section flags. */ |
273 |
unsigned int p_flags_valid : 1; |
274 |
@@ -248,6 +250,9 @@ struct elf_segment_map |
275 |
/* Whether the p_align field is valid; if not, PT_LOAD segment |
276 |
alignment is based on the default maximum page size. */ |
277 |
unsigned int p_align_valid : 1; |
278 |
+ /* Whether the p_size field is valid; if not, the size are based |
279 |
+ on the section sizes. */ |
280 |
+ unsigned int p_size_valid : 1; |
281 |
/* Whether this segment includes the file header. */ |
282 |
unsigned int includes_filehdr : 1; |
283 |
/* Whether this segment includes the program headers. */ |
284 |
@@ -266,11 +271,12 @@ struct elf_segment_map |
285 |
|| segment->p_type == PT_TLS) ? sec_hdr->sh_size : 0) |
286 |
|
287 |
/* Decide if the given sec_hdr is in the given segment. PT_TLS segment |
288 |
- contains only SHF_TLS sections. Only PT_LOAD and PT_TLS segments |
289 |
- can contain SHF_TLS sections. */ |
290 |
+ contains only SHF_TLS sections. Only PT_LOAD, PT_GNU_RELRO and |
291 |
+ and PT_TLS segments can contain SHF_TLS sections. */ |
292 |
#define ELF_IS_SECTION_IN_SEGMENT(sec_hdr, segment) \ |
293 |
(((((sec_hdr->sh_flags & SHF_TLS) != 0) \ |
294 |
&& (segment->p_type == PT_TLS \ |
295 |
+ || segment->p_type == PT_GNU_RELRO \ |
296 |
|| segment->p_type == PT_LOAD)) \ |
297 |
|| ((sec_hdr->sh_flags & SHF_TLS) == 0 \ |
298 |
&& segment->p_type != PT_TLS)) \ |
299 |
--- binutils/ld/ldexp.c.relro 2007-08-18 06:22:30.000000000 -0700 |
300 |
+++ binutils/ld/ldexp.c 2007-09-17 06:49:32.000000000 -0700 |
301 |
@@ -390,6 +390,7 @@ fold_binary (etree_type *tree) |
302 |
break; |
303 |
|
304 |
case DATA_SEGMENT_ALIGN: |
305 |
+ expld.dataseg.relro = exp_dataseg_relro_start; |
306 |
if (expld.phase != lang_first_phase_enum |
307 |
&& expld.section == bfd_abs_section_ptr |
308 |
&& (expld.dataseg.phase == exp_dataseg_none |
309 |
@@ -425,6 +426,7 @@ fold_binary (etree_type *tree) |
310 |
break; |
311 |
|
312 |
case DATA_SEGMENT_RELRO_END: |
313 |
+ expld.dataseg.relro = exp_dataseg_relro_end; |
314 |
if (expld.phase != lang_first_phase_enum |
315 |
&& (expld.dataseg.phase == exp_dataseg_align_seen |
316 |
|| expld.dataseg.phase == exp_dataseg_adjust |
317 |
--- binutils/ld/ldexp.h.relro 2007-07-09 06:29:44.000000000 -0700 |
318 |
+++ binutils/ld/ldexp.h 2007-09-17 06:49:32.000000000 -0700 |
319 |
@@ -98,6 +98,8 @@ typedef enum { |
320 |
lang_final_phase_enum |
321 |
} lang_phase_type; |
322 |
|
323 |
+union lang_statement_union; |
324 |
+ |
325 |
struct ldexp_control { |
326 |
/* Modify expression evaluation depending on this. */ |
327 |
lang_phase_type phase; |
328 |
@@ -125,6 +127,15 @@ struct ldexp_control { |
329 |
} phase; |
330 |
|
331 |
bfd_vma base, min_base, relro_end, end, pagesize, maxpagesize; |
332 |
+ |
333 |
+ enum { |
334 |
+ exp_dataseg_relro_none, |
335 |
+ exp_dataseg_relro_start, |
336 |
+ exp_dataseg_relro_end, |
337 |
+ } relro; |
338 |
+ |
339 |
+ union lang_statement_union *relro_start_stat; |
340 |
+ union lang_statement_union *relro_end_stat; |
341 |
} dataseg; |
342 |
}; |
343 |
|
344 |
--- binutils/ld/ldlang.c.relro 2007-08-31 16:00:04.000000000 -0700 |
345 |
+++ binutils/ld/ldlang.c 2007-09-17 06:49:32.000000000 -0700 |
346 |
@@ -4636,10 +4636,32 @@ lang_size_sections_1 |
347 |
bfd_vma newdot = dot; |
348 |
etree_type *tree = s->assignment_statement.exp; |
349 |
|
350 |
+ expld.dataseg.relro = exp_dataseg_relro_none; |
351 |
+ |
352 |
exp_fold_tree (tree, |
353 |
output_section_statement->bfd_section, |
354 |
&newdot); |
355 |
|
356 |
+ if (expld.dataseg.relro == exp_dataseg_relro_start) |
357 |
+ { |
358 |
+ if (!expld.dataseg.relro_start_stat) |
359 |
+ expld.dataseg.relro_start_stat = s; |
360 |
+ else |
361 |
+ { |
362 |
+ ASSERT (expld.dataseg.relro_start_stat == s); |
363 |
+ } |
364 |
+ } |
365 |
+ else if (expld.dataseg.relro == exp_dataseg_relro_end) |
366 |
+ { |
367 |
+ if (!expld.dataseg.relro_end_stat) |
368 |
+ expld.dataseg.relro_end_stat = s; |
369 |
+ else |
370 |
+ { |
371 |
+ ASSERT (expld.dataseg.relro_end_stat == s); |
372 |
+ } |
373 |
+ } |
374 |
+ expld.dataseg.relro = exp_dataseg_relro_none; |
375 |
+ |
376 |
/* This symbol is relative to this section. */ |
377 |
if ((tree->type.node_class == etree_provided |
378 |
|| tree->type.node_class == etree_assign) |
379 |
@@ -5665,6 +5687,81 @@ lang_gc_sections (void) |
380 |
bfd_gc_sections (output_bfd, &link_info); |
381 |
} |
382 |
|
383 |
+/* Worker for lang_find_relro_sections_1. */ |
384 |
+ |
385 |
+static void |
386 |
+find_relro_section_callback (lang_wild_statement_type *ptr ATTRIBUTE_UNUSED, |
387 |
+ struct wildcard_list *sec ATTRIBUTE_UNUSED, |
388 |
+ asection *section, |
389 |
+ lang_input_statement_type *file ATTRIBUTE_UNUSED, |
390 |
+ void *data) |
391 |
+{ |
392 |
+ /* Discarded, excluded and ignored sections effectively have zero |
393 |
+ size. */ |
394 |
+ if (section->output_section != NULL |
395 |
+ && section->output_section->owner == output_bfd |
396 |
+ && (section->output_section->flags & SEC_EXCLUDE) == 0 |
397 |
+ && !IGNORE_SECTION (section) |
398 |
+ && section->size != 0) |
399 |
+ { |
400 |
+ bfd_boolean *has_relro_section = (bfd_boolean *) data; |
401 |
+ *has_relro_section = TRUE; |
402 |
+ } |
403 |
+} |
404 |
+ |
405 |
+/* Iterate over sections for relro sections. */ |
406 |
+ |
407 |
+static void |
408 |
+lang_find_relro_sections_1 (lang_statement_union_type *s, |
409 |
+ bfd_boolean *has_relro_section) |
410 |
+{ |
411 |
+ if (*has_relro_section) |
412 |
+ return; |
413 |
+ |
414 |
+ for (; s != NULL; s = s->header.next) |
415 |
+ { |
416 |
+ if (s == expld.dataseg.relro_end_stat) |
417 |
+ break; |
418 |
+ |
419 |
+ switch (s->header.type) |
420 |
+ { |
421 |
+ case lang_wild_statement_enum: |
422 |
+ walk_wild (&s->wild_statement, |
423 |
+ find_relro_section_callback, |
424 |
+ has_relro_section); |
425 |
+ break; |
426 |
+ case lang_constructors_statement_enum: |
427 |
+ lang_find_relro_sections_1 (constructor_list.head, |
428 |
+ has_relro_section); |
429 |
+ break; |
430 |
+ case lang_output_section_statement_enum: |
431 |
+ lang_find_relro_sections_1 (s->output_section_statement.children.head, |
432 |
+ has_relro_section); |
433 |
+ break; |
434 |
+ case lang_group_statement_enum: |
435 |
+ lang_find_relro_sections_1 (s->group_statement.children.head, |
436 |
+ has_relro_section); |
437 |
+ break; |
438 |
+ default: |
439 |
+ break; |
440 |
+ } |
441 |
+ } |
442 |
+} |
443 |
+ |
444 |
+static void |
445 |
+lang_find_relro_sections (void) |
446 |
+{ |
447 |
+ bfd_boolean has_relro_section = FALSE; |
448 |
+ |
449 |
+ /* Check all sections in the link script. */ |
450 |
+ |
451 |
+ lang_find_relro_sections_1 (expld.dataseg.relro_start_stat, |
452 |
+ &has_relro_section); |
453 |
+ |
454 |
+ if (!has_relro_section) |
455 |
+ link_info.relro = FALSE; |
456 |
+} |
457 |
+ |
458 |
/* Relax all sections until bfd_relax_section gives up. */ |
459 |
|
460 |
static void |
461 |
@@ -5792,6 +5889,10 @@ lang_process (void) |
462 |
section positions, since they will affect SIZEOF_HEADERS. */ |
463 |
lang_record_phdrs (); |
464 |
|
465 |
+ /* Check relro sections. */ |
466 |
+ if (link_info.relro && ! link_info.relocatable) |
467 |
+ lang_find_relro_sections (); |
468 |
+ |
469 |
/* Size up the sections. */ |
470 |
lang_size_sections (NULL, !command_line.relax); |
471 |
|
472 |
--- binutils/ld/testsuite/ld-elf/binutils.exp.relro 2007-08-28 06:49:05.000000000 -0700 |
473 |
+++ binutils/ld/testsuite/ld-elf/binutils.exp 2007-09-17 06:49:32.000000000 -0700 |
474 |
@@ -104,24 +104,42 @@ binutils_test strip "-shared" maxpage1 |
475 |
binutils_test objcopy "" maxpage1 |
476 |
binutils_test objcopy "-shared" maxpage1 |
477 |
|
478 |
-binutils_test strip "-z relro" maxpage1 |
479 |
-binutils_test strip "-z relro -shared" maxpage1 |
480 |
-binutils_test objcopy "-z relro" maxpage1 |
481 |
-binutils_test objcopy "-z relro -shared" maxpage1 |
482 |
+binutils_test strip "-z relro" relro1 |
483 |
+binutils_test strip "-z relro -shared" relro1 |
484 |
+binutils_test objcopy "-z relro" relro1 |
485 |
+binutils_test objcopy "-z relro -shared" relro1 |
486 |
+if { ([istarget "i?86-*-elf*"] |
487 |
+ || ([istarget "i?86-*-linux*"] |
488 |
+ && ![istarget "*-*-*aout*"] |
489 |
+ && ![istarget "*-*-*oldld*"]) |
490 |
+ || [istarget "x86_64-*-linux*"] |
491 |
+ || [istarget "amd64-*-linux*"]) } { |
492 |
+ binutils_test strip "-z relro -shared" relro2 |
493 |
+ binutils_test objcopy "-z relro -shared" relro2 |
494 |
+} |
495 |
|
496 |
binutils_test objcopy "" tbss1 |
497 |
+binutils_test objcopy "-z relro" tbss1 |
498 |
binutils_test objcopy "-shared" tbss1 |
499 |
+binutils_test objcopy "-shared -z relro" tbss1 |
500 |
binutils_test objcopy "-z max-page-size=0x100000" tbss1 |
501 |
binutils_test objcopy "-z max-page-size=0x100000 -z common-page-size=0x1000" tbss1 |
502 |
binutils_test objcopy "" tdata1 |
503 |
+binutils_test objcopy "-z relro" tdata1 |
504 |
binutils_test objcopy "-shared" tdata1 |
505 |
+binutils_test objcopy "-shared -z relro" tdata1 |
506 |
binutils_test objcopy "-z max-page-size=0x100000" tdata1 |
507 |
binutils_test objcopy "-z max-page-size=0x100000 -z common-page-size=0x1000" tdata1 |
508 |
binutils_test objcopy "" tbss2 |
509 |
+binutils_test objcopy "-z relro" tbss2 |
510 |
binutils_test objcopy "-shared" tbss2 |
511 |
+binutils_test objcopy "-shared -z relro" tbss2 |
512 |
binutils_test objcopy "-z max-page-size=0x100000" tbss2 |
513 |
binutils_test objcopy "-z max-page-size=0x100000 -z common-page-size=0x1000" tbss2 |
514 |
-binutils_test objcopy "-z max-page-size=0x100000" tdata2 |
515 |
+ |
516 |
binutils_test objcopy "" tdata2 |
517 |
+binutils_test objcopy "-z relro" tdata2 |
518 |
binutils_test objcopy "-shared" tdata2 |
519 |
+binutils_test objcopy "-shared -z relro" tdata2 |
520 |
+binutils_test objcopy "-z max-page-size=0x100000" tdata2 |
521 |
binutils_test objcopy "-z max-page-size=0x100000 -z common-page-size=0x1000" tdata2 |
522 |
--- binutils/ld/testsuite/ld-elf/relro1.s.relro 2007-09-17 06:49:32.000000000 -0700 |
523 |
+++ binutils/ld/testsuite/ld-elf/relro1.s 2007-09-17 06:49:32.000000000 -0700 |
524 |
@@ -0,0 +1,14 @@ |
525 |
+ .globl main |
526 |
+ .globl start |
527 |
+ .globl _start |
528 |
+ .globl __start |
529 |
+ .text |
530 |
+main: |
531 |
+start: |
532 |
+_start: |
533 |
+__start: |
534 |
+ .long 0 |
535 |
+ .data |
536 |
+ .long 0 |
537 |
+ .section .data.rel.ro,"aw",%progbits |
538 |
+ .long 0 |
539 |
--- binutils/ld/testsuite/ld-elf/relro2.s.relro 2007-09-17 06:49:32.000000000 -0700 |
540 |
+++ binutils/ld/testsuite/ld-elf/relro2.s 2007-09-17 06:49:32.000000000 -0700 |
541 |
@@ -0,0 +1,5 @@ |
542 |
+ .text |
543 |
+ .globl x |
544 |
+ .type x, @function |
545 |
+x: |
546 |
+ jmp foo@PLT |
547 |
|
548 |
|
549 |
|
550 |
|
551 |
-- |
552 |
gentoo-commits@g.o mailing list |