aboutsummaryrefslogtreecommitdiff
path: root/gas/config/obj-elf.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2022-04-12 09:04:15 +0200
committerJan Beulich <jbeulich@suse.com>2022-04-12 09:04:15 +0200
commitc39e89c3aaa3a6790f85e80f2da5022bc4bce38b (patch)
tree075b73ce63b3483c6f6a0756479e1d45011040a0 /gas/config/obj-elf.c
parent657edeab3857130ddc005a88104711dd9e339ff0 (diff)
downloadgdb-c39e89c3aaa3a6790f85e80f2da5022bc4bce38b.zip
gdb-c39e89c3aaa3a6790f85e80f2da5022bc4bce38b.tar.gz
gdb-c39e89c3aaa3a6790f85e80f2da5022bc4bce38b.tar.bz2
gas: drop .appfile and .appline
These were used originally to represent "# <line> <file>" constructs inserted by (typically) compilers when pre-processing. Quite some time ago they were replaced by .linefile though. Since the original directives were never documented, we ought to be able to remove support for them. As a result in a number of case function parameter aren't used anymore and can hence be dropped.
Diffstat (limited to 'gas/config/obj-elf.c')
-rw-r--r--gas/config/obj-elf.c48
1 files changed, 19 insertions, 29 deletions
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index b218ff6..c02d26b 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -258,46 +258,36 @@ elf_sec_sym_ok_for_reloc (asection *sec)
}
void
-elf_file_symbol (const char *s, int appfile)
+elf_file_symbol (const char *s)
{
asymbol *bsym;
+ symbolS *sym = symbol_new (s, absolute_section, &zero_address_frag, 0);
+ size_t name_length = strlen (s);
- if (!appfile
- || symbol_rootP == NULL
- || (bsym = symbol_get_bfdsym (symbol_rootP)) == NULL
- || (bsym->flags & BSF_FILE) == 0)
+ if (name_length > strlen (S_GET_NAME (sym)))
{
- symbolS *sym;
- size_t name_length;
-
- sym = symbol_new (s, absolute_section, &zero_address_frag, 0);
-
- name_length = strlen (s);
- if (name_length > strlen (S_GET_NAME (sym)))
- {
- obstack_grow (&notes, s, name_length + 1);
- S_SET_NAME (sym, (const char *) obstack_finish (&notes));
- }
- else
- strcpy ((char *) S_GET_NAME (sym), s);
+ obstack_grow (&notes, s, name_length + 1);
+ S_SET_NAME (sym, (const char *) obstack_finish (&notes));
+ }
+ else
+ strcpy ((char *) S_GET_NAME (sym), s);
- symbol_get_bfdsym (sym)->flags |= BSF_FILE;
+ symbol_get_bfdsym (sym)->flags |= BSF_FILE;
- if (symbol_rootP != sym
- && ((bsym = symbol_get_bfdsym (symbol_rootP)) == NULL
- || (bsym->flags & BSF_FILE) == 0))
- {
- symbol_remove (sym, &symbol_rootP, &symbol_lastP);
- symbol_insert (sym, symbol_rootP, &symbol_rootP, &symbol_lastP);
- }
+ if (symbol_rootP != sym
+ && ((bsym = symbol_get_bfdsym (symbol_rootP)) == NULL
+ || (bsym->flags & BSF_FILE) == 0))
+ {
+ symbol_remove (sym, &symbol_rootP, &symbol_lastP);
+ symbol_insert (sym, symbol_rootP, &symbol_rootP, &symbol_lastP);
+ }
#ifdef DEBUG
- verify_symbol_chain (symbol_rootP, symbol_lastP);
+ verify_symbol_chain (symbol_rootP, symbol_lastP);
#endif
- }
#ifdef NEED_ECOFF_DEBUG
- ecoff_new_file (s, appfile);
+ ecoff_new_file (s);
#endif
}