From 6606e87af5dfff3856ca251190ad72e19b1e2b5f Mon Sep 17 00:00:00 2001 From: cvs2git Date: Wed, 6 Feb 2002 09:25:19 +0000 Subject: [PATCH] This commit was manufactured by cvs2git to create tag 'STABLE'. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Sprout from master 2002-02-06 09:25:19 UTC Arkadiusz Miśkiewicz '- fix -o in strip; release 4' Cherrypick from master 2001-05-10 10:48:51 UTC Arkadiusz Miśkiewicz 'e95ea9bb26c30d09ff58842c3d3efccd binutils-linker.patch': binutils-linker.patch -> 1.1 Delete: binutils-bdfbug.patch --- binutils-bdfbug.patch | 63 ------------------------------------------- binutils-linker.patch | 19 +++++++++++++ 2 files changed, 19 insertions(+), 63 deletions(-) delete mode 100644 binutils-bdfbug.patch create mode 100644 binutils-linker.patch diff --git a/binutils-bdfbug.patch b/binutils-bdfbug.patch deleted file mode 100644 index 9a90d35..0000000 --- a/binutils-bdfbug.patch +++ /dev/null @@ -1,63 +0,0 @@ -On Thu, Aug 02, 2001 at 05:02:26PM -0700, H . J . Lu wrote: -> On Fri, Aug 03, 2001 at 09:15:10AM +0930, Alan Modra wrote: -> > On Thu, Aug 02, 2001 at 10:09:41AM -0700, H . J . Lu wrote: -> > > -> > > Alan, why don't we discard all relocations for static binaries? -> > -> > A thinko on my part. We obviously should be discarding them. I -> > suspect this crept into elf32-i386.c from elf32-hppa.c, and it's -> > wrong there too. -> -> Could you please fix both of them? - -Your patch does the right thing, but I'm tweaking it a little. - -bfd/ChangeLog - From H.J. Lu - * elf32-i386.c (allocate_plt_and_got_and_discard_relocs): Don't - keep relocs for undefined syms if there are no dynamic sections in - executable. - * elf32-hppa.c (allocate_plt_and_got_and_discard_relocs): Likewise. - --- -Alan Modra - -Index: bfd/elf32-hppa.c -=================================================================== -RCS file: /cvs/src/src/bfd/elf32-hppa.c,v -retrieving revision 1.41 -diff -u -p -r1.41 elf32-hppa.c ---- bfd/elf32-hppa.c 2001/06/30 00:34:10 1.41 -+++ bfd/elf32-hppa.c 2001/08/03 05:07:46 -@@ -2141,8 +2141,9 @@ allocate_plt_and_got_and_discard_relocs - if (!info->shared - && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 - && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 -- || h->root.type == bfd_link_hash_undefweak -- || h->root.type == bfd_link_hash_undefined)) -+ || (hplink->root.dynamic_sections_created -+ && (h->root.type == bfd_link_hash_undefweak -+ || h->root.type == bfd_link_hash_undefined)))) - { - /* Make sure this symbol is output as a dynamic symbol. - Undefined weak syms won't yet be marked as dynamic. */ -Index: bfd/elf32-i386.c -=================================================================== -RCS file: /cvs/src/src/bfd/elf32-i386.c,v -retrieving revision 1.36 -diff -u -p -r1.36 elf32-i386.c ---- bfd/elf32-i386.c 2001/06/27 01:46:17 1.36 -+++ bfd/elf32-i386.c 2001/08/03 05:07:49 -@@ -1199,8 +1199,9 @@ allocate_plt_and_got_and_discard_relocs - if (!info->shared - && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 - && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 -- || h->root.type == bfd_link_hash_undefweak -- || h->root.type == bfd_link_hash_undefined)) -+ || (htab->root.dynamic_sections_created -+ && (h->root.type == bfd_link_hash_undefweak -+ || h->root.type == bfd_link_hash_undefined)))) - { - /* Make sure this symbol is output as a dynamic symbol. - Undefined weak syms won't yet be marked as dynamic. */ - diff --git a/binutils-linker.patch b/binutils-linker.patch new file mode 100644 index 0000000..1454273 --- /dev/null +++ b/binutils-linker.patch @@ -0,0 +1,19 @@ +diff -urN binutils-2.11.90.0.7.org/bfd/linker.c binutils-2.11.90.0.7/bfd/linker.c +--- binutils-2.11.90.0.7.org/bfd/linker.c Thu May 10 12:26:36 2001 ++++ binutils-2.11.90.0.7/bfd/linker.c Thu May 10 12:26:49 2001 +@@ -1801,6 +1801,15 @@ + copy, false); + if (inh == (struct bfd_link_hash_entry *) NULL) + return false; ++ if (inh->u.i.link == h ++ && inh->type == bfd_link_hash_indirect) ++ { ++ (*_bfd_error_handler) ++ (_("%s: indirect symbol `%s' to `%s' is a loop"), ++ bfd_get_filename (abfd), name, string); ++ bfd_set_error (bfd_error_invalid_operation); ++ return false; ++ } + if (inh->type == bfd_link_hash_new) + { + inh->type = bfd_link_hash_undefined; -- 2.44.0