crosstool-ng/patches/binutils/2.19/150-warn-textrel.patch
Yann E. MORIN" 161a19e423 Add binutils-2.19 and associated patchset (vampirised from Gentoo).
/trunk/patches/binutils/2.19/120-sh-targets.patch             |   52    52     0     0 ++++
 /trunk/patches/binutils/2.19/180-use-relro.patch              |   14    14     0     0 +
 /trunk/patches/binutils/2.19/160-use-new-ld-dtags.patch       |   14    14     0     0 +
 /trunk/patches/binutils/2.19/100-ppc64-pie.patch              |   20    20     0     0 +
 /trunk/patches/binutils/2.19/190-libiberty-pic.patch          |   14    14     0     0 +
 /trunk/patches/binutils/2.19/170-generate-gnu-hash.patch      |   16    16     0     0 +
 /trunk/patches/binutils/2.19/110-RPATH_ENVVAR-smack.patch     |   17    17     0     0 +
 /trunk/patches/binutils/2.19/140-pt-pax-flags-20081101.patch  |  249   249     0     0 +++++++++++++++++
 /trunk/patches/binutils/2.19/150-warn-textrel.patch           |   48    48     0     0 +++
 /trunk/patches/binutils/2.19/130-check_ldrunpath_length.patch |   31    31     0     0 ++
 /trunk/config/binutils.in                                     |    5     5     0     0 +
 11 files changed, 480 insertions(+)
2008-11-23 16:34:49 +00:00

49 lines
1.8 KiB
Diff

Original patch from Gentoo:
gentoo/src/patchsets/binutils/2.19/66_all_binutils-2.18.50.0.2-warn-textrel.patch
textrels are bad for forcing copy-on-write (this affects everyone),
and for security/runtime code generation, this affects security ppl.
But in either case, it doesn't matter who needs textrels, it's
the very fact that they're needed at all.
diff -durN binutils-2.19.orig/bfd/elflink.c binutils-2.19/bfd/elflink.c
--- binutils-2.19.orig/bfd/elflink.c 2008-11-23 16:49:47.000000000 +0100
+++ binutils-2.19/bfd/elflink.c 2008-11-23 16:49:14.000000000 +0100
@@ -10820,14 +10820,12 @@
goto error_return;
/* Check for DT_TEXTREL (late, in case the backend removes it). */
- if (info->warn_shared_textrel && info->shared)
+ o = bfd_get_section_by_name (dynobj, ".dynamic");
+ if (info->warn_shared_textrel && o != NULL)
{
bfd_byte *dyncon, *dynconend;
/* Fix up .dynamic entries. */
- o = bfd_get_section_by_name (dynobj, ".dynamic");
- BFD_ASSERT (o != NULL);
-
dyncon = o->contents;
dynconend = o->contents + o->size;
for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn)
@@ -10839,7 +10837,7 @@
if (dyn.d_tag == DT_TEXTREL)
{
info->callbacks->einfo
- (_("%P: warning: creating a DT_TEXTREL in a shared object.\n"));
+ (_("%P: warning: creating a DT_TEXTREL in object.\n"));
break;
}
}
diff -durN binutils-2.19.orig/ld/ldmain.c binutils-2.19/ld/ldmain.c
--- binutils-2.19.orig/ld/ldmain.c 2008-08-17 05:12:50.000000000 +0200
+++ binutils-2.19/ld/ldmain.c 2008-11-23 16:52:37.000000000 +0100
@@ -274,6 +274,7 @@
link_info.relax_pass = 1;
link_info.pei386_auto_import = -1;
link_info.spare_dynamic_tags = 5;
+ link_info.warn_shared_textrel = TRUE;
link_info.path_separator = ':';
ldfile_add_arch ("");