aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2003-12-18 10:18:17 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2003-12-18 10:18:17 +0000
commit8ab8a5c8883d632c9187b1dada22ec10b6109798 (patch)
tree04c1a13509646b81a515d70420e9c176cbea693b /gas
parenteb4bbda805648bd95b91273ef502752a2c93c870 (diff)
downloadgdb-8ab8a5c8883d632c9187b1dada22ec10b6109798.zip
gdb-8ab8a5c8883d632c9187b1dada22ec10b6109798.tar.gz
gdb-8ab8a5c8883d632c9187b1dada22ec10b6109798.tar.bz2
* config/tc-mips.c (s_change_section): When parsing the MIPS-specific
.section syntax, map SHT_MIPS_DWARF to SHT_PROGBITS.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-mips.c16
2 files changed, 21 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 2ee1c91..aec39cc 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2003-12-18 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/tc-mips.c (s_change_section): When parsing the MIPS-specific
+ .section syntax, map SHT_MIPS_DWARF to SHT_PROGBITS.
+
2003-12-17 Mark Mitchell <mark@codesourcery.com>
* config/tc-arm.c (arm_archs): Change "armv6" to "armv6j".
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index d60e75f..e6997ca 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -11981,6 +11981,22 @@ s_change_section (int ignore ATTRIBUTE_UNUSED)
section_name = xstrdup (section_name);
+ /* When using the generic form of .section (as implemented by obj-elf.c),
+ there's no way to set the section type to SHT_MIPS_DWARF. Users have
+ traditionally had to fall back on the more common @progbits instead.
+
+ There's nothing really harmful in this, since bfd will correct
+ SHT_PROGBITS to SHT_MIPS_DWARF before writing out the file. But it
+ means that, for backwards compatibiltiy, the special_section entries
+ for dwarf sections must use SHT_PROGBITS rather than SHT_MIPS_DWARF.
+
+ Even so, we shouldn't force users of the MIPS .section syntax to
+ incorrectly label the sections as SHT_PROGBITS. The best compromise
+ seems to be to map SHT_MIPS_DWARF to SHT_PROGBITS before calling the
+ generic type-checking code. */
+ if (section_type == SHT_MIPS_DWARF)
+ section_type = SHT_PROGBITS;
+
obj_elf_change_section (section_name, section_type, section_flag,
section_entry_size, 0, 0, 0);