Skip to content

Commit 5ac83dd

Browse files
authored
Unrolled build for #148272
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.
2 parents 292be5c + 958d0a3 commit 5ac83dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_target/src/spec/targets/armv7a_vex_v5_linker_script.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ SECTIONS {
6060
/*
6161
* Executable program instructions.
6262
*/
63-
.text : {
63+
.text ALIGN(4) : {
6464
/* _boot routine (entry point from VEXos, must be at 0x03800020) */
6565
*(.boot)
6666

0 commit comments

Comments
 (0)