quic-garvgupt wrote:

>I don't think that this should necessarily prevent this patch from landing. To 
>some degree users can just not use the option if the toolchain doesn't support 
>it. 

The file names for crt files are borrowed from their linux equivalent. However 
as already pointed out, if a user wants to link against different set of `crt*` 
files, then they can pass `-nostdlib` or `-nostartfiles and provide their own 
implementation of startup routines.

>I'm interested in what the RISCV bare-metal toolchains do in this case?

In such scenarios, the responsibility for generating startup code with an 
appropriate relocation resolver is delegated to customer image vendors. They 
are expected to use options like -nostartfiles or -nostdlib, and provide their 
own startup routines that include an implementation of a custom relocation 
resolver. Additionally, they must define linker script symbols to delimit the 
dynamic relocations. The custom resolver then parses each .rela.dyn relocation 
entry within the boundaries defined by these symbols.
As far as I know, there is nothing RISC-V bare-metal-specific in the toolchains 
to handle such cases.

https://github.com/llvm/llvm-project/pull/147589
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to