xref: /llvm-project/lld/test/ELF/partition-errors.s (revision f10441ad003236ef3b9e5415a571d2be0c0ce5ce)
1// REQUIRES: x86, mips
2/// Link against a DSO to ensure that sections are not discarded by --gc-sections.
3// RUN: llvm-mc %S/Inputs/shared.s -o %ts.o -filetype=obj --triple=x86_64
4// RUN: ld.lld -shared -soname=ts %ts.o -o %ts.so
5// RUN: llvm-mc -triple=x86_64-unknown-linux -filetype=obj -o %t.o %s
6// RUN: echo "SECTIONS {}" > %t.script
7// RUN: not ld.lld --export-dynamic %ts.so %t.o %t.script 2>&1 | FileCheck %s
8// RUN: echo "PHDRS { text PT_LOAD; }" > %t2.script
9// RUN: not ld.lld --export-dynamic %ts.so %t.o %t2.script 2>&1 | FileCheck %s
10// RUN: not ld.lld --export-dynamic %ts.so %t.o --section-start .text=0 2>&1 | FileCheck %s
11// RUN: not ld.lld --export-dynamic %ts.so %t.o -Ttext=0 2>&1 | FileCheck %s
12// RUN: not ld.lld --export-dynamic %ts.so %t.o -Tdata=0 2>&1 | FileCheck %s
13// RUN: not ld.lld --export-dynamic %ts.so %t.o -Tbss=0 2>&1 | FileCheck %s
14
15// RUN: llvm-mc %S/Inputs/shared.s -o %ts.o -filetype=obj --triple=mipsel-unknown-linux
16// RUN: ld.lld -shared -soname=ts %ts.o -o %ts.so
17// RUN: llvm-mc -triple=mipsel-unknown-linux -filetype=obj -o %t2.o %s
18// RUN: not ld.lld --export-dynamic %t2.o %ts.so 2>&1 | FileCheck %s
19
20// CHECK: error: {{.*}}.o: partitions cannot be used
21
22.section .llvm_sympart.f1,"",@llvm_sympart
23.asciz "part1"
24.quad f1
25
26.text
27.globl f1
28f1:
29