dynamic loadable library multiple degined symbols

Peter Blok pblok at bsd4all.org
Thu Nov 28 13:48:31 UTC 2019


I’m trying to change this because named dies with an assert. named checks the arguments of dns_name_equal which is completely different from the one intended out of the shared module.


> On 28 Nov 2019, at 14:12, Konstantin Belousov <kostikbel at gmail.com> wrote:
> 
> 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
>> 
>> 
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2348 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20191128/0d542c6f/attachment.bin>


More information about the freebsd-hackers mailing list