[libc-commits] [libc] [libc][WIP] try to make sysconf work (PR #74166)

Fangrui Song via libc-commits libc-commits at lists.llvm.org
Fri Dec 1 21:04:34 PST 2023


MaskRay wrote:

As said on Discord

> I have read rtld part of glibc, musl, and FreeBSD, but I am not familiar with llvmlibc. From a quick glance, startup/linux does not contain any relocation resolver code, so it is more like crt part for a -static executable, not for -static-pie or dynamically linked executables. The code doesn't handle features needed by ifunc. 
I think startup/linux properly needs a complete rewrite, since different architectures share lots of code. The current structure would encourage a lot of duplication.

I understand the value of incremental updates, but the loader probably needs a rewrite to be mostly arch-neutral to avoid (a) wasted engineering efforts on duplicating code for aarch64/x86_64/riscv (b) wasted engineering efforts on whether a `-static` feature would work for `-static-pie` and dynamically linked executables.

Before the rewrite, we could add incremental features, but if people get used to the behavior, it would probably be harder to rewrite the loader.

https://github.com/llvm/llvm-project/pull/74166


More information about the libc-commits mailing list