Files
clang-p2996/lld/test/ELF/linkerscript/memory5.test
Fangrui Song ecf4c9e13c [ELF] Don't advance position in a memory region when assigning to the Dot
For memory5.test, ld.bfd appears to ignore `. += 0x2000;`, so the test was testing
a wrong behavior. After deleting the code added in rLLD336335, we match ld.bfd and thus fix PR41357.

PR37836 (memory4.test) seems to have been fixed by another change.

Reviewed By: ruiu

Differential Revision: https://reviews.llvm.org/D62177

llvm-svn: 361228
2019-05-21 08:21:44 +00:00

20 lines
584 B
Plaintext

# REQUIRES: x86
# RUN: echo ".section .text,\"ax\"; nop; .section .data,\"aw\"; nop;" \
# RUN: | llvm-mc -filetype=obj -triple=x86_64-pc-linux - -o %t.o
# RUN: ld.lld -o %t.so --script %s %t.o
# RUN: llvm-objdump -section-headers %t.so | FileCheck %s
# CHECK: 1 .text 00000001 0000000000042000
# CHECK-NEXT: 2 .data 00000001 0000000000042001
## Test that assigning to Dot does not change the position in a memory region.
MEMORY {
ram (wxa) : ORIGIN = 0x42000, LENGTH = 0x100000
}
SECTIONS {
.text : { *(.text*) }
. += 0x2000;
.data : { *(.data*) }
}