1# REQUIRES: x86 2# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o 3# RUN: ld.lld -shared -z nosectionheader -z sectionheader %t.o -o %t.so 2>&1 | count 0 4# RUN: llvm-readelf -hS %t.so | FileCheck %s --check-prefixes=CHECK,SHDR 5 6# RUN: ld.lld -shared -z nosectionheader %t.o -o %t0.so 7# RUN: llvm-readelf -h --dyn-syms %t0.so | FileCheck %s --check-prefixes=CHECK,NOSHDR 8# RUN: llvm-strings %t0.so | FileCheck %s --check-prefixes=NOSHDR-STR 9 10# CHECK: Size of this header: 64 (bytes) 11# CHECK-NEXT: Size of program headers: 56 (bytes) 12# CHECK-NEXT: Number of program headers: 6 13# CHECK-NEXT: Size of section headers: 64 (bytes) 14# SHDR-NEXT: Number of section headers: 13 15# SHDR-NEXT: Section header string table index: 11 16# NOSHDR-NEXT: Number of section headers: 0 17# NOSHDR-NEXT: Section header string table index: 0 18 19# SHDR: Section Headers: 20# NOSHDR: Symbol table for image contains 2 entries: 21# NOSHDR: _start 22 23## _start occurs as a dynamic string table entry. There is no static string table 24## entry. `nonalloc` is not in the output. 25# NOSHDR-STR: _start 26# NOSHDR-STR-NOT: _start 27 28# RUN: not ld.lld -r -z nosectionheader %t.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR 29 30# ERR: error: -r and -z nosectionheader may not be used together 31 32.globl _start 33_start: 34 35.section nonalloc,"" 36.asciz "_start" 37