patches/binutils/2.19.1a/150-warn-textrel.patch
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Tue Jul 31 22:27:29 2012 +0200 (2012-07-31)
changeset 3018 7776e8369284
parent 1243 5d15872659ec
permissions -rw-r--r--
complibs/cloog: create missing m4 dir

Because we now patch configure.in and configure, the Makefile quicks
in a re-build rule as the source files are now more recent than the
bundled generated files, and that fails because the m4 directory
is missing, although on some systems where aclocal is not installed,
the re-build rule does nothing (except a warning).

Always create tht directory.

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