Fix fct asm label: only valid for declaration
- Fix function assembly label mechanism introduced in commit9b09fc376eto only accept alternative name for function declaration. - merge the code with the one introduced in commit264a103610. - Don't memorize token for asm label but directly the asm label.
This commit is contained in:
8
libtcc.c
8
libtcc.c
@ -436,10 +436,7 @@ ST_FUNC void put_extern_sym2(Sym *sym, Section *section,
|
||||
}
|
||||
|
||||
if (!sym->c) {
|
||||
if (sym->a)
|
||||
name = get_tok_str(sym->a, NULL);
|
||||
else
|
||||
name = get_tok_str(sym->v, NULL);
|
||||
name = get_tok_str(sym->v, NULL);
|
||||
#ifdef CONFIG_TCC_BCHECK
|
||||
if (tcc_state->do_bounds_check) {
|
||||
char buf[32];
|
||||
@ -496,6 +493,9 @@ ST_FUNC void put_extern_sym2(Sym *sym, Section *section,
|
||||
pstrcpy(buf1 + 1, sizeof(buf1) - 1, name);
|
||||
name = buf1;
|
||||
}
|
||||
if (sym->asm_label) {
|
||||
name = sym->asm_label;
|
||||
}
|
||||
info = ELFW(ST_INFO)(sym_bind, sym_type);
|
||||
sym->c = add_elf_sym(symtab_section, value, size, info, other, sh_num, name);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user