[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] function and variable asm label (was "Get a token from ch
From: |
Thomas Preud'homme |
Subject: |
[Tinycc-devel] function and variable asm label (was "Get a token from char *") |
Date: |
Wed, 9 Feb 2011 00:20:03 +0100 |
User-agent: |
KMail/1.13.5 (Linux/2.6.32-5-686; KDE/4.4.5; i686; ; ) |
Le mardi 08 février 2011 18:03:57, Thomas Preud'homme a écrit :
> Le mardi 08 février 2011 17:51:01, grischka a écrit :
> > Thomas Preud'homme wrote:
> > > The scheme used in my patch is to only use the C token while compiling
> > > and then linking against the asm label at link time.
> >
> > But you want to convert the asm label into a token too (see topic
> > of the mail). Which made me wonder whether that is necessary if it
> > is never used as a token but only as the external linker symbol.
>
> Indeed, I think the use of a token must come from a first approach I had,
> to rename everywhere and then I realize I need to keep the mapping between
> the name in the source and the asm label.
>
> > > Basically everything happen
> > > in external_sym and put_extern_sym2. There is just one line in
> > > external_sym to register the association between asm token and C token,
> > > and then 3 lines added in put_extern_sym2 to use the asm label if it
> > > exist. It may not be the cleaner way to do it, but at least it's a very
> > > short patch.
> >
> > Maybe you can pass the asm label as an extra parameter to put_extern_sym2
> > directly, like
> >
> > put_extern_sym2(sym, NULL, 0, 0, 0, asm_label);
>
> Agreed. I may not have time to make the change tonight finally but I'll
> push the 2 patchs thirsday at worst. Thanks for your remarks.
>
> > --- grischka
>
> Thomas
I've just pushed 2 patches about asm label. The first one [1] merge the two
codes trying to deal with function asm label in a cleaner way, thanks to
advices of grischka. The second one [2] introduce variable asm label. If
anything stop working after this, first please apologize, then send an e-mail
here. Be sure that I would fix it immediately. But it should be ok, I run a
few comparative tests between gcc and tcc to be sure they both handle asm
labels the same way and I also verified that make test run fine.
Best regards,
Thomas Preud'homme
[1] 32a682b88febf983420406a4ec5087d07761a8bc
[2] 11b2d33523d86f915535c2a09b38f3724c4f01cb
signature.asc
Description: This is a digitally signed message part.