File: orphan-report.s

package info (click to toggle)
llvm-toolchain-6.0 1%3A6.0.1-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 598,080 kB
  • sloc: cpp: 3,046,253; ansic: 595,057; asm: 271,965; python: 128,926; objc: 106,554; sh: 21,906; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,227; cs: 2,027; xml: 686; php: 212; csh: 117
file content (54 lines) | stat: -rw-r--r-- 2,829 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
# RUN: echo "SECTIONS { .text : { *(.text.1) } }" > %t.script

## Check we do not report orphans by default even with -verbose.
# RUN: ld.lld -shared -o %t.out --script %t.script %t.o 2>&1 -verbose \
# RUN:   | FileCheck %s --check-prefix=DEFAULT
# DEFAULT-NOT: placed

## Check --orphan-handling=place has the same behavior as default.
# RUN: ld.lld -shared --orphan-handling=place -o %t.out --script %t.script \
# RUN:   %t.o 2>&1 -verbose  -error-limit=0 | FileCheck %s --check-prefix=DEFAULT

## Check --orphan-handling=error reports errors about orphans.
# RUN: not ld.lld -shared --orphan-handling=error -o %t.out --script %t.script \
# RUN:   %t.o 2>&1 -verbose  -error-limit=0 | FileCheck %s --check-prefix=REPORT
# REPORT:      {{.*}}.o:(.text) is being placed in '.text'
# REPORT-NEXT: {{.*}}.o:(.text.2) is being placed in '.text'
# REPORT-NEXT: <internal>:(.comment) is being placed in '.comment'
# REPORT-NEXT: <internal>:(.bss) is being placed in '.bss'
# REPORT-NEXT: <internal>:(.bss.rel.ro) is being placed in '.bss.rel.ro'
# REPORT-NEXT: <internal>:(.dynsym) is being placed in '.dynsym'
# REPORT-NEXT: <internal>:(.gnu.version) is being placed in '.gnu.version'
# REPORT-NEXT: <internal>:(.gnu.version_r) is being placed in '.gnu.version_r'
# REPORT-NEXT: <internal>:(.gnu.hash) is being placed in '.gnu.hash'
# REPORT-NEXT: <internal>:(.hash) is being placed in '.hash'
# REPORT-NEXT: <internal>:(.dynamic) is being placed in '.dynamic'
# REPORT-NEXT: <internal>:(.dynstr) is being placed in '.dynstr'
# REPORT-NEXT: <internal>:(.rela.dyn) is being placed in '.rela.dyn'
# REPORT-NEXT: <internal>:(.got) is being placed in '.got'
# REPORT-NEXT: <internal>:(.got.plt) is being placed in '.got.plt'
# REPORT-NEXT: <internal>:(.got.plt) is being placed in '.got.plt'
# REPORT-NEXT: <internal>:(.rela.plt) is being placed in '.rela.plt'
# REPORT-NEXT: <internal>:(.rela.plt) is being placed in '.rela.plt'
# REPORT-NEXT: <internal>:(.plt) is being placed in '.plt'
# REPORT-NEXT: <internal>:(.plt) is being placed in '.plt'
# REPORT-NEXT: <internal>:(.eh_frame) is being placed in '.eh_frame'
# REPORT-NEXT: <internal>:(.symtab) is being placed in '.symtab'
# REPORT-NEXT: <internal>:(.shstrtab) is being placed in '.shstrtab'
# REPORT-NEXT: <internal>:(.strtab) is being placed in '.strtab'

## Check --orphan-handling=warn reports warnings about orphans.
# RUN: ld.lld -shared --orphan-handling=warn -o %t.out --script %t.script \
# RUN:   %t.o 2>&1 -verbose | FileCheck %s --check-prefix=REPORT

# RUN: not ld.lld --orphan-handling=foo -o %t.out --script %t.script %t.o 2>&1 \
# RUN:   | FileCheck %s --check-prefix=UNKNOWN
# UNKNOWN: unknown --orphan-handling mode: foo

.section .text.1,"a"
 nop

.section .text.2,"a"
 nop