[libcamera-devel] [PATCH 1/5] libcamera: utils: Provide helper to get dynamic library runpath

Kieran Bingham kieran.bingham at ideasonboard.com
Tue Feb 18 18:18:01 CET 2020


Hi Laurent,

On 06/02/2020 21:03, Laurent Pinchart wrote:
> Hi Kieran,
> 
> Another comment.
> 

>>> +{
>>> +	const ElfW(Dyn) *dyn = _DYNAMIC;
> 
> bionic and musl don't seem to provide _DYNAMIC :-S They both have elf.h
> and link.h, with a definition of the macros and structures used below,
> but _DYNAMIC seems to be missing. I may be missing something, it should
> be tested.

MUSL proved to be a real problem on this topic, so I've started a rework
to incorporate the path to a dedicated section and we'll have to
manually strip that as part of the install phase.

--
Kieran


> 42				strtab = reinterpret_cast<const char *>(dyn->d_un.d_val);
> (gdb) n
> 38		for (const ElfW(Dyn) *dyn = _DYNAMIC; dyn->d_tag != DT_NULL; ++dyn) {
> (gdb) p strtab
> $2 = 0x1560 <error: Cannot access memory at address 0x1560>
> (gdb) p dyn
> $3 = (const Elf64_Dyn *) 0x55a12b3bccc8
> (gdb) p *dyn
> $4 = {d_tag = 5, d_un = {d_val = 5472, d_ptr = 5472}}



-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list