summaryrefslogtreecommitdiff
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
commit46031934c24c1cfb13bb03f3039cfd15f0d460e5 (patch)
treeb6213e0dc3956aaf881b605495f1bbc8de65f354 /gas/config/obj-elf.c
parentca60d3c74bdcaf9a06223e6313b809d29ae19b24 (diff)
downloadbinutils-redhat-46031934c24c1cfb13bb03f3039cfd15f0d460e5.tar.gz
* 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 57f11af8e4..429b32faca 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 ();