]> git.ipfire.org Git - people/pmueller/ipfire-3.x.git/blob - binutils/patches/binutils-2.22.52.0.1-warn-textrel.patch
72a0477ecc07e94d4c8b3a786d93f62b036f960e
[people/pmueller/ipfire-3.x.git] / binutils / patches / binutils-2.22.52.0.1-warn-textrel.patch
1 textrels are bad for forcing copy-on-write (this affects everyone),
2 and for security/runtime code generation, this affects security ppl.
3 But in either case, it doesn't matter who needs textrels, it's
4 the very fact that they're needed at all.
5
6 2006-06-10 Ned Ludd <solar@gentoo.org>, Mike Frysinger <vapier@gentoo.org>
7
8 * bfd/elflink.c (bfd_elf_final_link): Check all objects for TEXTRELs.
9 * ld/ldmain.c (main): Change textrel warning default to true.
10 * ld/testsuite/lib/ld-lib.exp (default_ld_simple_link): Scrub TEXTREL
11 warnings from ld output.
12
13 --- a/bfd/elflink.c
14 +++ b/bfd/elflink.c
15 @@ -8652,7 +8652,7 @@ bfd_elf_final_link (bfd *abfd, struct bf
16 goto error_return;
17
18 /* Check for DT_TEXTREL (late, in case the backend removes it). */
19 - if (((info->warn_shared_textrel && info->shared)
20 + if ((info->warn_shared_textrel
21 || info->error_textrel)
22 && (o = bfd_get_section_by_name (dynobj, ".dynamic")) != NULL)
23 {
24 @@ -8702,7 +8702,7 @@ bfd_elf_final_link (bfd *abfd, struct bf
25 (_("%P%X: read-only segment has dynamic relocations.\n"));
26 else
27 info->callbacks->einfo
28 - (_("%P: warning: creating a DT_TEXTREL in a shared object.\n"));
29 + (_("%P: warning: creating a DT_TEXTREL in object.\n"));
30 break;
31 }
32 }
33 --- a/ld/ldmain.c
34 +++ b/ld/ldmain.c
35 @@ -282,2 +282,3 @@ main (int argc, char **argv)
36 link_info.spare_dynamic_tags = 5;
37 + link_info.warn_shared_textrel = TRUE;
38 link_info.sharable_sections = FALSE;
39 --- a/ld/testsuite/lib/ld-lib.exp
40 +++ b/ld/testsuite/lib/ld-lib.exp
41 @@ -181,6 +181,10 @@ proc default_ld_simple_link { ld target
42 # symbol, since the default linker script might use ENTRY.
43 regsub -all "(^|\n)(\[^\n\]*: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output
44
45 + # Gentoo tweak:
46 + # We want to ignore TEXTREL warnings since we force enable them by default
47 + regsub -all "^lt-ld-new: warning: creating a DT_TEXTREL in object\." $exec_output "\\1" exec_output
48 +
49 if [string match "" $exec_output] then {
50 return 1
51 } else {