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
14 lines
389 B
Plaintext
14 lines
389 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 0x3000
|
|
# CHECK-NEXT: >>> .out.aaa 0x3000 : { *(.aaa) }
|
|
# CHECK-NEXT: >>> ^
|
|
|
|
SECTIONS {
|
|
OVERLAY 0x1000 : AT ( 0x2000 ) {
|
|
.out.aaa 0x3000 : { *(.aaa) }
|
|
}
|
|
}
|