Is linkonce underused?
Jim Wilson
wilson@redhat.com
Tue Dec 17 15:40:00 GMT 2002
>Am I misunderstanding something? If not, is there some
>reason we aren't using linkonce for EH and debug
>information?
Probably because it hasn't been contributed yet. Putting EH and debug info
into linkonce sections may require design changes to the EH and debug info,
and could be a substantial amount of work.
There is some support for putting DWARF debug info into linkonce sections
already. This required changes to the DWARF standard, compiler changes,
and debugger changes. This work isn't entirely finished yet. This is
enabled by the -feliminate-dwarf2-dups option. This doesn't do anything for
your small example though. And this is solving a somewhat different problem
than putting debug info for linkonce functions into linkonce sections, but
at least the issue of using linkonce sections for debug info has already been
considered.
There is support in the assembler for putting IA-64 EH info into linkonce
sections. I don't know if anyone has thought about putting the dwarf2 CFI
based EH info into linkonce sections.
If we are going to be putting more stuff in special sections, it would be
nice if we switched from linkonce sections to ELF COMDAT groups. This has
some advantages. COMDAT is part of the ELF standard, and hence more likely
to interoperate with other tools. Also, this allows one to mark groups of
sections as related, so we can put code, data, debug info, and EH info in
a single COMDAT group and keep or discard them as a unit.
Jim
More information about the Gcc
mailing list