diff --git a/tccgen.c b/tccgen.c index 136e4b80..84b9420c 100644 --- a/tccgen.c +++ b/tccgen.c @@ -8472,7 +8472,7 @@ found: if (!esym) tcc_error("unsupported forward __alias__ attribute"); put_extern_sym2(sym, esym->st_shndx, - esym->st_value, esym->st_size, 0); + esym->st_value, esym->st_size, 1); } } else { if (type.t & VT_STATIC) diff --git a/tests/tests2/120_alias.c b/tests/tests2/120_alias.c index c9eb2985..5bead0f5 100644 --- a/tests/tests2/120_alias.c +++ b/tests/tests2/120_alias.c @@ -6,7 +6,11 @@ void target(void) { } void alias_for_target(void) __attribute__((alias("target"))); +#ifdef __leading_underscore +void asm_for_target(void) __asm__("_target"); +#else void asm_for_target(void) __asm__("target"); +#endif /* This is not supposed to compile, alias targets must be defined in the same unit. In TCC they even must be defined before the reference