[llvm-branch-commits] [libc] Add dl_iterate_phdr to Linux x86-64 entrypoints (PR #193601)
Petr Hosek via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Apr 23 12:12:38 PDT 2026
petrhosek wrote:
> > > Hence I don't think the current no-op stub is sufficient for libunwind to actually function.
> >
> >
> > Ah. I was missing that this was only a stub implementation. For some reason I was under the impression that this was a full implementation.
> > Do we need to fill out a `dl_phdr_info` on startup and keep that around? I was under the impression that we could implement it by just sending over info for the main executable and vDSO without needing to keep anything around.
>
> Do you know the best way to bring in an object parser? @jhuber6 mentioned that we might want to reuse code from clang but that does not look trivial to me.
That code is tied to the rest of LLVM and not a fit for libc. I think our options are to either to implement the ELF parser from scratch or to reuse an existing implementation from outside of LLVM.
In Fuchsia we built a standalone [C++ library for implementing ELF dynamic linking and loading functionality](https://cs.opensource.google/fuchsia/fuchsia/+/main:src/lib/elfldltl/) and we already discussed the idea of donating this implementation to LLVM libc, but the library is still under active development and it'd likely be several months before we could start seriously looking into moving this code over.
https://github.com/llvm/llvm-project/pull/193601
More information about the llvm-branch-commits
mailing list