[libc-commits] [libc] [libc] Add `Scrt1.o` to `startup_components` (PR #97497)

Fangrui Song via libc-commits libc-commits at lists.llvm.org
Wed Jul 3 14:48:27 PDT 2024


MaskRay wrote:

> > > cc @MaskRay . I am not sure directly creating `crt1` to `Scrt1` based on `crt1` will work? If it does work for current configuration, it can be easily broken in the future. `-pie`, `-static`, `-static-pie` should have different relocation policies.
> > 
> > 
> > I am not familiar with the build system, but you can create `Scrt1.o` and make `crt1.o` a symlink. For `-static-pie`, `rcrt1.o` is needed and it needs to resolve relative relocations (also IRELATIVE if ifunc is supported).
> 
> Do you know where the differences between these files is documented?

They are undocumented. One needs to investigate whether other libc implementations do...

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


More information about the libc-commits mailing list