Is Windows-style symbol resolvation possible

Jussi Pakkanen jpakkane@gmail.com
Mon Jun 16 15:18:00 GMT 2008


Hi

I'm working on porting the Cuneiform OCR system to Linux. The code is
available here:
https://code.launchpad.net/~jpakkane/+junk/cuneiform-linux

The original code was in several different DLL's, which build as .so's
in Linux. Many of these DLL's contain symbols with identical names.
Due to ELF symbol interposing these all get aliased to the same symbol
causing errors. I have tested the code on OSX, and it works fine. Is
it possible somehow to make ld resolve the symbols the same way as OSX
and Windows do it?

Google searches gave me the following choices:

Michael Meeks' -Bdirect patch seems to do what I need, but it was
rejected and thus nonexistant.

Use --warn-common and rename the duplicates by hand. This would work,
but there are dozens or maybe hundreds of these, so I'd rather not.

To make things more difficult, I can't just set symbol visibility to
hidden, since those symbols that need to be exported are not marked in
any way, so I would have to add visibility macros by hand, which is
probably even more work than removing duplicate symbols.

Any help would be appreciated. Thanks.



More information about the Binutils mailing list