This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FYI, mips64-linux failures


Thiemo Seufer wrote:
> Daniel Jacobowitz wrote:
> > On Fri, Jun 13, 2003 at 01:01:55AM +0200, Thiemo Seufer wrote:
> > > Daniel Jacobowitz wrote:
> > > > On the 2.14 branch, for "mips64-linux":
> > > > simple objcopy adds an empty .rel.text section (there's already a .rela.text
> > > > section).  This messes up the test, rightfully.
> > > 
> > > None of the utilities in /binutils seems to use bfd_merge_private_bfd_data
> > > as ld does, this keeps the ELF header flags long enough unset to make the
> > > NEWABI_P test in _bfd_mips_elf_fake_sections fail.
> > > 
> > > This probably means the copied object fails on IRIX6.
> > 
> > Hmm...
> > 
> > > > In readelf -s the Ndx column appears to be one low for most entries.
> > > 
> > > It fails for mips-linux, too, but not for mips-elf.
> > 
> > Not for mipsel-linux, either.  Interesting.  Any ideas?
> 
> mipsel-linux produces an empty .rela.text section, mips-linux doesn't.
> That's truely strange.

I haven't found a reason why this code in _bfd_mips_elf_fake_sections
exists at all. The assembler seems to create those sections on demand
anyway. The code was introduced 1999 as part of a larger chunk in
http://sources.redhat.com/ml/binutils/1999-q3/msg00001.html.
This patch removes it.


Thiemo


2003-06-22  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>

	/bfd/ChangeLog
	* elfxx-mips.c (_bfd_mips_elf_fake_sections): Remove non-default
	relocation header setup.

	/binutils/ChangeLog
	* binutils-all/readelf.ss-tmips: Adjust symbol indices.


diff -BurpNX /bigdisk/src/gcc-exclude source-orig/bfd/elfxx-mips.c source/bfd/elfxx-mips.c
--- source-orig/bfd/elfxx-mips.c	Thu Jun 12 15:21:40 2003
+++ source/bfd/elfxx-mips.c	Fri Jun 13 02:24:53 2003
@@ -4639,30 +4639,11 @@ _bfd_mips_elf_fake_sections (abfd, hdr, 
       hdr->sh_entsize = 8;
     }
 
-  /* The generic elf_fake_sections will set up REL_HDR using the
-     default kind of relocations.  But, we may actually need both
-     kinds of relocations, so we set up the second header here.
-
-     This is not necessary for the O32 ABI since that only uses Elf32_Rel
-     relocations (cf. System V ABI, MIPS RISC Processor Supplement,
-     3rd Edition, p. 4-17).  It breaks the IRIX 5/6 32-bit ld, since one
-     of the resulting empty .rela.<section> sections starts with
-     sh_offset == object size, and ld doesn't allow that.  While the check
-     is arguably bogus for empty or SHT_NOBITS sections, it can easily be
-     avoided by not emitting those useless sections in the first place.  */
-  if (! SGI_COMPAT (abfd) && ! NEWABI_P(abfd)
-      && (sec->flags & SEC_RELOC) != 0)
-    {
-      struct bfd_elf_section_data *esd;
-      bfd_size_type amt = sizeof (Elf_Internal_Shdr);
-
-      esd = elf_section_data (sec);
-      BFD_ASSERT (esd->rel_hdr2 == NULL);
-      esd->rel_hdr2 = (Elf_Internal_Shdr *) bfd_zalloc (abfd, amt);
-      if (!esd->rel_hdr2)
-	return FALSE;
-      _bfd_elf_init_reloc_shdr (abfd, esd->rel_hdr2, sec, !sec->use_rela_p);
-    }
+  /* The generic elf_fake_sections will set up REL_HDR using the default
+   kind of relocations.  We used to set up a second header for the
+   non-default kind of relocations here, but only NewABI would use
+   these, and the IRIX ld doesn't like resulting empty RELA sections.
+   Thus we create those header only on demand now.  */
 
   return TRUE;
 }
diff -BurpNX /bigdisk/src/gcc-exclude source-orig/binutils/testsuite/binutils-all/readelf.ss-tmips source/binutils/testsuite/binutils-all/readelf.ss-tmips
--- source-orig/binutils/testsuite/binutils-all/readelf.ss-tmips	Thu Jun  7 18:46:38 2001
+++ source/binutils/testsuite/binutils-all/readelf.ss-tmips	Sat Jun 21 00:07:00 2003
@@ -3,13 +3,13 @@ Symbol table '.symtab' contains 12 entri
    Num:    Value  Size Type    Bind   Vis      Ndx Name
      0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
      1: 00000000     0 SECTION LOCAL  DEFAULT    1 
-     2: 00000000     0 SECTION LOCAL  DEFAULT    4 
-     3: 00000000     0 SECTION LOCAL  DEFAULT    5 
+     2: 00000000     0 SECTION LOCAL  DEFAULT    3 
+     3: 00000000     0 SECTION LOCAL  DEFAULT    4 
      4: 00000000     0 NOTYPE  LOCAL  DEFAULT    1 static_text_symbol
-     5: 00000000     0 NOTYPE  LOCAL  DEFAULT    4 static_data_symbol
-     6: 00000000     0 SECTION LOCAL  DEFAULT    6 
-     7: 00000000     0 SECTION LOCAL  DEFAULT    7 
+     5: 00000000     0 NOTYPE  LOCAL  DEFAULT    3 static_data_symbol
+     6: 00000000     0 SECTION LOCAL  DEFAULT    5 
+     7: 00000000     0 SECTION LOCAL  DEFAULT    6 
      8: 00000000     0 OBJECT  GLOBAL DEFAULT    1 text_symbol
      9: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND external_symbol
-    10: 00000000     0 OBJECT  GLOBAL DEFAULT    4 data_symbol
+    10: 00000000     0 OBJECT  GLOBAL DEFAULT    3 data_symbol
     11: 00000004     4 OBJECT  GLOBAL DEFAULT  (PRC|COM) common_symbol


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]