diff options
author | Jim Wilson <jimw@sifive.com> | 2017-11-22 11:20:48 -0800 |
---|---|---|
committer | Jim Wilson <jimw@sifive.com> | 2017-11-22 11:20:48 -0800 |
commit | 2469b3c58447e98e073ffe7ab6c9627dbbd1aa81 (patch) | |
tree | 592138d61a0971779b191a8f27ab818bce9f4e76 /gas/symbols.c | |
parent | 2ca23e65f562bd0efa7c483a99b49cc3d5118a58 (diff) | |
download | gdb-2469b3c58447e98e073ffe7ab6c9627dbbd1aa81.zip gdb-2469b3c58447e98e073ffe7ab6c9627dbbd1aa81.tar.gz gdb-2469b3c58447e98e073ffe7ab6c9627dbbd1aa81.tar.bz2 |
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.
Diffstat (limited to 'gas/symbols.c')
-rw-r--r-- | gas/symbols.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gas/symbols.c b/gas/symbols.c index 19a1fa5..19b3dbc 100644 --- a/gas/symbols.c +++ b/gas/symbols.c @@ -25,6 +25,7 @@ #include "obstack.h" /* For "symbols.h" */ #include "subsegs.h" #include "struc-symbol.h" +#include "write.h" /* This is non-zero if symbols are case sensitive, which is the default. */ @@ -2161,6 +2162,9 @@ S_IS_LOCAL (symbolS *s) && ! S_IS_DEBUG (s) && (strchr (name, DOLLAR_LABEL_CHAR) || strchr (name, LOCAL_LABEL_CHAR) +#if FAKE_LABEL_CHAR != DOLLAR_LABEL_CHAR + || strchr (name, FAKE_LABEL_CHAR) +#endif || TC_LABEL_IS_LOCAL (name) || (! flag_keep_locals && (bfd_is_local_label (stdoutput, s->bsym) @@ -3087,7 +3091,7 @@ symbol_relc_make_sym (symbolS * sym) || S_GET_SEGMENT (sym) == absolute_section) return symbol_relc_make_expr (& sym->sy_value); - /* This may be a "fake symbol" L0\001, referring to ".". + /* This may be a "fake symbol", referring to ".". Write out a special null symbol to refer to this position. */ if (! strcmp (S_GET_NAME (sym), FAKE_LABEL_NAME)) return xstrdup ("."); |