brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 4bd1eca Raw
55 lines · plain
1# REQUIRES: x862 3# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o4# RUN: ld.lld -pie %t.o --icf=all --print-icf-sections -o /dev/null | \5# RUN:   FileCheck --check-prefixes=EXE %s6 7# RUN: ld.lld -shared %t.o --icf=all --print-icf-sections -o /dev/null | \8# RUN:   FileCheck --check-prefix=DSO %s9 10## Definitions are non-preemptible in an executable.11# EXE-NOT:  {{.}}12# EXE:      selected section {{.*}}:(.text.g1)13# EXE-NEXT:   removing identical section {{.*}}:(.text.g2)14# EXE-NEXT:   removing identical section {{.*}}:(.text.g3)15# EXE-NEXT: selected section {{.*}}:(.text.f1)16# EXE-NEXT:   removing identical section {{.*}}:(.text.f2)17# EXE-NEXT: selected section {{.*}}:(.text.h1)18# EXE-NEXT:   removing identical section {{.*}}:(.text.h2)19# EXE-NEXT:   removing identical section {{.*}}:(.text.h3)20# EXE-NOT:  {{.}}21 22## Definitions are preemptible in a DSO. Only leaf functions can be folded.23# DSO-NOT:  {{.}}24# DSO:      selected section {{.*}}:(.text.g1)25# DSO-NEXT:   removing identical section {{.*}}:(.text.g3)26# DSO-NEXT: selected section {{.*}}:(.text.f1)27# DSO-NEXT:   removing identical section {{.*}}:(.text.f2)28# DSO-NOT:  {{.}}29 30.globl _start, f1, f2, g1, g2, g331_start:32 33.section .text.f134f1: ret35.section .text.f236f2: ret37 38## In -shared mode, .text.g1 and .text.g2 cannot be folded because f1 and f2 are39## preemptible and may refer to different functions at runtime.40.section .text.g141g1: jmp f1@plt42.section .text.g243g2: jmp f2@plt44.section .text.g345g3: jmp f1@plt46 47## In -shared mode, the sections below cannot be folded because g1, g2 and g348## are preemptible and may refer to different functions at runtime.49.section .text.h150jmp g1@plt51.section .text.h252jmp g2@plt53.section .text.h354jmp g3@plt55