-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Including a linker script with a built in target #72034
Copy link
Copy link
Closed
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-target-specsArea: Compile-target specificationsArea: Compile-target specificationsO-MIPSTarget: MIPS processorsTarget: MIPS processorsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-target-specsArea: Compile-target specificationsArea: Compile-target specificationsO-MIPSTarget: MIPS processorsTarget: MIPS processorsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Hello! I'm filing an issue here after being redirected through Discord and Zulip. I'm trying to add support for a new target which requires an associated linker script. I can confirm it works locally with
rust-lldand a custom JSON target file. I can't seem to find a way to add this linker script to rustc, so I am asking for help.For context, the platform is the Sony PSP. It's essentially a bare metal
mips2target which requires a custom linker script for special.rodata.xyzsections which cannot be merged into.rodata. These sections store module information such as the module entry point, and the platform uses these for linking to system libraries as well.Here is an example of the linker script that the platform needs. Note the special handling of the
.rodata.sceNidsection, for example.The PSP homebrew community does not seem to care about adding LLVM support for C/C++, rather they are focused on a GCC-based toolchain, so there is no real demand to merge this upstream in LLVM. Besides this, LLVM can correctly compile object code for this target, it only needs this special linker script for the final executable section layout.
I am familiar enough with the codebase to add this target spec, but how can I embed this linker script along with it?