From 116bf30f41acfe59b86e585c6110db6e2c37b05f Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 24 Apr 1996 15:30:56 +0000 Subject: * config/obj-coff.c (obj_coff_section): BFD_ASSEMBLER version: call demand_empty_rest_of_line. Non BFD_ASSEMBLER version: correct handling of input line pointer, and call demand_empty_rest_of_line. PR 9525. --- gas/config/obj-coff.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'gas/config/obj-coff.c') diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index 9ad0f6be589..087e250ffa6 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -1239,6 +1239,8 @@ obj_coff_section (ignore) bfd_section_name (stdoutput, sec), bfd_errmsg (bfd_get_error ())); } + + demand_empty_rest_of_line (); } void @@ -3285,11 +3287,8 @@ obj_coff_section (ignore) int ignore; { /* Strip out the section name */ - char *section_name; - char *section_name_end; + char *section_name, *name; char c; - int argp; - unsigned int len; unsigned int exp; long flags; @@ -3310,26 +3309,21 @@ obj_coff_section (ignore) section_name = input_line_pointer; c = get_symbol_end (); - section_name_end = input_line_pointer; - len = section_name_end - section_name; - input_line_pointer++; - SKIP_WHITESPACE (); + name = xmalloc (input_line_pointer - section_name + 1); + strcpy (name, section_name); - argp = 0; - if (c == ',') - argp = 1; - else if (*input_line_pointer == ',') - { - argp = 1; - ++input_line_pointer; - SKIP_WHITESPACE (); - } + *input_line_pointer = c; exp = 0; flags = 0; - if (argp) + + SKIP_WHITESPACE (); + if (*input_line_pointer == ',') { + ++input_line_pointer; + SKIP_WHITESPACE (); + if (*input_line_pointer != '"') exp = get_absolute_expression (); else @@ -3360,11 +3354,11 @@ obj_coff_section (ignore) } } - subseg_new (section_name, (subsegT) exp); + subseg_new (name, (subsegT) exp); segment_info[now_seg].scnhdr.s_flags |= flags; - *section_name_end = c; + demand_empty_rest_of_line (); } -- cgit v1.2.1