[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: need help with Linux shared objects
- From: Gaspard Bucher <gaspard@...>
- Date: Sun, 20 Mar 2011 22:10:00 +0100
Hi list !
I am working on the Linux port of Lubyk and am stuck with some differences between OS X and Linux regarding symbols in shared objects:
I have two shared objects "core.so" and "thread.so". The "core.so" library defines "lubyk::Thread" (C++ wrapper around POSIX threads). The "thread.so" library defines "lk::Thread" (C++ class to be used with Lua).
On OS X, everything works fine as long as "core.so" is loaded before "thread.so" but on Linux, the lua crashes with undefined symbols.
By looking at the symbol map, the missing symbol corresponds to the typeinfo for "lubyk::Thread" which is defined as:
========== OS X
=== core.so
S __ZTIN5lubyk6ThreadE
=== thread.so
U __ZTIN5lubyk6ThreadE
========== Linux (Ubuntu 10.10)
=== core.so
V _ZTIN5lubyk6ThreadE
=== thread.so
U _ZTIN5lubyk6ThreadE
From the man pages of "nm", the "V" stands for "weak object" but I have no clue as of why it is marked as such on Linux (the source code can be found here: [1]).
Any help would be greatly appreciated...
Gaspard