Fix forward asm labels differently
commitd0db21757afc625a6299aec51cbc282f36abb85f
authorMichael Matz <matz@suse.de>
Sun, 19 Nov 2017 02:04:11 +0000 (19 03:04 +0100)
committerMichael Matz <matz@suse.de>
Sun, 19 Nov 2017 02:04:11 +0000 (19 03:04 +0100)
tree3e011185a68d489fd7b0c922a06e309473b200cb
parenta8ece0f2ce3d2c2471fc8ddb7109938ecec333f7
Fix forward asm labels differently

while last change fixed one part of label behaviour (undefined ones
must be global) it again broke a different aspect (forward defs
without .globl must stay local).  This fixes both aspects.
That a label is local instead of global is difficult to test without
resorting to look at the symbol table or using two-file testcases,
so we do without.  In essence the local/global-ness of symbols
should be the same between GAS and TCC for this input:

    .globl glob1
    glob1:
    call glob1

    .globl glob2
    call glob2
    glob2:

    glob3:
    .globl glob3
    call glob3

    glob4:
    call glob4
    .globl glob4

    call glob5
    .globl glob5
    glob5:

    call glob6
    glob6:
    .globl glob6

    locl1:
    call locl1

    call locl2
    locl2:

    unref1:
    unref2:
    .globl unref2
    .globl unref3
    unref3:
    call undef
tccasm.c