Re: linker debug info editing

Jim Blandy
2006-03-11T01:44:59Z

After you've chosen dies to delete, how do you deal with other dies
that refer to the deleted dies? I'm not talking about parents; I'm
talking about attributes whose form is DW_FORM_ref*.

I think the information we need to do this reduction correctly isn't
available at the level you're working at. linkonce sections aren't
really deleted; they're unified. The data in them doesn't go away;
equivalent data from elsewhere is used instead.

I tend to think that having the compiler divide the information into
separate compilation units, as Jim suggests, is the only way to go
here. In that scenario, inter-CU references will use symbols to refer
to their targets; after choosing which instance of the linkonce
section to keep, you should still have definitions for all the symbols
the other dies' relocs refer to.

As Daniel says, the GDB-related reasons for avoiding this solution are
long gone.