dynamic loadable library multiple degined symbols
Konstantin Belousov
kostikbel at gmail.com
Thu Nov 28 13:12:22 UTC 2019
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
>
>
More information about the freebsd-hackers
mailing list