B
Bernd Geiser
Recently I tried the following:
I created two libraries lib1.a and lib2.a. Both contain the object a.o which
instantiates a class from b1.o (or b2.o respectively), where b1.o and b2.o
have the same interface (header) and thus the symbol names are identical.
In order to be able to link lib1.a and lib2.a with main.cpp I tried to
localize the duplicated symbols (with GNU objcopy) and partially linked a.o
with b1.o and a.o with b2.o. This didn't work though.... somehow linking
both libs with the main-file eliminated b2.o's symbols.
So I tried to strip the localized symbols from the partially linked objects
before packing them into the lib but this didn't work, too... for some
reason objcopy complains that they are still required. What is going wrong?
Localizing the symbols and resolving them by partial linkage should make a
strip possible, or am I missing sth.?
I hope I made myself clear enough. Any ideas how to get this working? b1.o
and b2.o definitely need the same interface.
Thanks,
Bernd
I created two libraries lib1.a and lib2.a. Both contain the object a.o which
instantiates a class from b1.o (or b2.o respectively), where b1.o and b2.o
have the same interface (header) and thus the symbol names are identical.
In order to be able to link lib1.a and lib2.a with main.cpp I tried to
localize the duplicated symbols (with GNU objcopy) and partially linked a.o
with b1.o and a.o with b2.o. This didn't work though.... somehow linking
both libs with the main-file eliminated b2.o's symbols.
So I tried to strip the localized symbols from the partially linked objects
before packing them into the lib but this didn't work, too... for some
reason objcopy complains that they are still required. What is going wrong?
Localizing the symbols and resolving them by partial linkage should make a
strip possible, or am I missing sth.?
I hope I made myself clear enough. Any ideas how to get this working? b1.o
and b2.o definitely need the same interface.
Thanks,
Bernd