Re: [patch] Do not add partial_symbol again and again to the list

Aleksandar Ristovski
2008-02-12T05:35:10Z

> On Mon, Feb 11, 2008 at 08:07:55PM -0500, Aleksandar Ristovski wrote:
>> struct dwarf2_cu has a pointer to struct objfile, which (if I'm not
>> mistaken) get's allocated per compilation unit.
>
> That's where your confusion is. An objfile is something like
> "/lib/libc.so.6", a linked file. A compilation unit is something
> like "init.o", a single "gcc -c" output.

Ahhh.... Thank you. I did get confused with the name.

However, I think the patch is still good.

What happens with the patch is that for an objfile, we will add global type
information only once, in the first partial symbol table where the symbol was
encountered. I think this will be fine. Type info will not have address
associated and all information we can get about it will be there. Finding the
first matching partial symbol for a type symbol is as good as finding the second
or N-th partial symbol for that type (and domain).

On the other hand, for anything that is linked, i.e. has an address, the
partial_symbol must be unique (linker should make sure of that: mangled name,
etc...) and my patch will not affect adding such symbols.