A little-known feature of bash is that it can be extended with
loadable modules. A number of example modules are built by default
and shipped in /usr/local/lib/bash. However, loading some of those
modules fails because of missing symbols:
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
This appears to concern bss symbols that _are_ defined in bash
itself:
$ nm -g /usr/local/lib/bash/finfo | egrep 'sh_opt(ind|arg)'
U sh_optarg
U sh_optind
$ nm -g /usr/local/bin/bash | egrep 'sh_opt(ind|arg)'
00136588 B sh_optarg
00136590 B sh_optind
I don't understand why this fails. Note that this has been broken
for months, if not forever. It is not a recent error.
Running bash with LD_DEBUG=1 provides no further information:
bash$ enable finfo
dlopen: loading: /usr/local/lib/bash/finfo
flags /usr/local/lib/bash/finfo = 0x0
head /usr/local/lib/bash/finfo
obj /usr/local/lib/bash/finfo has /usr/local/lib/bash/finfo as head
linking /usr/local/lib/bash/finfo as dlopen()ed
head [/usr/local/lib/bash/finfo]
examining: '/usr/local/lib/bash/finfo'
tail /usr/local/lib/bash/finfo
bash:/usr/local/lib/bash/finfo: undefined symbol 'sh_optind'
bash:/usr/local/lib/bash/finfo: undefined symbol 'sh_optarg'
unload_shlib called on /usr/local/lib/bash/finfo
unload_shlib unloading on /usr/local/lib/bash/finfo
dlopen: /usr/local/lib/bash/finfo: done (failed).
dlopen: loading: finfo
dlopen: failed to open finfo
dlopen: finfo: done (failed).
bash: enable: finfo: not a shell builtin
I'm at a loss.
--
Christian "naddy" Weisgerber naddy@mips.inka.de
No comments:
Post a Comment