Open TYDQSoft opened 4 months ago
Did you mean this https://learn.microsoft.com/en-us/windows/win32/debug/pe-format that already supports LoongArch?
Cc @yetist @kilaterlee who may know more details.
Context (in Chinese): https://bbs.loongarch.org/d/443
I guess maybe the OP wants more complete relocs in PE, similar to the full set of R_LARCH_B*
, R_LARCH_ABS*
, R_LARCH_PCALA*
etc., so that a complete PE toolchain could be made.
I agree that the OP should provide more information regarding their motivation and background etc. so we don't have to guess as much.
Did you mean this https://learn.microsoft.com/en-us/windows/win32/debug/pe-format that already supports LoongArch?
However,I need more loongarch-specific relocation constants such as IMAGE_REL_LOONGARCH_ABSOLUTE.
There are two constants defined in .NET PAL, not documented in PE spec (not sure if they are .NET specific):
IMAGE_REL_LOONGARCH64_PC IMAGE_REL_LOONGARCH64_JIR
https://github.com/dotnet/runtime/blob/a5cc707d976a14495462c9c492a921ff0927b8f5/src/coreclr/pal/inc/rt/ntimage.h#L1021 implementation: https://github.com/dotnet/runtime/blob/af5e7150362294696d3d52aa2302062e4b7c8095/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Relocation.cs#L542
There are two constants defined in .NET PAL, not documented in PE spec (not sure if they are .NET specific): IMAGE_REL_LOONGARCH64_PC IMAGE_REL_LOONGARCH64_JIR
No, these are only used for .NET and only LoongArch64's AOT within .NET.
There are two constants defined in .NET PAL, not documented in PE spec (not sure if they are .NET specific):
IMAGE_REL_LOONGARCH64_PC IMAGE_REL_LOONGARCH64_JIR
https://github.com/dotnet/runtime/blob/a5cc707d976a14495462c9c492a921ff0927b8f5/src/coreclr/pal/inc/rt/ntimage.h#L1021 implementation: https://github.com/dotnet/runtime/blob/af5e7150362294696d3d52aa2302062e4b7c8095/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Relocation.cs#L542
So that's why draft UEFI specification for LoongArch about relocation type in PE format matters.I need a LoongArch64 relocation table for free pascal compiler.These .NET only constants are so disappointed for free pascal compiler users.
From the code it looks like there is really only one relocation type supported in UEFI: IMAGE_REL_BASED_LOONGARCH64_MARK_LA.
So if you need to target UEFI, this is the one you need to use.
I have read the code in binutils for loongarch and it only provide three relocation constant.It is too few to use,I think.Do you have the plan for loongarch UEFI specification (for PE format in loongarch)?