[Buildroot] [PATCH] Do not remove path from RPATH when it is needed for dlopen at runtime
Peter Korsgaard
peter at korsgaard.com
Fri Aug 28 17:23:10 UTC 2020
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni at bootlin.com> writes:
> Hello Yann,
> On Tue, 1 Oct 2019 14:33:30 +0200
> Yann Sionneau <ysionneau at kalray.eu> wrote:
>> Do not remove path from RPATH when it points to a directory containing no
>> shared object present as DT_NEEDED in .dynamic section.
>> The RPATH can pretty well be needed at runtime for dlopen.
>>
>> This fixes tst-origin uClibc-ng unit test:
>> https://github.com/wbx-github/uclibc-ng-test/blob/master/test/dlopen/Makefile.in#L25
>> https://github.com/wbx-github/uclibc-ng-test/blob/master/test/dlopen/tst-origin.c#L15
>>
>> Signed-off-by: Yann Sionneau <ysionneau at kalray.eu>
> It's been a long long while, but it turned out I was reported the exact
> same issue (though not with uClibc-ng tests), and indeed a simple test
> cases shows that patchelf is dropping RPATH entries if there's no
> library in that directory with a corresponding DT_NEEDED entry in the
> binary, which breaks dlopen() if it relies on RPATH entries.
> So I've significantly rewritten your commit log, with more
> explanations, and applied your patch to master. Thanks!
Committed to 2020.02.x and 2020.05.x, thanks.
--
Bye, Peter Korsgaard
More information about the buildroot
mailing list