This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
PATCH: binutils loop
- To: Arkadiusz Miskiewicz <misiek at pld dot ORG dot PL>
- Subject: PATCH: binutils loop
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Thu, 10 May 2001 00:27:44 -0700
- Cc: binutils at sourceware dot cygnus dot com
- References: <20010509020031.A26487@ikar.t17.ds.pwr.wroc.pl> <20010508170554.A8383@lucon.org> <20010509093632.A31544@ikar.t17.ds.pwr.wroc.pl>
On Wed, May 09, 2001 at 09:36:32AM +0200, Arkadiusz Miskiewicz wrote:
> On/Dnia Tue, May 08, 2001 at 05:05:54PM -0700, H . J . Lu wrote/napisał(a)
> > Please send me a testcase. I will fix it.
> Problem occur when compiling rpm-4.0.2
> (ftp://ftp.pld.org.pl:/PLD-1.0/SRPMS/SRPMS/rpm-4.0.2-11.src.rpm).
> on ix86 machine (3 different chrooted enviroment with libraries compiled
> for i386, i586 and i686 optimalization), one sparc and one alpha machine
> (same gcc/glibc/binutils version on all machines).
>
> http://www.t17.ds.pwr.wroc.pl/~misiek/binutils-test.tar.bz2
> here you can find simple testcase (linking, so only binaries are in this tar.bz2)
>
Here is a patch. Any comments?
H.J.
----
2001-05-10 H.J. Lu <hjl@gnu.org>
* linker.c (_bfd_generic_link_add_one_symbol): Check loop on
indirect symbols.
Index: linker.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/linker.c,v
retrieving revision 1.6
diff -u -p -r1.6 linker.c
--- linker.c 2001/04/13 18:47:23 1.6
+++ linker.c 2001/05/10 07:22:42
@@ -1801,6 +1801,15 @@ _bfd_generic_link_add_one_symbol (info,
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;