PR 25562: New binutils testsuite failures

Maciej W. Rozycki macro@linux-mips.org
Tue Mar 31 00:18:18 GMT 2020
On Mon, 30 Mar 2020, Alan Modra via Binutils wrote:

> > Where were the names stored then, if not in the string table ?  Or did the
> > objcopy actually add new section symbols ?
> 
> ELF section symbols normally have 0 in st_name, with an implicit name
> taken from their section.  MIPS for backwards compatibility with other
> linkers gives them a string table entry.  objcopy decided the copy
> needed that backward compat, while ld decided the original didn't.

 This came from commit 174fd7f95561 ("New bfd elf hook: force naming of 
local section symbols"), 
<https://sourceware.org/ml/binutils/2004-02/msg00072.html>; I guess the 
hook only needs to return TRUE iff (elf_elfheader (abfd)->e_type == 
ET_REL).  Like below.

 However this is actually not enough to fix the `pr25662' test case, 
because apparently we have another MIPS IRIX-compatibility bug, which 
makes `sh_info' set differently for `.symtab' by `objcopy' -- it's 10 in 
input and 7 in output; of course the underlying cause is IRIX's different 
interpretation of symbol table splitting.  Which happens regardless of 
this change and is possibly more serious than just an inconsistency with 
section symbol names.

 So I don't feel like committing this as it stands: I think we need the 
other bug tracked down and then all this mess covered with proper 
testsuite cases before I feel comfortable with making such changes.

  Maciej
---
 bfd/elfxx-mips.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

binutils-mips-bfd-local-section-symbols-et-rel.diff
Index: binutils/bfd/elfxx-mips.c
===================================================================
--- binutils.orig/bfd/elfxx-mips.c
+++ binutils/bfd/elfxx-mips.c
@@ -7284,7 +7284,7 @@ _bfd_mips_elf_eh_frame_address_size (bfd
 bfd_boolean
 _bfd_mips_elf_name_local_section_symbols (bfd *abfd)
 {
-  return SGI_COMPAT (abfd);
+  return elf_elfheader (abfd)->e_type == ET_REL && SGI_COMPAT (abfd);
 }
 
 /* Work over a section just before writing it out.  This routine is



More information about the Binutils mailing list