From dce94798b673f21d040d0f1f5017c2e6de18916f Mon Sep 17 00:00:00 2001 From: Sebastian Poeplau Date: Thu, 23 Nov 2023 16:51:35 +0100 Subject: [PATCH 1/2] Avoid linker warnings for symbols declared multiple times These symbols are declared again as weak symbols below, causing lld to warn that their linkage changes from STB_GLOBAL to STB_WEAK. Issue: eng/toolchain/gnat-llvm#64 --- aarch64/morello/trap_vector.S | 5 ----- 1 file changed, 5 deletions(-) diff --git a/aarch64/morello/trap_vector.S b/aarch64/morello/trap_vector.S index 03e780e8..22515b64 100644 --- a/aarch64/morello/trap_vector.S +++ b/aarch64/morello/trap_vector.S @@ -37,11 +37,6 @@ .globl __sync_interrupt .globl __irq_interrupt .globl __fiq_interrupt - .globl interrupt_stack_table - .globl __serror_interrupt_low - .globl __sync_interrupt_low - .globl __irq_interrupt_low - .globl __fiq_interrupt_low .org 0 .section .vectors, "a" From 02516111dcbad54395c609667edd20236ec42240 Mon Sep 17 00:00:00 2001 From: Sebastian Poeplau Date: Thu, 23 Nov 2023 16:54:35 +0100 Subject: [PATCH 2/2] Prevent erroneous copying of the data section 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 --- aarch64/morello/common.ld | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aarch64/morello/common.ld b/aarch64/morello/common.ld index 8b353f61..9c725b80 100644 --- a/aarch64/morello/common.ld +++ b/aarch64/morello/common.ld @@ -146,9 +146,9 @@ SECTIONS *(.got) } > REGION_DATA - __data_load = .; - .data : AT (__data_load) + .data : { + __data_load = .; __data = .; __data_start = .; *(.data .gnu.linkonce.d*)