Files
clang-p2996/lld/test/ELF/linkerscript/emit-reloc.s
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

18 lines
552 B
ArmAsm

# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: echo "SECTIONS { .rela.dyn : { *(.rela.data) } }" > %t.script
# RUN: ld.lld --hash-style=sysv -T %t.script --emit-relocs %t.o -o %t.so -shared
# RUN: llvm-readobj -r %t.so | FileCheck %s
.data
.quad .foo
# CHECK: Relocations [
# CHECK-NEXT: Section ({{.*}}) .rela.dyn {
# CHECK-NEXT: 0x68 R_X86_64_64 .foo 0x0
# CHECK-NEXT: }
# CHECK-NEXT: Section ({{.*}}) .rela.data {
# CHECK-NEXT: 0x68 R_X86_64_64 .foo 0x0
# CHECK-NEXT: }
# CHECK-NEXT: ]