mirror of
https://github.com/mirror/tinycc.git
synced 2026-08-22 11:23:27 +08:00
Fix another corner case with C/asm symtable
See testcase (from grischka). If the asm has no .globl, but there's a (non-static) C definition the symbol should be exported, even if the first reference comes from asm.
This commit is contained in:
5
tccasm.c
5
tccasm.c
@@ -422,9 +422,10 @@ ST_FUNC void asm_free_labels(TCCState *st)
|
||||
for(s = st->asm_labels; s != NULL; s = s1) {
|
||||
ElfSym *esym = elfsym(s);
|
||||
s1 = s->prev;
|
||||
/* Possibly update binding and visibility from asm directives. */
|
||||
/* Possibly update binding and visibility from asm directives
|
||||
if the symbol has no C decl (type is VT_VOID).*/
|
||||
s->type.t &= ~VT_EXTERN;
|
||||
if (esym) {
|
||||
if (esym && s->type.t == VT_VOID) {
|
||||
if (!s->a.asmexport && esym->st_shndx != SHN_UNDEF)
|
||||
s->type.t |= VT_STATIC;
|
||||
if (s->a.visibility)
|
||||
|
||||
Reference in New Issue
Block a user