From 2469b3c58447e98e073ffe7ab6c9627dbbd1aa81 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Wed, 22 Nov 2017 11:20:48 -0800 Subject: Riscv ld-elf/stab failure and fake label cleanup. * as.c: Include write.h. (common_emul_init): Use FAKE_LABEL_NAME. * ecoff.c (add_file, ecoff_directive_end, ecoff_directive_loc): Likewise. (ecoff_build_symbols): Use FAKE_LABEL_CHAR. * expr.c (get_symbol_name): Use FAKE_LABEL_CHAR. Accept only if input_from_string is TRUE. * read.c (input_from_string): New. (read_symbol_name): Use FAKE_LABEL_CHAR. Accept only if input_from_string is TRUE. (temp_ilp): Set input_from_string to TRUE. (restore_ilp): Set input_from_string to FALSE. * read.h (input_from_string): Declare. * symbols.c: Include write.h (S_IS_LOCAL): Check for FAKE_LABEL_CHAR. (symbol_relc_make_sym): Fix comment refering to default fake label string. * write.h (FAKE_LABEL_CHAR): New. * config/tc-riscv.h (FAKE_LABEL_CHAR): Define. * testsuite/gas/all/err-fakelabel.s: New. --- gas/expr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gas/expr.c') diff --git a/gas/expr.c b/gas/expr.c index 6fc707b..fffb7f1 100644 --- a/gas/expr.c +++ b/gas/expr.c @@ -2369,12 +2369,13 @@ get_symbol_name (char ** ilp_return) char c; * ilp_return = input_line_pointer; - /* We accept \001 in a name in case this is being called with a + /* We accept FAKE_LABEL_CHAR in a name in case this is being called with a constructed string. */ - if (is_name_beginner (c = *input_line_pointer++) || c == '\001') + if (is_name_beginner (c = *input_line_pointer++) + || (input_from_string && c == FAKE_LABEL_CHAR)) { while (is_part_of_name (c = *input_line_pointer++) - || c == '\001') + || (input_from_string && c == FAKE_LABEL_CHAR)) ; if (is_name_ender (c)) c = *input_line_pointer++; -- cgit v1.1