Friday, December 09, 2022

Re: shells/bash: dlopen() of modules fails

On 2022-12-06, Christian Weisgerber <naddy@mips.inka.de> wrote:

> bash$ enable finfo
> bash:/usr/local/lib/bash/finfo: undefined symbol 'sh_optind'
> bash:/usr/local/lib/bash/finfo: undefined symbol 'sh_optarg'
> bash: enable: finfo: not a shell builtin

For the record: As jca@ reminded me, we need to link bash in such
a way that symbols are exported for dynamic linking: -rdynamic (or
-Wl,-export-dynamic or -Wl,-E; they all do the same).

Also, I should have used nm -D to check whether the symbols are
available.

--
Christian "naddy" Weisgerber naddy@mips.inka.de

No comments:

Post a Comment