Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Merge #207
Browse files Browse the repository at this point in the history
207: Rejig link.x to include more lables to help the linker lay out the ob… r=thejpster a=therealprof

…jects

Tested with 1.34.0 and 1.38.0 and careful inspection of the linker map
generated on the previously failing
https://github.com/rust-lang/rust/files/3722440/minimal-rust-lld-issue.zip

Closes #188 (I believe)
Closes rust-lang/rust#65391

Signed-off-by: Daniel Egger <daniel@eggers-club.de>

Co-authored-by: Daniel Egger <daniel@eggers-club.de>
  • Loading branch information
bors[bot] and therealprof authored Oct 28, 2019
2 parents 965bf1e + d5f2a94 commit fa056fe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions link.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -88,29 +88,32 @@ SECTIONS
*(.text .text.*);
*(.HardFaultTrampoline);
*(.HardFault.*);
. = ALIGN(4);
__etext = .;
} > FLASH

/* ### .rodata */
.rodata : ALIGN(4)
.rodata __etext : ALIGN(4)
{
*(.rodata .rodata.*);

/* 4-byte align the end (VMA) of this section.
This is required by LLD to ensure the LMA of the following .data
section will have the correct alignment. */
. = ALIGN(4);
__erodata = .;
} > FLASH

/* ## Sections in RAM */
/* ### .data */
.data : ALIGN(4)
.data : AT(__erodata) ALIGN(4)
{
. = ALIGN(4);
__sdata = .;
*(.data .data.*);
. = ALIGN(4); /* 4-byte align the end (VMA) of this section */
__edata = .;
} > RAM AT > FLASH
} > RAM

/* LMA of .data */
__sidata = LOADADDR(.data);
Expand Down

0 comments on commit fa056fe

Please sign in to comment.