[Top][All Lists]

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

Re: [Tinycc-devel] GOT entries and adding elf symbols

From: Charles Lohr
Subject: Re: [Tinycc-devel] GOT entries and adding elf symbols
Date: Sat, 30 Sep 2017 10:25:51 -0400

Thank you! That makes a lot of sense!  I think I can handle that much more elegantly now.

I have a ton of oddities happening in my _javascript_-link.c, now, but that's something I can work through!

On Sat, Sep 30, 2017 at 5:36 AM, Daniel Glöckner <address@hidden> wrote:

On Fri, Sep 29, 2017 at 09:25:49PM -0400, Charles Lohr wrote:
> I'm not sure how to tell the elf engine where functions begin+end, or how
> to tell it about other important symbols. I don't see anything in the
> existing *_gen.c files that would indicate how this is done.

See gen_function in tccgen.c.
There is a put_extern_sym that associates the current position in the
text section with the name of the function. The size of the function
in the symbol is changed after gfunc_epilog has been called.

> Additionally, since I'm not outputting any, the elf engine just crashes
> because s1->got->reloc is null in "for_each_elem(s1->got->reloc, 0, rel,
> ElfW_Rel)"  is that a bug?

Well, s1->got->reloc is allocated in the first call to put_elf_reloca.
One could change the definition of for_each_elem to check if elem is
NULL before each iteration.

For your other questions I don't know the answer.

Best regards,


Tinycc-devel mailing list

reply via email to

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