This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Partial linking interacts badly with N_WARNING and N_INDIR
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Ian Dall <ian at beware dot dropbear dot id dot au>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 7 Aug 2002 15:59:48 +0930
- Subject: Re: Partial linking interacts badly with N_WARNING and N_INDIR
- References: <15696.30371.41046.404854@sibyl.beware.dropbear.id.au>
Hi Ian,
I think this will fix the problem for you. Please test that it
doesn't break anything else! I no longer have any a.out environments
to properly test this patch.
* aoutx.h (aout_link_write_symbols): Correct handling of warning syms.
$ x86/gas/as-new --em=i386aout -o warn_ref.o warn_ref.s
$ x86/binutils/nm-new -a warn_ref.o
00000000 - 00 0000 WARNING This is a Warning about _warn_ref
U _warn_ref
00000000 T _warn_ref
$ x86/ld/ld-new --oformat a.out-i386-linux -r -o warn_ref.x warn_ref.o
$ x86/binutils/nm-new -a warn_ref.x
00000000 - 00 0000 WARNING This is a Warning about _warn_ref
U _warn_ref
00000000 T _warn_ref
00000000 t warn_ref.o
Index: bfd/aoutx.h
===================================================================
RCS file: /cvs/src/src/bfd/aoutx.h,v
retrieving revision 1.32
diff -u -p -r1.32 aoutx.h
--- bfd/aoutx.h 31 Jul 2002 12:50:06 -0000 1.32
+++ bfd/aoutx.h 7 Aug 2002 06:24:25 -0000
@@ -4211,7 +4211,8 @@ aout_link_write_symbols (finfo, input_bf
/* Use the name from the hash table, in case the symbol was
wrapped. */
- if (h != NULL)
+ if (h != NULL
+ && h->root.type != bfd_link_hash_warning)
name = h->root.root.string;
/* If this is an indirect or warning symbol, then change
@@ -4233,7 +4234,6 @@ aout_link_write_symbols (finfo, input_bf
/* If the symbol has already been written out, skip it. */
if (h != (struct aout_link_hash_entry *) NULL
- && h->root.type != bfd_link_hash_warning
&& h->written)
{
if ((type & N_TYPE) == N_INDR
--
Alan Modra
IBM OzLabs - Linux Technology Centre