aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2002-02-09 04:40:18 +0000
committerEric Christopher <echristo@gmail.com>2002-02-09 04:40:18 +0000
commit027d73eb18a14046d4009e7eea9241837a93b584 (patch)
tree9f1ae757a0a47b1ed02ae69623fb005a64076f6a
parente8b872bb0236340391db998ad4459327e4cf9d55 (diff)
downloadgdb-027d73eb18a14046d4009e7eea9241837a93b584.zip
gdb-027d73eb18a14046d4009e7eea9241837a93b584.tar.gz
gdb-027d73eb18a14046d4009e7eea9241837a93b584.tar.bz2
2002-02-08 Eric Christopher <echristo@redhat.com>
From Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> * elf32-mips.c (_bfd_mips_elf_fake_sections): Don't create .rela sections for the O32 ABI.
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf32-mips.c12
2 files changed, 17 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index af6ac67..750fea1 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2002-02-08 Eric Christopher <echristo@redhat.com>
+
+ From Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * elf32-mips.c (_bfd_mips_elf_fake_sections): Don't create .rela
+ sections for the O32 ABI.
+
2002-02-08 Chris Demetriou <cgd@broadcom.com>
* elf32-arm.h: Fix formatting of _("...").
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 6cddbb3..73eba75 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -3583,8 +3583,16 @@ _bfd_mips_elf_fake_sections (abfd, hdr, sec)
/* 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;
bfd_size_type amt = sizeof (Elf_Internal_Shdr);