Skip to content

Conversation

@lewisfm
Copy link
Contributor

@lewisfm lewisfm commented Oct 29, 2025

This PR fixes an alignment issue with the initialization routine on the VEX V5 target.

Previously, if the .text output section contained any functions aligned to more than four bytes, the linker would add padding bytes before the beginning of .text rather than changing the position of the aligned function inside the section itself. This is an issue because the entry point for the program needs to be located at 0x3800_0020 on this platform and the addition of padding could cause it to be moved.

To fix this, I've forced the start address of the .text section to be aligned to 4 bytes so that the entry point is placed consistently. Items inside the section can still be aligned to values larger than this.

@rustbot
Copy link
Collaborator

rustbot commented Oct 29, 2025

These commits modify compiler targets.
(See the Target Tier Policy.)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 29, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 29, 2025

r? @madsmtm

rustbot has assigned @madsmtm.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@saethlin
Copy link
Member

r? saethlin
@bors r+

@bors
Copy link
Collaborator

bors commented Oct 30, 2025

📌 Commit 958d0a3 has been approved by saethlin

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 30, 2025
bors added a commit that referenced this pull request Oct 30, 2025
Rollup of 8 pull requests Successful merges: - #138217 (Turn `Cow::is_borrowed,is_owned` into associated functions.) - #147858 (Micro-optimization attempt in coroutine layout computation) - #147923 (Simplify rustc_public context handling) - #148115 (rustdoc: Rename unstable option `--nocapture` to `--no-capture` in accordance with `libtest`) - #148137 (Couple of changes for Redox OS) - #148176 ([rustdoc] Include attribute and derive macros when filtering on "macros") - #148253 (Handle default features and -Ctarget-features in the dummy backend) - #148272 (Align VEX V5 boot routine to 4 bytes) r? `@ghost` `@rustbot` modify labels: rollup
@bors bors merged commit 4796814 into rust-lang:master Oct 30, 2025
11 checks passed
rust-timer added a commit that referenced this pull request Oct 30, 2025
Rollup merge of #148272 - vexide:fix/linker-script-align, r=saethlin Align VEX V5 boot routine to 4 bytes This PR fixes an alignment issue with the initialization routine on the VEX V5 target. Previously, if the `.text` output section contained any functions aligned to more than four bytes, the linker would add padding bytes before the beginning of `.text` rather than changing the position of the aligned function inside the section itself. This is an issue because the entry point for the program needs to be located at `0x3800_0020` on this platform and the addition of padding could cause it to be moved. To fix this, I've forced the start address of the `.text` section to be aligned to 4 bytes so that the entry point is placed consistently. Items inside the section can still be aligned to values larger than this.
@rustbot rustbot added this to the 1.93.0 milestone Oct 30, 2025
@lewisfm lewisfm deleted the fix/linker-script-align branch October 30, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

5 participants