brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 919c553 Raw
73 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o3# RUN: echo "-sectcreate 1.1" >%t14# RUN: echo "-sectcreate 1.2" >%t25# RUN: echo "-sectcreate 2" >%t36# RUN: %lld \7# RUN:     -sectcreate SEG SEC1 %t1 \8# RUN:     -segcreate SEG SEC2 %t3 \9# RUN:     -sectcreate SEG SEC1 %t2 \10# RUN:     -add_empty_section __DATA __data \11# RUN:     -o %t %t.o12# RUN: llvm-objdump -s %t | FileCheck %s13 14## -dead_strip does not strip -sectcreate sections,15## but also doesn't set S_ATTR_NO_DEAD_STRIP on them.16# RUN: %lld -dead_strip \17# RUN:     -sectcreate SEG SEC1 %t1 \18# RUN:     -segcreate SEG SEC2 %t3 \19# RUN:     -sectcreate SEG SEC1 %t2 \20# RUN:     -add_empty_section SEG SEC1 \21# RUN:     -o %t %t.o22# RUN: llvm-objdump -s %t | FileCheck --check-prefix=STRIPPED %s23# RUN: llvm-readobj --sections %t | FileCheck --check-prefix=STRIPPEDSEC %s24 25# RUN: %lld -add_empty_section foo bar -o %t %t.o26# RUN: llvm-readobj --sections %t | FileCheck --check-prefix=EMPTYSECTION %s27 28# RUN: %lld -sectcreate SEG SEC1 %t1 -add_empty_section SEG SEC1 -o %t %t.o29# RUN: llvm-readobj --sections %t | FileCheck --check-prefix=CREATEDANDEMPTY %s30 31# CHECK: Contents of section __TEXT,__text:32# CHECK: Contents of section __DATA,__data:33# CHECK: my string!.34# CHECK: Contents of section SEG,SEC1:35# CHECK: -sectcreate 1.1.36# CHECK: -sectcreate 1.2.37# CHECK: Contents of section SEG,SEC2:38# CHECK: -sectcreate 2.39 40# STRIPPED: Contents of section __TEXT,__text:41# STRIPPED-NOT: Contents of section __DATA,__data:42# STRIPPED-NOT: my string!.43# STRIPPED: Contents of section SEG,SEC1:44# STRIPPED: -sectcreate 1.1.45# STRIPPED: -sectcreate 1.2.46# STRIPPED: Contents of section SEG,SEC2:47# STRIPPED: -sectcreate 2.48 49# STRIPPEDSEC-NOT: NoDeadStrip50 51# EMPTYSECTION: Name: bar52# EMPTYSECTION: Segment: foo53# EMPTYSECTION: Size: 0x054# EMPTYSECTION-NOT: Name:55 56# CREATEDANDEMPTY: Name: SEC157# CREATEDANDEMPTY: Segment: SEG58# CREATEDANDEMPTY: Size: 0x1059# CREATEDANDEMPTY-NOT: Name:60 61.text62.global _main63_main:64  mov $0, %eax65  ret66 67.data68.global my_string69my_string:70  .string "my string!"71 72.subsections_via_symbols73