[Top][All Lists]

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

Re: [Tinycc-devel] [ RFC] About packing two infos in a long v2

From: robotux
Subject: Re: [Tinycc-devel] [ RFC] About packing two infos in a long v2
Date: Thu, 15 Nov 2012 15:36:51 +0100
User-agent: Roundcube Webmail/0.5.3

On Thu, 15 Nov 2012 15:24:39 +0100, grischka wrote:
To me that fiddling with unused bits looks too hackish even for tinycc.


Also, some place to store additional information with symbols might
be handy anyway.  For example the Windows backend currently abuses
the sym->st_other field to store the export/import attribute.

The problem is that the AttributeDef is not consequently stored
with the symbols.  Instead the sym->r field is abused to store
part of AttributeDef, and nothing is stored when the tcc "Sym"'s
are translated into the "Elf_Sym"'s.

So what about, in TCCState, instead of

    unsigned long *got_offsets;
    int nb_got_offsets;

switching to

    struct {
        unsigned long got_offset;
        unsigned some_attribute:X;

rather unsigned char some_attribute:X; in that case. No need to waste more than a byte.

        <more ...>
    } *symbol_attributes:
   int nb_symbol_attributes;

It's fine for me. I was just concerned about tcc's memory usage. Shall I proceed with the change you describe?

By the way, why is the following code used in fill_got_entry:
offset = get_got_offset(s1, sym_index);
section_reserve(s1->got, offset + PTR_SIZE);
when section_ptr_add(s1->got, PTR_SIZE) would have the same effect?

I think that the effect WOULD be the same only if sym_index were always
greater by one than the previously passed.

Shame on me. My brain didn't read passed the equal sign on the first line…

--- grischka

Tinycc-devel mailing list

reply via email to

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