[PATCH] tests: Add -ldl to dwfl_proc_attach_LDFLAGS

Mark Wielaard mark@klomp.org
Sat Nov 20 14:18:27 GMT 2021


Hi,

On Sat, Nov 20, 2021 at 01:12:17AM +0300, Dmitry V. Levin wrote:
> On Fri, Nov 19, 2021 at 05:58:19PM +0100, Florian Weimer wrote:
> > It may have to do with --as-needed that some builds use.  If there are
> > no pending undefined references, some linkers drop earlier shared object
> > references with --as-needed (similar to what happens with static
> > archives).
> > 
> > The GCC LTO plugin results in ld looking at more objects in greater
> > detail for some reason.  Without LTO and --as-needed, you probably don't
> > get a dlopen export (if you do not link with -E) because indirect
> > dependencies are not consulted, breaking the valgrind workaround because
> > there is no interposition.
> 
> Thanks.  I suppose adding -rdynamic to dwfl_proc_attach_LDFLAGS should be
> a more correct fix.

That works. But I don't really understand why.
Does the attached patch look OK to you?

Thanks,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-tests-Add-rdynamic-to-dwfl_proc_attach_LDFLAGS.patch
Type: text/x-diff
Size: 1742 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/elfutils-devel/attachments/20211120/bf40ba02/attachment.bin>


More information about the Elfutils-devel mailing list