diff options
author | Jeff Law <law@redhat.com> | 1994-03-17 21:37:42 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1994-03-17 21:37:42 +0000 |
commit | 49ccc555101b06e8cdca1ca24abbfc745d0735e7 (patch) | |
tree | 10f8e64cabeb6f2ae784d971166b0753226cf7be /gas/config | |
parent | 06459c063e65d7249132696f436d9f3f7cce41b1 (diff) | |
download | gdb-49ccc555101b06e8cdca1ca24abbfc745d0735e7.zip gdb-49ccc555101b06e8cdca1ca24abbfc745d0735e7.tar.gz gdb-49ccc555101b06e8cdca1ca24abbfc745d0735e7.tar.bz2 |
* config/tc-hppa.c (pa_import): Correctly handle importing of an
already defined symbol.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-hppa.c | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c index f87710f..ef1dd71 100644 --- a/gas/config/tc-hppa.c +++ b/gas/config/tc-hppa.c @@ -4758,27 +4758,41 @@ pa_import (unused) name = input_line_pointer; c = get_symbol_end (); - symbol = symbol_find_or_make (name); - p = input_line_pointer; - *p = c; - - if (!is_end_of_statement ()) + symbol = symbol_find (name); + /* Ugh. We might be importing a symbol defined earlier in the file, + in which case all the code below will really screw things up + (set the wrong segment, symbol flags & type, etc). */ + if (symbol == NULL || !S_IS_DEFINED (symbol)) { - input_line_pointer++; - pa_type_args (symbol, 0); + symbol = symbol_find_or_make (name); + p = input_line_pointer; + *p = c; + + if (!is_end_of_statement ()) + { + input_line_pointer++; + pa_type_args (symbol, 0); + } + else + { + /* Sigh. To be compatable with the HP assembler and to help + poorly written assembly code, we assign a type based on + the the current segment. Note only BSF_FUNCTION really + matters, we do not need to set the full SYMBOL_TYPE_* info. */ + if (now_seg == text_section) + symbol->bsym->flags |= BSF_FUNCTION; + + /* If the section is undefined, then the symbol is undefined + Since this is an import, leave the section undefined. */ + S_SET_SEGMENT (symbol, &bfd_und_section); + } } else { - /* Sigh. To be compatable with the HP assembler and to help - poorly written assembly code, we assign a type based on - the the current segment. Note only BSF_FUNCTION really - matters, we do not need to set the full SYMBOL_TYPE_* info here. */ - if (now_seg == text_section) - symbol->bsym->flags |= BSF_FUNCTION; - - /* If the section is undefined, then the symbol is undefined - Since this is an import, leave the section undefined. */ - S_SET_SEGMENT (symbol, &bfd_und_section); + /* The symbol was already defined. Just eat everything up to + the end of the current statement. */ + while (!is_end_of_statement ()) + input_line_pointer++; } demand_empty_rest_of_line (); |