Skip to content

Commit

Permalink
Prevent erroneous copying of the data section
Browse files Browse the repository at this point in the history
With __data_load declared outside the .data section, lld doesn't put
__data_load and __data_start at the same address; they differ by 16
bytes. This tricks the runtime's initialization code into thinking that
it needs to copy the data section, effectively breaking it.

Issue: eng/toolchain/gnat-llvm#64
  • Loading branch information
sebastianpoeplau committed Nov 23, 2023
1 parent dce9479 commit 0251611
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aarch64/morello/common.ld
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ SECTIONS
*(.got)
} > REGION_DATA

__data_load = .;
.data : AT (__data_load)
.data :
{
__data_load = .;
__data = .;
__data_start = .;
*(.data .gnu.linkonce.d*)
Expand Down

0 comments on commit 0251611

Please sign in to comment.