brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 3eeeff7 Raw
29 lines · plain
1// REQUIRES: x862// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/shared.s -o %t.o3// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/copy-in-shared.s -o %t2.o4// RUN: ld.lld -shared %t.o %t2.o -o %t.so5 6// Separate RelRo sections .dynamic .bss.rel.ro with non RelRo .got.plt.7// This causes the RelRo sections to be non-contiguous.8// RUN: echo "SECTIONS { \9// RUN: .dynamic : { *(.dynamic) } \10// RUN: .got.plt : { *(.got.plt) } \11// RUN: .bss.rel.ro : { *(.bss.rel.o) } \12// RUN: } " > %t.script13// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t3.o14 15// Expect error for non-contiguous relro16// RUN: not ld.lld %t3.o %t.so -z relro -o /dev/null --script=%t.script 2>&1 | FileCheck %s17// No error when we do not request relro.18// RUN: ld.lld %t3.o %t.so -z norelro -o %t --script=%t.script19 20// CHECK: error: section: .bss.rel.ro is not contiguous with other relro sections21        .section .text, "ax", @progbits22        .global _start23        .global bar24        .global foo25_start:26        .quad bar27        .quad foo28 29