Skip to content

LoongArch64: Optimized PC related relocation and added LLVM support#12515

Open
kilaterlee wants to merge 2 commits intotianocore:masterfrom
kilaterlee:SubmitPcRlateAndClang
Open

LoongArch64: Optimized PC related relocation and added LLVM support#12515
kilaterlee wants to merge 2 commits intotianocore:masterfrom
kilaterlee:SubmitPcRlateAndClang

Conversation

@kilaterlee
Copy link
Copy Markdown
Contributor

Description

Patch1: The relocation methods of R_LARCH_PCALA_HI20, R_LARCH_PCALA_LO12, R_LARCH_GOT_PC_HI20 and R_LARCH_GOT_PC_LO12 have been optimized to support cases where HI is not adjacent to LO and where one HI corresponds to multiple LOs.
Patch2: Added LoongArch64 CLANGDWARF compiler support. It requires the LLVM version 22.1.0-rc1 or higher.

How This Was Tested

Download the LLVM 22.1.0-rc1 or higher, export CLANGDWARF_BIN PATH, and build use: build -b DEBUG -t CLANGDWARF -a LOONGARCH64 -p OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc or build -b RELEASE -t CLANGDWARF -a LOONGARCH64 -p OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc. It should build and run in QEMU.

Integration Instructions

N/A.

The relocation methods of R_LARCH_PCALA_HI20, R_LARCH_PCALA_LO12,
R_LARCH_GOT_PC_HI20 and R_LARCH_GOT_PC_LO12 have been optimized to
support cases where HI is not adjacent to LO and where one HI
corresponds to multiple LOs.

Signed-off-by: Chao Li <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Guillermo Antonio Palomino Sosa <[email protected]>
Cc: Yuwei Chen <[email protected]>
Cc: Poncho Figueroa <[email protected]>
Cc: Mike Beaton <[email protected]>
Added LoongArch64 CLANGDWARF compiler support. It requires the LLVM
version 22.1.0-rc1 or higher.

Signed-off-by: Chao Li <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Guillermo Antonio Palomino Sosa <[email protected]>
Cc: Yuwei Chen <[email protected]>
Cc: Poncho Figueroa <[email protected]>
Cc: Mike Beaton <[email protected]>
@kilaterlee kilaterlee force-pushed the SubmitPcRlateAndClang branch from 293aa0e to ecae105 Compare April 29, 2026 02:06
@kilaterlee kilaterlee marked this pull request as draft April 29, 2026 02:49
@kilaterlee kilaterlee marked this pull request as ready for review April 29, 2026 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant