tinycc-devel
[Top][All Lists]
Advanced

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

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


From: Daniel Glöckner
Subject: Re: [Tinycc-devel] GOT entries and adding elf symbols
Date: Sat, 30 Sep 2017 11:36:37 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hi,

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,

  Daniel



reply via email to

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