Skip to content

Add object relocation constants for LoongArch#2147

Open
heiher wants to merge 1 commit into
MicrosoftDocs:docsfrom
heiher:loong-relocs
Open

Add object relocation constants for LoongArch#2147
heiher wants to merge 1 commit into
MicrosoftDocs:docsfrom
heiher:loong-relocs

Conversation

@heiher
Copy link
Copy Markdown

@heiher heiher commented Dec 3, 2025

Add object relocation constants for 32-bit and 64-bit LoongArch processor families.

This is a key piece of groundwork in my push to bring UEFI target support to the LLVM LoongArch backend, so that Rust can support the UEFI target as well.

@prmerger-automator
Copy link
Copy Markdown
Contributor

@heiher : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@heiher
Copy link
Copy Markdown
Author

heiher commented Dec 4, 2025

This proposal was put together by the Loongson team (the main folks driving the open LoongArch effort) along with a bunch of community contributors. After several rounds of review, we think the current draft is solid and covers everything needed for UEFI support.
@Karl-Bridge-Microsoft Would you mind taking a quick look when you get a chance? Thank you for your time.

Copy link
Copy Markdown

@xen0n xen0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small suggestions after thinking about this for several days...

Comment thread desktop-src/Debug/pe-format.md Outdated
Comment thread desktop-src/Debug/pe-format.md Outdated
Comment thread desktop-src/Debug/pe-format.md Outdated
Add object relocation constants for 32-bit and 64-bit LoongArch processor families.
@heiher
Copy link
Copy Markdown
Author

heiher commented Dec 15, 2025

ping @Karl-Bridge-Microsoft

@Karl-Bridge-Microsoft
Copy link
Copy Markdown
Contributor

I've reached out to an internal team to review your contribution. Thanks!

@jkotas
Copy link
Copy Markdown
Contributor

jkotas commented Dec 18, 2025

This is a key piece of groundwork in my push to bring UEFI target support to the LLVM LoongArch backend

Could you please explain why this is needed to bring UEFI support for Loongarch?

@heiher
Copy link
Copy Markdown
Author

heiher commented Dec 18, 2025

This is a key piece of groundwork in my push to bring UEFI target support to the LLVM LoongArch backend

Could you please explain why this is needed to bring UEFI support for Loongarch?

We're working on adding support for the loongarch64-unknown-uefi target in the Rust compiler, which needs to produce native PE32+ binaries, as required by Rust's UEFI targets. Existing targets like x86_64-unknown-uefi and aarch64-unknown-uefi rely on LLVM to directly emit PE32+ object files, and we're taking the same approach for LoongArch. That's why we need to add LoongArch-specific relocation entries to the PE format, so the architecture's relocations can be handled correctly in COFF objects. Thanks!

@heiher
Copy link
Copy Markdown
Author

heiher commented Feb 19, 2026

Hi folks, just checking in to see if this PR needs any changes or follow-ups from my side. Happy to update the doc as needed.

@heiher
Copy link
Copy Markdown
Author

heiher commented Mar 30, 2026

@Karl-Bridge-Microsoft ping

@Karl-Bridge-Microsoft
Copy link
Copy Markdown
Contributor

@heiher - I've pinged the SME's again for their review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants