brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.2 KiB · 97cbf74 Raw
195 lines · plain
1# REQUIRES: x862 3# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t4# RUN: ld.lld %t -o %t25# RUN: llvm-readobj --sections --symbols %t2 | FileCheck -check-prefix=NOGC %s6# RUN: ld.lld --gc-sections --print-gc-sections %t -o %t2 | FileCheck --check-prefix=GC1-DISCARD %s7# RUN: llvm-readobj --sections --symbols %t2 | FileCheck -check-prefix=GC1 %s8# RUN: ld.lld -pie --export-dynamic --gc-sections %t -o %t29# RUN: llvm-readobj --sections --symbols %t2 | FileCheck -check-prefix=GC2 %s10 11## In non-pie static linking, --export-dynamic currently retains the global 'd' even if it is not exported.12# RUN: ld.lld --export-dynamic --gc-sections --print-gc-sections %t -o %t113# RUN: llvm-readobj --sections --symbols %t2 | FileCheck -check-prefix=GC2 %s14 15# RUN: llvm-mc -filetype=obj -triple=x86_64 --crel %s -o %t.o16# RUN: ld.lld -pie --gc-sections --print-gc-sections %t.o -o %t2 | FileCheck --check-prefix=GC1-DISCARD %s17# RUN: llvm-readobj --sections --symbols %t2 | FileCheck -check-prefix=GC1 %s18 19# NOGC: Name: .eh_frame20# NOGC: Name: .text21# NOGC: Name: .init22# NOGC: Name: .init_x23# NOGC: Name: .fini24# NOGC: Name: .tdata25# NOGC: Name: .tbss26# NOGC: Name: .ctors27# NOGC: Name: .dtors28# NOGC: Name: .fini_array29# NOGC: Name: .init_array30# NOGC: Name: .preinit_array31# NOGC: Name: .jcr32# NOGC: Name: .jcr_x33# NOGC: Name: .debug_pubtypes34# NOGC: Name: .comment35# NOGC: Name: a36# NOGC: Name: b37# NOGC: Name: c38# NOGC: Name: e39# NOGC: Name: f40# NOGC: Name: g41# NOGC: Name: h42# NOGC: Name: x43# NOGC: Name: y44# NOGC: Name: d45 46# GC1-DISCARD:      removing unused section {{.*}}:(.text.d)47# GC1-DISCARD-NEXT: removing unused section {{.*}}:(.text.x)48# GC1-DISCARD-NEXT: removing unused section {{.*}}:(.text.y)49# GC1-DISCARD-NEXT: removing unused section {{.*}}:(.tbss.f)50# GC1-DISCARD-NEXT: removing unused section {{.*}}:(.tdata.h)51# GC1-DISCARD-NEXT: removing unused section {{.*}}:(.init_x)52# GC1-DISCARD-NEXT: removing unused section {{.*}}:(.jcr_x)53# GC1-DISCARD-EMPTY:54 55# GC1:     Name: .eh_frame56# GC1:     Name: .text57# GC1:     Name: .init58# GC1:     Name: .fini59# GC1:     Name: .tdata60# GC1:     Name: .tbss61# GC1:     Name: .ctors62# GC1:     Name: .dtors63# GC1:     Name: .fini_array64# GC1:     Name: .init_array65# GC1:     Name: .preinit_array66# GC1:     Name: .jcr67# GC1:     Name: .debug_pubtypes68# GC1:     Name: .comment69# GC1:     Name: a70# GC1:     Name: b71# GC1:     Name: c72# GC1:     Name: e73# GC1-NOT: Name: f74# GC1:     Name: g75# GC1-NOT: Name: h76# GC1-NOT: Name: x77# GC1-NOT: Name: y78# GC1-NOT: Name: d79 80# GC2:     Name: .eh_frame81# GC2:     Name: .text82# GC2:     Name: .init83# GC2:     Name: .fini84# GC2:     Name: .tdata85# GC2:     Name: .tbss86# GC2:     Name: .ctors87# GC2:     Name: .dtors88# GC2:     Name: .fini_array89# GC2:     Name: .init_array90# GC2:     Name: .preinit_array91# GC2:     Name: .jcr92# GC2:     Name: .debug_pubtypes93# GC2:     Name: .comment94# GC2:     Name: a95# GC2:     Name: b96# GC2:     Name: c97# GC2:     Name: e98# GC2-NOT: Name: f99# GC2:     Name: g100# GC2-NOT: Name: h101# GC2-NOT: Name: x102# GC2-NOT: Name: y103# GC2:     Name: d104 105.globl _start, d106.protected a, b, c, e, f, g, h, x, y107_start:108  call a109 110.section .text.a,"ax",@progbits111a:112  call _start113  call b114 115.section .text.b,"ax",@progbits116b:117  leaq e@tpoff(%rax),%rdx118  call c119 120.section .text.c,"ax",@progbits121c:122  leaq g@tpoff(%rax),%rdx123 124.section .text.d,"ax",@progbits125d:126  nop127 128.section .text.x,"ax",@progbits129x:130  call y131 132.section .text.y,"ax",@progbits133y:134  call x135 136.section .tbss.e,"awT",@nobits137e:138  .quad 0139 140.section .tbss.f,"awT",@nobits141f:142  .quad 0143 144.section .tdata.g,"awT",@progbits145g:146  .quad 0147 148.section .tdata.h,"awT",@progbits149h:150  .quad 0151 152.section .ctors,"aw",@progbits153  .quad 0154 155.section .dtors,"aw",@progbits156  .quad 0157 158.section .init,"ax"159  .quad 0160 161.section .init_x,"ax"162  .quad 0163 164.section .fini,"ax"165  .quad 0166 167.section .fini_array,"aw",@fini_array168  .quad 0169 170# https://golang.org/cl/373734171.section .init_array,"aw",@progbits172  .quad 0173 174# Work around https://github.com/rust-lang/rust/issues/92181175.section .init_array.00001,"aw",@progbits176  .quad 0177 178.section .preinit_array,"aw",@preinit_array179  .quad 0180 181.section .jcr,"aw"182  .quad 0183 184.section .jcr_x,"aw"185  .quad 0186 187.section .eh_frame,"a",@unwind188  .quad 0189 190.section .debug_pubtypes,"",@progbits191  .quad 0192 193.section .comment,"MS",@progbits,8194  .quad 0195