Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Nov 2019 15:12:11 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Peter Blok <pblok@bsd4all.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: dynamic loadable library multiple degined symbols
Message-ID:  <20191128131211.GQ10580@kib.kiev.ua>
In-Reply-To: <BEA0011D-0981-4FF7-8035-3D26C94FDD36@bsd4all.org>
References:  <BEA0011D-0981-4FF7-8035-3D26C94FDD36@bsd4all.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Nov 28, 2019 at 01:50:15PM +0100, Peter Blok wrote:
> Hi,
> 
> named (bind9.14) has a function called dns_name_equal. (0000000000443ac0 T dns_name_equal)
> 
> named dynamically  loads dlz_bind9_14.so is build from dlz_bind9.c and calls this function, but dns_name_equal was undefined so it got resolved to the version of named.
> 
> The function is defined in dns_utils.c, so I changed the building to include that file.
> 
> Now dlz_bind9_14.so is using dlz_bind9.c and dns_utils.c also has the right dns_name_equal (000000000000bee0 T dns_name_equal) defined
>  
> Unfortunately the code inside dlz_bind9_14.so still calls the function out of named.
> 
> Is this something that should have been resolved at compile/link time of dlz_bind9_14.so? If so, how?
No, default ELF name resolution rules would give the behaviour you described,
assuming the main binary was linked with -Wl,-E (and it must be to export
symbols to loadable modules).  The shared libraries and loadable modules
are interposable by default, unless linked with -B symbolic, and the symbol
resolution order starts from the main binary object.

Why do you try to change this ?

> 
> Note that the samba build uses waf and wscript files.
> 
> Peter
> 
> 





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20191128131211.GQ10580>