dynamic loadable library multiple degined symbols
Peter Blok
pblok at bsd4all.org
Thu Nov 28 14:27:24 UTC 2019
Your pointers helped me find a solution.
The samba build environment generates a runner script to build the module. I have added this symbol in the script amongst other “hidden” ones and it now works.
Now I have to find out where and how the script is generated and have a patch ready for upstream.
> On 28 Nov 2019, at 14:48, Peter Blok <pblok at bsd4all.org> wrote:
>
> 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/a2c09230/attachment.bin>
More information about the freebsd-hackers
mailing list