patches/binutils/2.19.1a/150-warn-textrel.patch
author Willy Tarreau <w@1wt.eu>
Tue Nov 15 19:11:57 2011 +0100 (2011-11-15)
changeset 2751 bd17cca444ae
parent 1243 5d15872659ec
permissions -rw-r--r--
debug/gdb: fix tic install path, tell ncurses where to find it

ncurses 5.9 wants tic to be either one of:
- $TIC_PATH
- /usr/bin/tic

Of course, se do not want the latter, for it can be incompatible if the
ncurses in the build system is too old (eg. RHEL 5.6, Debian Lenny...).
So, force TIC_PATH to the location of our own tic.

Also, install tic alongside the other build tools, not in a sub-dir
of the toolchain installation dir.

Signed-off-by: Willy Tarreau <w@1wt.eu>
[yann.morin.1998@anciens.enib.fr: install in builtools/bin, move TIC_PATH]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@1243
     1
Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/150-warn-textrel.patch
yann@1243
     2
yann@1243
     3
-= BEGIN original header =-
yann@1243
     4
Original patch from Gentoo:
yann@1243
     5
gentoo/src/patchsets/binutils/2.19/66_all_binutils-2.18.50.0.2-warn-textrel.patch
yann@1243
     6
yann@1243
     7
textrels are bad for forcing copy-on-write (this affects everyone),
yann@1243
     8
and for security/runtime code generation, this affects security ppl.
yann@1243
     9
But in either case, it doesn't matter who needs textrels, it's
yann@1243
    10
the very fact that they're needed at all.
yann@1243
    11
yann@1243
    12
-= END original header =-
yann@1243
    13
yann@1243
    14
diff -durN binutils-2.19.1.orig/bfd/elflink.c binutils-2.19.1/bfd/elflink.c
yann@1243
    15
--- binutils-2.19.1.orig/bfd/elflink.c	2009-03-08 11:57:02.000000000 +0100
yann@1243
    16
+++ binutils-2.19.1/bfd/elflink.c	2009-03-08 11:57:02.000000000 +0100
yann@1243
    17
@@ -10820,14 +10820,12 @@
yann@1243
    18
 	goto error_return;
yann@1243
    19
 
yann@1243
    20
       /* Check for DT_TEXTREL (late, in case the backend removes it).  */
yann@1243
    21
-      if (info->warn_shared_textrel && info->shared)
yann@1243
    22
+      o = bfd_get_section_by_name (dynobj, ".dynamic");
yann@1243
    23
+      if (info->warn_shared_textrel && o != NULL)
yann@1243
    24
 	{
yann@1243
    25
 	  bfd_byte *dyncon, *dynconend;
yann@1243
    26
 
yann@1243
    27
 	  /* Fix up .dynamic entries.  */
yann@1243
    28
-	  o = bfd_get_section_by_name (dynobj, ".dynamic");
yann@1243
    29
-	  BFD_ASSERT (o != NULL);
yann@1243
    30
-
yann@1243
    31
 	  dyncon = o->contents;
yann@1243
    32
 	  dynconend = o->contents + o->size;
yann@1243
    33
 	  for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn)
yann@1243
    34
@@ -10839,7 +10837,7 @@
yann@1243
    35
 	      if (dyn.d_tag == DT_TEXTREL)
yann@1243
    36
 		{
yann@1243
    37
 		 info->callbacks->einfo
yann@1243
    38
-		    (_("%P: warning: creating a DT_TEXTREL in a shared object.\n"));
yann@1243
    39
+		    (_("%P: warning: creating a DT_TEXTREL in object.\n"));
yann@1243
    40
 		  break;
yann@1243
    41
 		}
yann@1243
    42
 	    }
yann@1243
    43
diff -durN binutils-2.19.1.orig/ld/ldmain.c binutils-2.19.1/ld/ldmain.c
yann@1243
    44
--- binutils-2.19.1.orig/ld/ldmain.c	2008-08-17 05:12:50.000000000 +0200
yann@1243
    45
+++ binutils-2.19.1/ld/ldmain.c	2009-03-08 11:57:02.000000000 +0100
yann@1243
    46
@@ -274,6 +274,7 @@
yann@1243
    47
   link_info.relax_pass = 1;
yann@1243
    48
   link_info.pei386_auto_import = -1;
yann@1243
    49
   link_info.spare_dynamic_tags = 5;
yann@1243
    50
+  link_info.warn_shared_textrel = TRUE;
yann@1243
    51
   link_info.path_separator = ':';
yann@1243
    52
 
yann@1243
    53
   ldfile_add_arch ("");