llvm-project/lld/test/ELF/linkerscript/non-absolute2.test
Han Shen b56030ee9e [lld] Mitigate relocation overflow [part 1 of 2].
This CL places .dynsym and .dynstr at the beginning of SHF_ALLOC
sections. We do this to mitigate the possibility that huge .dynsym and
.dynstr sections placed between ro-data and text sections cause
relocation overflow.

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

llvm-svn: 332374
2018-05-15 17:02:35 +00:00

19 lines
631 B
Plaintext

# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux /dev/null -o %t1.o
# RUN: ld.lld -shared %t1.o --script %s -o %t
# RUN: llvm-objdump -section-headers -t %t | FileCheck %s
SECTIONS {
A = . + 0x1;
. += 0x1000;
}
# CHECK: Sections:
# CHECK-NEXT: Idx Name Size Address Type
# CHECK-NEXT: 0 00000000 0000000000000000
# CHECK-NEXT: 1 .dynsym 00000030 0000000000001000
# CHECK-NEXT: 2 .dynstr 00000003 0000000000001030
# CHECK-NEXT: 3 .text 00000000 0000000000001034
# CHECK: 0000000000000001 .dynsym 00000000 A