brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 63a7030 Raw
44 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64 -save-temp-labels %s -o %t.o3 4# RUN: ld.lld --discard-locals %t.o -o %tlocal5# RUN: llvm-readelf -s %tlocal | FileCheck --check-prefixes=DISCARD-LOCALS,DISCARD-LOCALS-NOGC %s6 7## --gc-sections can discard symbols relative to GCed sections (including STT_SECTION).8# RUN: ld.lld --discard-locals --gc-sections %t.o -o %tlocal.gc9# RUN: llvm-readelf -s %tlocal.gc | FileCheck --check-prefix=DISCARD-LOCALS %s10 11# RUN: ld.lld --discard-all %t.o -o %tall12# RUN: llvm-readelf -s %tall | FileCheck --check-prefix=DISCARD-ALL %s13 14# RUN: ld.lld --discard-all --gc-sections %t.o -o %tall.gc15# RUN: llvm-readelf -s %tall.gc | FileCheck --check-prefix=DISCARD-ALL %s16 17## --discard-locals removes local symbols which start with ".L"18# DISCARD-LOCALS:    0: {{0+}} 0 NOTYPE  LOCAL  DEFAULT UND19# DISCARD-LOCALS-NEXT:           NOTYPE  LOCAL  DEFAULT {{.*}} used20# DISCARD-LOCALS-NEXT:           NOTYPE  LOCAL  DEFAULT {{.*}} unused21# DISCARD-LOCALS-NOGC-NEXT:      NOTYPE  LOCAL  DEFAULT {{.*}} unused_gc22# DISCARD-LOCALS-NEXT:           NOTYPE  GLOBAL DEFAULT {{.*}} _start23 24## --discard-all removes all regular local symbols.25# DISCARD-ALL:       0: {{0+}} 0 NOTYPE  LOCAL  DEFAULT UND26# DISCARD-ALL-NEXT:              NOTYPE  GLOBAL DEFAULT {{.*}} _start27 28.globl _start29_start:30  call text@plt31  jmp .Lused@plt32  call used@plt33 34.section text,"ax"35.Lunused:36.Lused:37unused:38used:39 40.section gc,"ax"41.Lunused_gc:42unused_gc:43  ret44