diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-11-03 12:47:53 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-11-22 15:32:48 +0100 |
commit | db7117cbd0c2942a4b72243ddd131f97b786a4d5 (patch) | |
tree | 53b243aa667a3a8c9920b2329fbddd4f3f4ce1a3 /patches | |
parent | ca469bcb17d8375ff80859c43895cd3c8ede696e (diff) | |
download | OSELAS.Toolchain-db7117cbd0c2942a4b72243ddd131f97b786a4d5.tar.gz OSELAS.Toolchain-db7117cbd0c2942a4b72243ddd131f97b786a4d5.tar.xz |
add patches for binutils-2.21.1a
* copied from binutils-2.21.
* Obsolete and unused patches removed.
* Patch headers cleaned up.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches')
3 files changed, 121 insertions, 0 deletions
diff --git a/patches/binutils-2.21.1a/0001-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch b/patches/binutils-2.21.1a/0001-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch new file mode 100644 index 0000000..2701694 --- /dev/null +++ b/patches/binutils-2.21.1a/0001-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch @@ -0,0 +1,36 @@ +From: Michael Olbrich <m.olbrich@pengutronix.de> +Date: Tue, 1 Nov 2011 16:45:55 +0100 +Subject: [PATCH] Only generate an RPATH entry if LD_RUN_PATH is not empty, + for cases where -rpath isn't specified. + +This is http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=151024 + +This patch is still used in debian binutils 2.21.90.20111025-1 + +Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> +--- + ld/emultempl/elf32.em | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em +index 62a86ca..a0f3ee0 100644 +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1272,6 +1272,8 @@ fragment <<EOF + && command_line.rpath == NULL) + { + lib_path = (const char *) getenv ("LD_RUN_PATH"); ++ if ((lib_path) && (strlen (lib_path) == 0)) ++ lib_path = NULL; + if (gld${EMULATION_NAME}_search_needed (lib_path, &n, + force)) + break; +@@ -1499,6 +1501,8 @@ gld${EMULATION_NAME}_before_allocation (void) + rpath = command_line.rpath; + if (rpath == NULL) + rpath = (const char *) getenv ("LD_RUN_PATH"); ++ if ((rpath) && (strlen (rpath) == 0)) ++ rpath = NULL; + + for (abfd = link_info.input_bfds; abfd; abfd = abfd->link_next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/patches/binutils-2.21.1a/0002-warn-on-all-TEXTRELs.patch b/patches/binutils-2.21.1a/0002-warn-on-all-TEXTRELs.patch new file mode 100644 index 0000000..3be8fae --- /dev/null +++ b/patches/binutils-2.21.1a/0002-warn-on-all-TEXTRELs.patch @@ -0,0 +1,80 @@ +From: unknown author <unknown.author@example.com> +Date: Tue, 1 Nov 2011 16:44:50 +0100 +Subject: [PATCH] warn on all TEXTRELs + +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. + +2006-06-10 Ned Ludd <solar@gentoo.org>, Mike Frysinger <vapier@gentoo.org> + + * bfd/elflink.c (bfd_elf_final_link): Check all objects for TEXTRELs. + * ld/ldmain.c (main): Change textrel warning default to true. + * ld/testsuite/lib/ld-lib.exp (default_ld_simple_link): Scrub TEXTREL + warnings from ld output. + +Original patch from gentoo. Also used by crosstool-ng (binutils-2.20.1a). +--- + bfd/elflink.c | 8 +++----- + ld/ldmain.c | 1 + + ld/testsuite/lib/ld-lib.exp | 4 ++++ + 3 files changed, 8 insertions(+), 5 deletions(-) + +diff --git a/bfd/elflink.c b/bfd/elflink.c +index 9e69ec6..0396659 100644 +--- a/bfd/elflink.c ++++ b/bfd/elflink.c +@@ -11114,14 +11114,12 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) + 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) +@@ -11133,7 +11131,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) + 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 --git a/ld/ldmain.c b/ld/ldmain.c +index 96f3bda..9f88cc4 100644 +--- a/ld/ldmain.c ++++ b/ld/ldmain.c +@@ -287,6 +287,7 @@ main (int argc, char **argv) + emulation = get_emulation (argc, argv); + ldemul_choose_mode (emulation); + default_target = ldemul_choose_target (argc, argv); ++ link_info.warn_shared_textrel = TRUE; + config.maxpagesize = bfd_emul_get_maxpagesize (default_target); + config.commonpagesize = bfd_emul_get_commonpagesize (default_target); + lang_init (); +diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp +index f444da7..f935f12 100644 +--- a/ld/testsuite/lib/ld-lib.exp ++++ b/ld/testsuite/lib/ld-lib.exp +@@ -206,6 +206,10 @@ proc default_ld_simple_link { ld target objects } { + # symbol, since the default linker script might use ENTRY. + regsub -all "(^|\n)(\[^\n\]*: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output + ++ # Gentoo tweak: ++ # We want to ignore TEXTREL warnings since we force enable them by default ++ regsub -all "^lt-ld-new: warning: creating a DT_TEXTREL in object\." $exec_output "\\1" exec_output ++ + if [string match "" $exec_output] then { + return 1 + } else { diff --git a/patches/binutils-2.21.1a/series b/patches/binutils-2.21.1a/series new file mode 100644 index 0000000..4762139 --- /dev/null +++ b/patches/binutils-2.21.1a/series @@ -0,0 +1,5 @@ +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch +0002-warn-on-all-TEXTRELs.patch +# 1a5f8d1c54fd01eb21defa0471ac5129 - git-ptx-patches magic |