compiling .c file:
void main(){}
results in .s file:
...
_main_start::
_main:
ret
_main_end::
...
The entry label for main() is followed by ':' but should be followed by '::' to indicate a global label.
With sdas this does not harm, but an alternate assembler (e.g. my zasm) could just ignore the .globl pseudo opcode (which tells the linker that it's global) and rely on the ':' or '::' respectively for label resolution, if they were correct. Currently i added some not-so-sane code to handle this in zasm. :/
What about keeping the .globl pseudo opcode, while emitting "::" for global functions and ":" for static ones?
Something like changing line 4391@z80/gen.c
from
emit2 ("!functionlabeldef", sym->rname);
to
if (!IS_STATIC (sym->etype))
emit2 ("!functionlabeldef_global", sym->rname);
else
emit2 ("!functionlabeldef", sym->rname);
I guess this depends on the other assembler supporting :: for global labels. Is this a common concept?
If not common, I vote for rejecting this ticket.
Fixed in reversion #9205 by adding a "globalfunctionlabeldef". I thought,
thats nice and thanks for that. :)
i'll test the new version when i'm back on zasm.