diff options
| author | Michael Matz <matz@suse.de> | 2017-11-25 19:41:03 +0100 |
|---|---|---|
| committer | Michael Matz <matz@suse.de> | 2017-11-25 19:41:03 +0100 |
| commit | 4266ebd69c2c7d12abee1da1f6c2228232c6bc87 (patch) | |
| tree | 2dc94bdf42516b13083b64e3eeb31f146d1ee4ee /tccasm.c | |
| parent | e7c71e24730ae07241980812c8b747963f216260 (diff) | |
| download | tinycc-4266ebd69c2c7d12abee1da1f6c2228232c6bc87.tar.gz tinycc-4266ebd69c2c7d12abee1da1f6c2228232c6bc87.tar.bz2 | |
tccasm: Don't abuse dllexport/dllimport
For tracking if asm symbols are connected with a C symbol,
and if asm symbols need to be global use new flags, instead of
reusing dllimport/dllexport, which would cause unrequested exported
entries on Windows.
This is a stop-gap until the C and asm symtable are unified.
Diffstat (limited to 'tccasm.c')
| -rw-r--r-- | tccasm.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -91,8 +91,8 @@ ST_FUNC Sym* get_asm_sym(int name, Sym *csym) /* XXX can't yet store st_size anywhere. */ sym->type.t = VT_VOID | (csym->type.t & VT_STATIC); /* Mark that this asm symbol doesn't need to be fed back. */ - sym->a.dllimport = 1; - sym->a.dllexport = !(csym->type.t & VT_STATIC); + sym->a.asmcsym = 1; + sym->a.asmexport = !(csym->type.t & VT_STATIC); } } return sym; @@ -454,11 +454,11 @@ ST_FUNC void asm_free_labels(TCCState *st) /* define symbol value in object file and care for updating the C and asm symbols */ s->type.t &= ~VT_EXTERN; - if (!s->a.dllimport) { + if (!s->a.asmcsym) { Sym *csym = sym_find(s->v); ElfW(Sym) *esym = NULL; if (csym) { - s->a.dllexport |= !(csym->type.t & VT_STATIC); + s->a.asmexport |= !(csym->type.t & VT_STATIC); if (csym->c) { esym = &((ElfW(Sym) *)symtab_section->data)[csym->c]; if (s->c) { @@ -473,7 +473,7 @@ ST_FUNC void asm_free_labels(TCCState *st) } } } - if (!s->a.dllexport) + if (!s->a.asmexport) s->type.t |= VT_STATIC; if (s->r) { if (s->r == SHN_ABS) @@ -485,7 +485,7 @@ ST_FUNC void asm_free_labels(TCCState *st) if (!esym || esym->st_shndx == SHN_UNDEF || !was_ext) put_extern_sym2(s, sec, s->jnext, 0, 0); } else /* undefined symbols are global */ - s->type.t &= ~VT_STATIC, s->a.dllexport = 1; + s->type.t &= ~VT_STATIC, s->a.asmexport = 1; patch_binding(s); } /* remove label */ @@ -750,7 +750,7 @@ static void asm_parse_directive(TCCState *s1, int global) next(); sym = get_asm_sym(tok, NULL); if (tok1 != TOK_ASMDIR_hidden) - sym->type.t &= ~VT_STATIC, sym->a.dllexport = 1; + sym->type.t &= ~VT_STATIC, sym->a.asmexport = 1; if (tok1 == TOK_ASMDIR_weak) sym->a.weak = 1; else if (tok1 == TOK_ASMDIR_hidden) |
