aboutsummaryrefslogtreecommitdiff
path: root/gas/config/obj-elf.c
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/config/obj-elf.c
parentb4c291bb6d7cef9849c487f5d9f717a49eed996d (diff)
downloadgdb-6f932bce808ba923bf40bf6f78f4c9d1da6e5c16.zip
gdb-6f932bce808ba923bf40bf6f78f4c9d1da6e5c16.tar.gz
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/config/obj-elf.c')
-rw-r--r--gas/config/obj-elf.c12
1 files changed, 10 insertions, 2 deletions
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 ();