MIPS: don't use get_symbol_name() for section parsing. With s_change_section() later calling obj_elf_section(), it seems better to pre-parse the section name by the same function that will be used there. This way no differences in what is accepted will result.
gas * config/tc-mips.c (s_change_section): Use obj_elf_section_name to
parse the section name.
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 9d6ecf3..a19515a 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -2,6 +2,7 @@
* config/tc-ia64.c (cross_section): Use obj_elf_section_name to
parse the section name.
+ * config/tc-mips.c (s_change_section): Likewise.
2021-09-02 Nick Clifton <nickc@redhat.com>
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 0201f81..dfe84c1 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -16371,33 +16371,29 @@
s_change_section (int ignore ATTRIBUTE_UNUSED)
{
char *saved_ilp;
- char *section_name;
- char c, endc;
- char next_c = 0;
+ const char *section_name;
+ char c, next_c = 0;
int section_type;
int section_flag;
int section_entry_size;
int section_alignment;
saved_ilp = input_line_pointer;
- endc = get_symbol_name (§ion_name);
- c = (endc == '"' ? input_line_pointer[1] : endc);
+ section_name = obj_elf_section_name ();
+ if (section_name == NULL)
+ return;
+ c = input_line_pointer[0];
if (c)
- next_c = input_line_pointer [(endc == '"' ? 2 : 1)];
+ next_c = input_line_pointer[1];
/* Do we have .section Name<,"flags">? */
if (c != ',' || (c == ',' && next_c == '"'))
{
- /* Just after name is now '\0'. */
- (void) restore_line_pointer (endc);
input_line_pointer = saved_ilp;
obj_elf_section (ignore);
return;
}
- section_name = xstrdup (section_name);
- c = restore_line_pointer (endc);
-
input_line_pointer++;
/* Do we have .section Name<,type><,flag><,entry_size><,alignment> */
@@ -16442,9 +16438,6 @@
obj_elf_change_section (section_name, section_type, section_flag,
section_entry_size, 0, 0, 0);
-
- if (now_seg->name != section_name)
- free (section_name);
}
void