tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Unify C and asm symbols


From: Michael Matz
Subject: Re: [Tinycc-devel] Unify C and asm symbols
Date: Mon, 4 Dec 2017 04:04:41 +0100 (CET)
User-agent: Alpine 2.20 (LSU 67 2015-01-07)



On Tue, 28 Nov 2017, grischka wrote:

I like it. More lines removed than added could mean that it is going in the right direction anyway ;)

Hehe :)

Question:  I wonder whether now we could maybe get rid of the asm label
"post-processing" (asm_free_labels) and the asm_label stack altogether?

That requires surgery in how linking is done (in a sense moving that post-processing from asm symbols from compilation to linking time). I believe this ultimately will be good anyway, as there are currently various strangenesses and corner cases that are buggy especially involving multi-file compilation (i.e. without intermediate .o files), or multi-file -run. I think I'll work on that somewhen the next days, but it'll be a bit hairy and potentially disruptive, so the release doesn't have to wait. In the meantime ...

Seen that it can be counter-productive too, as with for example:
...
$ tcc -c t1.c t2.c && tcc t1.o t2.o -o t.exe && t.exe
tcc: error: undefined symbol 'x5'

$ tcc -c t1.c && objdump -x t1.o
   SYMBOL TABLE:
   00000000 l    df *ABS*       00000000 t1.c
   0000004a l       .text       0000001f x5

Here 'x5' should have the g[lobal] binding from C.

... I have fixed this in mob with a one-liner instead :)


Ciao,
Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]