Date: Sat, 3 Nov 2012 16:53:43 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Peter Klett <peter@netkey.at> Cc: Freebsd Ports <freebsd-ports@freebsd.org> Subject: Re: net-p2p/retroshare VoIP plugin: Undefined symbol Message-ID: <20121103145343.GX73505@kib.kiev.ua> In-Reply-To: <042f62cef98b0499e960bfe3e7f15fff@netkey.at> References: <042f62cef98b0499e960bfe3e7f15fff@netkey.at>
next in thread | previous in thread | raw e-mail | index | archive | help
--5FNPeqk0egs0iuvD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 03, 2012 at 01:59:18PM +0100, Peter Klett wrote: >=20 > Hi All, >=20 > I'm currently trying to get the VoIP plugin from RetroShare to work=20 > under FreeBSD. > After this patch I was able to build it: >=20 > --- plugins/VOIP/services/rsvoipitems.cc~ 2012-02-26=20 > 18:13:54.000000000 +0100 > +++ plugins/VOIP/services/rsvoipitems.cc 2012-10-29=20 > 12:53:56.650925587 +0100 > @@ -182,7 +182,7 @@ > ok &=3D setRawUInt32(data, tlvsize, &offset, flags); > ok &=3D setRawUInt32(data, tlvsize, &offset, data_size); > std::cerr << "data_size : " << data_size << std::endl; > - memcpy(data+offset,voip_data,data_size) ; > + memcpy(&((uint8_t*)data)[offset],voip_data,data_size) ; > offset +=3D data_size ; >=20 > if (offset !=3D tlvsize) >=20 > But I can't get RetroShare to load it: >=20 > Cannot open plugin: /home/user/.retroshare/extensions/libVOIP.so:=20 > Undefined symbol "_ZN9p3Service7receiveEP9RsRawItem" >=20 > Now the symbol is part of the RetroShare binary: >=20 > $ grep _ZN9p3Service7receiveEP9RsRawItem=20 > work/trunk/retroshare-gui/src/RetroShare > Binary file work/trunk/retroshare-gui/src/RetroShare matches >=20 > but somehow the symbols from the main binary do not get exported to the= =20 > plugin. > The FreeBSD man page for dlopen(3) states in the NOTES section >=20 > ELF executables need to be linked using the -export-dynamic option to > ld(1) for symbols defined in the executable to become visible to=20 > dlsym(). >=20 >=20 > So I rebuilt RetroShare with the -export-dynamic option, and the symbol= =20 > is part of the symbol table: >=20 > $ objdump -t work/trunk/retroshare-gui/src/RetroShare | grep=20 > _ZN9p3Service7receiveEP9RsRawItem > 0000000000809580 g F .text 00000000000000c7 =20 > _ZN9p3Service7receiveEP9RsRawItem >=20 > but still to no avail (same undefined symbol error). > My knowledge of ELF binaries is pretty sparse, so if someone has more=20 > clues, I would appreciate sharing :) The objdump -t dumps wrong table. You want to examine the output of -T AKA --dynamic-syms. --5FNPeqk0egs0iuvD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCVL/cACgkQC3+MBN1Mb4heigCfbuxC4fvHnYvaTw0bmU807NPf i3UAnixvUIVZSIoCDbADLs0TtNFOJd5F =SoYn -----END PGP SIGNATURE----- --5FNPeqk0egs0iuvD--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121103145343.GX73505>