[PATCH] elf/dl-deps.c: Make _dl_build_local_scope breadth first

Carlos O'Donell carlos@redhat.com
Thu Jan 13 19:02:55 GMT 2022


On 12/9/21 18:53, Khem Raj via Libc-alpha wrote:
> From: Mark Hatle <mark.hatle@windriver.com>
> 
> According to the ELF specification:
> 
> When resolving symbolic references, the dynamic linker examines the symbol
> tables with a breadth-first search.
> 
> This function was using a depth first search.  By doing so the conflict
> resolution reported to the prelinker (when LD_TRACE_PRELINKING=1 is set)
> was incorrect.  This caused problems when their were various circular
> dependencies between libraries.  The problem usually manifested itself by
> the wrong IFUNC being executed.
> 
> Similar issue has been reported here [1]
> 
> [BZ# 20488]
> 
> [1] https://sourceware.org/legacy-ml/libc-alpha/2016-05/msg00034.html
> 
> Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This needs much more discussion before inclusion.

At the very least we need clear test cases that show the problem.

The alternative patch I would support is prelink support removal.

-- 
Cheers,
Carlos.



More information about the Libc-alpha mailing list