This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH, RFC] weakref error with ppc -m64 -mcall-aixdesc
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: binutils at sources dot redhat dot com, jakub at redhat dot com
- Cc: David Edelsohn <dje at watson dot ibm dot com>, Alan Modra <amodra at bigpond dot net dot au>
- Date: Thu, 17 Nov 2005 01:19:34 -0200
- Subject: [PATCH, RFC] weakref error with ppc -m64 -mcall-aixdesc
An asm source such as:
.weakref foo, bar
.weakref .foo, .bar
should not have any entries in the symbol table, but what we were
getting was a strong undef for .bar. After fixing that, and adding:
bl .foo
I noticed that .bar made it to the symbol table as weak, but bar
didn't make it at all, contrary to the intent of the code I'd just
tweaked, so I narrowed the condition used to drop weakrefd symbols
such that both bar and .bar would make it as weak symbols.
Ok to install? Tested on amd64-linux-gnu-x-ppc64-linux-gnu.
Index: gas/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* config/tc-ppc.c (ppc_frob_file_before_adjust): Do not reference
dotname.
* write.c (write_object_file): Do not remove used weakrefd.
Index: gas/config/tc-ppc.c
===================================================================
--- gas/config/tc-ppc.c.orig 2005-11-17 00:59:48.000000000 -0200
+++ gas/config/tc-ppc.c 2005-11-17 01:08:04.000000000 -0200
@@ -1931,7 +1931,7 @@
dotname = xmalloc (len + 1);
dotname[0] = '.';
memcpy (dotname + 1, name, len);
- dotsym = symbol_find (dotname);
+ dotsym = symbol_find_noref (dotname, 1);
free (dotname);
if (dotsym != NULL && (symbol_used_p (dotsym)
|| symbol_used_in_reloc_p (dotsym)))
Index: gas/write.c
===================================================================
--- gas/write.c.orig 2005-11-17 00:59:48.000000000 -0200
+++ gas/write.c 2005-11-17 01:08:04.000000000 -0200
@@ -1513,7 +1513,8 @@
opposites. Sometimes the former checks flags and the
latter examines the name... */
|| (!S_IS_EXTERNAL (symp)
- && (punt || S_IS_LOCAL (symp) || S_IS_WEAKREFD (symp))
+ && (punt || S_IS_LOCAL (symp) ||
+ (S_IS_WEAKREFD (symp) && ! symbol_used_p (symp)))
&& ! symbol_used_in_reloc_p (symp)))
{
symbol_remove (symp, &symbol_rootP, &symbol_lastP);
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}