* 2.11.2 PATCH: Fix gas to allow GCC 3.0 to bootstrap on mips-sgi-irix5.3
@ 2001-07-20 16:57 Rainer Orth
0 siblings, 0 replies; only message in thread
From: Rainer Orth @ 2001-07-20 16:57 UTC (permalink / raw)
To: binutils
As reported in
http://sources.redhat.com/ml/binutils/2001-06/msg00752.html
GCC 3.0 for mips-sgi-irix5.3 doesn't bootstrap with gas 2.11.2. Since that
request for help/suggestions evoked no response whatsoever, I analyzed the
problem myself, and (with lots of help from SGIs Dave Anderson) could trace
it to a combination of a dubious check in SGIs 32-bit ld and useless empty
sections emitted by gas.
As reported above, ld fails as soon as it tries to link gas-created object
files. The error message is emitted because the last sections's offset
Offset Size Name
0x5594 0 .rela.rodata
starts at the object file size. See the comment below for details. The
following patch allows me to bootstrap GCC 3.0, so at least it fixes this
problem.
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Email: ro@TechFak.Uni-Bielefeld.DE
Fri Jul 20 00:12:38 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* elf32-mips.c (_bfd_mips_elf_fake_sections): Don't create .rela
sections for the O32 ABI.
===================================================================
RCS file: bfd/RCS/elf32-mips.c,v
retrieving revision 1.1
diff -up -r1.1 bfd/elf32-mips.c
--- bfd/elf32-mips.c 2001/06/11 10:04:11 1.1
+++ bfd/elf32-mips.c 2001/07/20 22:45:18
@@ -3047,8 +3047,16 @@ _bfd_mips_elf_fake_sections (abfd, hdr,
/* 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. */
- if ((sec->flags & SEC_RELOC) != 0)
+ 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 (IRIX_COMPAT (abfd) != ict_irix5 && (sec->flags & SEC_RELOC) != 0)
{
struct bfd_elf_section_data *esd;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-07-20 16:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-20 16:57 2.11.2 PATCH: Fix gas to allow GCC 3.0 to bootstrap on mips-sgi-irix5.3 Rainer Orth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).