aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2007-10-11 20:20:55 +0000
committerNick Clifton <nickc@redhat.com>2007-10-11 20:20:55 +0000
commit6f932bce808ba923bf40bf6f78f4c9d1da6e5c16 (patch)
tree67fb914f3d998e9ffff18f2110e2f1a4e9519fb5 /gas
parentb4c291bb6d7cef9849c487f5d9f717a49eed996d (diff)
downloadfsf-binutils-gdb-6f932bce808ba923bf40bf6f78f4c9d1da6e5c16.zip
fsf-binutils-gdb-6f932bce808ba923bf40bf6f78f4c9d1da6e5c16.tar.gz
fsf-binutils-gdb-6f932bce808ba923bf40bf6f78f4c9d1da6e5c16.tar.bz2
* config/obj-elf.c (obj_elf_section): When pushing a section, if there is a
comma then the following argument must be a subsection number. * testsuite/gas/elf/elf.exp (run_elf_list_test): Run section6 test. * testsuite/gas/elf/section6.s: New file: Check behaviour of .pushsection with a subsection argument. * testsuite/gas/elf/section6.d: New file: Expected disassembly.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/obj-elf.c12
-rw-r--r--gas/testsuite/ChangeLog7
-rw-r--r--gas/testsuite/gas/elf/elf.exp3
-rw-r--r--gas/testsuite/gas/elf/section6.d13
-rw-r--r--gas/testsuite/gas/elf/section6.s10
6 files changed, 48 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 292cb1e..26bcf58 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2007-10-11 Nick Clifton <nickc@redhat.com>
+
+ * config/obj-elf.c (obj_elf_section): When pushing a section, if
+ there is a comma then the following argument must be a subsection
+ number.
+
2007-10-11 H.J. Lu <hongjiu.lu@intel.com>
* doc/c-i386.texi: Update which instruction's operands are
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 57f11af..429b32f 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -883,6 +883,7 @@ obj_elf_section (int push)
int type, attr, dummy;
int entsize;
int linkonce;
+ subsegT new_subsection = -1;
#ifndef TC_I370
if (flag_mri)
@@ -921,7 +922,11 @@ obj_elf_section (int push)
++input_line_pointer;
SKIP_WHITESPACE ();
- if (*input_line_pointer == '"')
+ if (push)
+ {
+ new_subsection = (subsegT) get_absolute_expression ();
+ }
+ else if (*input_line_pointer == '"')
{
beg = demand_copy_C_string (&dummy);
if (beg == NULL)
@@ -1030,6 +1035,9 @@ obj_elf_section (int push)
demand_empty_rest_of_line ();
obj_elf_change_section (name, type, attr, entsize, group_name, linkonce, push);
+
+ if (push && new_subsection != -1)
+ subseg_set (now_seg, new_subsection);
}
/* Change to the .data section. */
@@ -1089,7 +1097,7 @@ obj_elf_struct (int i)
static void
obj_elf_subsection (int ignore ATTRIBUTE_UNUSED)
{
- register int temp;
+ int temp;
#ifdef md_flush_pending_output
md_flush_pending_output ();
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 5e6d26b..1acc54c 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2007-10-11 Nick Clifton <nickc@redhat.com>
+
+ * gas/elf/elf.exp (run_elf_list_test): Run section6 test.
+ * gas/elf/section6.s: New file: Check behaviour of .pushsection
+ with a subsection argument.
+ * gas/elf/section6.d: New file: Expected disassembly.
+
2007-10-08 H.J. Lu <hongjiu.lu@intel.com>
* gas/i386/i386.exp: Run simd-suffix and x86-64-simd-suffix.
diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp
index 8b7833f..1bcb101 100644
--- a/gas/testsuite/gas/elf/elf.exp
+++ b/gas/testsuite/gas/elf/elf.exp
@@ -102,5 +102,6 @@ if { ([istarget "*-*-*elf*"]
run_elf_list_test "section5" "" "-al" "-SW" "| grep \" \\\\.test\\\[0-9\\\]\""
run_dump_test "struct"
run_dump_test "symver"
- run_elf_list_test "type" "" "" "-s" "| grep \"1 \\\[FONT\\\]\""
+ run_elf_list_test "type" "" "" "-s" "| grep \"1 \\\[FONTC\\\]\""
+ run_dump_test "section6"
}
diff --git a/gas/testsuite/gas/elf/section6.d b/gas/testsuite/gas/elf/section6.d
new file mode 100644
index 0000000..e8e0a66
--- /dev/null
+++ b/gas/testsuite/gas/elf/section6.d
@@ -0,0 +1,13 @@
+#objdump: -s
+#name: elf section6
+
+.*: +file format .*
+
+# The MIPS includes a 'section .reginfo' and such here.
+#...
+Contents of section sec1:
+ 0+000 01 ?02 ?05.*
+Contents of section sec2:
+ 0+000 04 ?03.*
+# Arm includes a .ARM.attributes section here
+#...
diff --git a/gas/testsuite/gas/elf/section6.s b/gas/testsuite/gas/elf/section6.s
new file mode 100644
index 0000000..f978434
--- /dev/null
+++ b/gas/testsuite/gas/elf/section6.s
@@ -0,0 +1,10 @@
+ .section sec1
+ .byte 1
+ .subsection 2
+ .byte 2
+ .pushsection sec2,1
+ .byte 3
+ .subsection 0
+ .byte 4
+ .popsection
+ .byte 5