aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2005-04-05 07:35:12 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2005-04-05 07:35:12 +0000
commitcc2e31b90bb42020f386d54a45be301bb3a8fc7d (patch)
tree4e69d3217f0be1fa3b46f3781e2890c122dfe969 /bfd
parent8236346f4669711b5fcff0f02a2e0d1d37983ff3 (diff)
downloadgdb-cc2e31b90bb42020f386d54a45be301bb3a8fc7d.zip
gdb-cc2e31b90bb42020f386d54a45be301bb3a8fc7d.tar.gz
gdb-cc2e31b90bb42020f386d54a45be301bb3a8fc7d.tar.bz2
* elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME_P): New macro.
(_bfd_mips_elf_section_from_shdr): Use it to check for recognized SHT_MIPS_OPTIONS names. Allow all sections with unrecognised section flags. (_bfd_mips_elf_fake_sections): Use MIPS_ELF_OPTIONS_SECTION_NAME_P to check for SHT_MIPS_OPTIONS sections. (_bfd_mips_elf_set_section_contents): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog10
-rw-r--r--bfd/elfxx-mips.c13
2 files changed, 19 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 86401c8..d64d02c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,13 @@
+2005-04-05 Richard Sandiford <rsandifo@redhat.com>
+
+ * elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME_P): New macro.
+ (_bfd_mips_elf_section_from_shdr): Use it to check for recognized
+ SHT_MIPS_OPTIONS names. Allow all sections with unrecognised
+ section flags.
+ (_bfd_mips_elf_fake_sections): Use MIPS_ELF_OPTIONS_SECTION_NAME_P
+ to check for SHT_MIPS_OPTIONS sections.
+ (_bfd_mips_elf_set_section_contents): Likewise.
+
2005-04-04 Eric Christopher <echristo@redhat.com>
* elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents):
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 9aae75f..baf4dc9 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -478,6 +478,11 @@ static bfd *reldyn_sorting_bfd;
#define MIPS_ELF_OPTIONS_SECTION_NAME(abfd) \
(NEWABI_P (abfd) ? ".MIPS.options" : ".options")
+/* True if NAME is the recognized name of any SHT_MIPS_OPTIONS section.
+ Some IRIX system files do not use MIPS_ELF_OPTIONS_SECTION_NAME. */
+#define MIPS_ELF_OPTIONS_SECTION_NAME_P(NAME) \
+ (strcmp (NAME, ".MIPS.options") == 0 || strcmp (NAME, ".options") == 0)
+
/* The name of the stub section. */
#define MIPS_ELF_STUB_SECTION_NAME(abfd) ".MIPS.stubs"
@@ -5122,7 +5127,7 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd,
return FALSE;
break;
case SHT_MIPS_OPTIONS:
- if (strcmp (name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) != 0)
+ if (!MIPS_ELF_OPTIONS_SECTION_NAME_P (name))
return FALSE;
break;
case SHT_MIPS_DWARF:
@@ -5140,7 +5145,7 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd,
return FALSE;
break;
default:
- return FALSE;
+ break;
}
if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex))
@@ -5310,7 +5315,7 @@ _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec)
hdr->sh_flags |= SHF_MIPS_NOSTRIP;
/* The sh_info field is set in final_write_processing. */
}
- else if (strcmp (name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) == 0)
+ else if (MIPS_ELF_OPTIONS_SECTION_NAME_P (name))
{
hdr->sh_type = SHT_MIPS_OPTIONS;
hdr->sh_entsize = 1;
@@ -8631,7 +8636,7 @@ _bfd_mips_elf_set_section_contents (bfd *abfd, sec_ptr section,
const void *location,
file_ptr offset, bfd_size_type count)
{
- if (strcmp (section->name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) == 0)
+ if (MIPS_ELF_OPTIONS_SECTION_NAME_P (section->name))
{
bfd_byte *c;