On Fri, Feb 17, 2012 at 11:41:03AM -0700, Sandra Loosemore wrote:
The slight wrinkle in this scheme is that the ELF specification
defines COMDAT groups as an attribute of relocatable files only, not
shared objects. So we cannot say definitely that a shared object
provides a named COMDAT group. The expedient hack I've adopted is
to consider that a shared library provides a COMDAT group if it
provides weak definitions for all symbols defined in sections that
make up the group.
I wondered how robust this will prove to be.
[snip]
That's rather a lot of missing symbols. I think for this to work you
need another linker option to export all global symbols defined in
comdat sections.
Then, given that you will need to build shared
libraries differently, it would be a much better idea to mark them as
supporting shared-comdat, perhaps by exporting each comdat signature
symbol. If you did that, you could probably dispense with all the
code you've written to match symbols..