This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
bfd/syms.c patch for ia64-linux readelf -s testsuite failure
- To: binutils at gcc dot gnu dot org
- Subject: bfd/syms.c patch for ia64-linux readelf -s testsuite failure
- From: Jim Wilson <wilson at redhat dot com>
- Date: Wed, 4 Jul 2001 17:12:37 -0700
I tracked down the ia64-linux readelf -s testsuite failure.
The problem occurs in gas/write.c in write_object_file, where we sort through
symbol table entries before calling set_symtab. One of the things done here
is removing local symbols from the list. We check for local symbols by
calling S_IS_LOCAL, which in turn calls bfd_is_local_label which calls
elfNN_i6a4_is_local_label_name. The IA-64 assembler manual says everything
that starts with '.' is a local label, so we conclude that ".text" is a local
label and delete it from the symbol table. .text later gets added back in
a different place. However, we never should have deleted it in the first
place. This can be fixed by checking for section symbols in bfd_is_local_label
and recognizing that they can't be local labels.
With this patch I can run the binutils testsuite without any unexpected errors
on ia64-linux. If I see no objections, I'll check in this patch in a day or
two.
Now I have to look at the ia64-linux gas testsuite failures.
2001-07-04 Jim Wilson <wilson@redhat.com>
* syms.c (bfd_is_local_label): Return false if BSF_SECTION_SYM.
Index: bfd/syms.c
===================================================================
RCS file: /cvs/src/src/bfd/syms.c,v
retrieving revision 1.9
diff -p -r1.9 syms.c
*** syms.c 2001/03/08 21:04:02 1.9
--- syms.c 2001/07/04 23:43:58
*************** bfd_is_local_label (abfd, sym)
*** 353,359 ****
bfd *abfd;
asymbol *sym;
{
! if ((sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0)
return false;
if (sym->name == NULL)
return false;
--- 353,362 ----
bfd *abfd;
asymbol *sym;
{
! /* The BSF_SECTION_SYM check is needed for IA-64, where every label that
! starts with '.' is local. This would accidentally catch section names
! if we didn't reject them here. */
! if ((sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_SECTION_SYM)) != 0)
return false;
if (sym->name == NULL)
return false;