This is PR36768. Linker script OVERLAYs are described in 4.6.9. Overlay Description of the spec: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/sections.html They are used to allow output sections which have different LMAs but the same VAs and used for embedded programming. Currently, LLD restricts overlapping of sections and that seems to be the most desired behaviour for defaults. My thoughts about possible approaches for PR36768 are on the bug page, this patch implements OVERLAY keyword and allows VAs overlapping for sections that within the overlay. Differential revision: https://reviews.llvm.org/D44780 llvm-svn: 335714
18 lines
469 B
Plaintext
18 lines
469 B
Plaintext
# REQUIRES: x86
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux /dev/null -o %t.o
|
|
# RUN: not ld.lld %t.o --script %s -o %t 2>&1 | FileCheck %s
|
|
|
|
# CHECK: {{.*}}.test:{{.*}}: { expected, but got AX
|
|
# CHECK-NEXT: >>> .out.aaa { *(.aaa) } > AX AT>FLASH
|
|
# CHECK-NEXT: >>> ^
|
|
|
|
MEMORY {
|
|
AX (ax) : ORIGIN = 0x3000, LENGTH = 0x4000
|
|
}
|
|
|
|
SECTIONS {
|
|
OVERLAY 0x1000 : AT ( 0x2000 ) {
|
|
.out.aaa { *(.aaa) } > AX AT>FLASH
|
|
}
|
|
}
|