Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
lld/test/ELF/gc-sections-lsda.s
# REQUIRES: x86 | # REQUIRES: x86 | ||||
# RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux | # RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux | ||||
## Discard an unused .gcc_except_table in a COMDAT group or having SHF_LINK_ORDER | ## Discard an unused .gcc_except_table in a COMDAT group or having SHF_LINK_ORDER | ||||
## if the associated text section is discarded. | ## if the associated text section is discarded. | ||||
# RUN: ld.lld --gc-sections --print-gc-sections -u _Z3foov %t.o -o /dev/null | \ | # RUN: ld.lld --gc-sections --print-gc-sections -u _Z3foov %t.o -o /dev/null | \ | ||||
# RUN: FileCheck %s --implicit-check-not=.gcc_except_table | # RUN: FileCheck %s --implicit-check-not=.gcc_except_table | ||||
# CHECK: removing unused section {{.*}}.o:(.text._Z6comdatv) | # CHECK: removing unused section {{.*}}.o:(.text._Z6comdatv) | ||||
# CHECK-NEXT: removing unused section {{.*}}.o:(.text._Z9linkorderv) | # CHECK-NEXT: removing unused section {{.*}}.o:(.text._Z9linkorderv) | ||||
# CHECK-NEXT: removing unused section {{.*}}.o:(.gcc_except_table._Z6comdatv) | # CHECK-NEXT: removing unused section {{.*}}.o:(.gcc_except_table._Z6comdatv) | ||||
# CHECK-NEXT: removing unused section {{.*}}.o:(.gcc_except_table._Z9linkorderv) | # CHECK-NEXT: removing unused section {{.*}}.o:(.gcc_except_table._Z9linkorderv) | ||||
## An unused non-group non-SHF_LINK_ORDER .gcc_except_table is not discarded. | ## An unused non-group non-SHF_LINK_ORDER .gcc_except_table is also discarded. | ||||
# RUN: ld.lld --gc-sections --print-gc-sections -u _Z6comdatv -u _Z9linkorderv %t.o -o /dev/null | \ | # RUN: ld.lld --gc-sections --print-gc-sections -u _Z6comdatv -u _Z9linkorderv %t.o -o /dev/null | \ | ||||
# RUN: FileCheck /dev/null --implicit-check-not=.gcc_except_table | # RUN: FileCheck %s --check-prefix=CHECK2 --implicit-check-not=.gcc_except_table | ||||
# CHECK2: removing unused section {{.*}}.o:(.text) | |||||
# CHECK2-NEXT: removing unused section {{.*}}.o:(.text._Z3foov) | |||||
# CHECK2-NEXT: removing unused section {{.*}}.o:(.gcc_except_table._Z3foov) | |||||
## If the text sections are live, the .gcc_except_table sections are retained as | ## If the text sections are live, the .gcc_except_table sections are retained as | ||||
## well because they are referenced by .eh_frame pieces. | ## well because they are referenced by .eh_frame pieces. | ||||
# RUN: ld.lld --gc-sections --print-gc-sections -u _Z3foov -u _Z6comdatv -u _Z9linkorderv %t.o -o /dev/null | \ | # RUN: ld.lld --gc-sections --print-gc-sections -u _Z3foov -u _Z6comdatv -u _Z9linkorderv %t.o -o /dev/null | \ | ||||
# RUN: FileCheck %s --check-prefix=KEEP | # RUN: FileCheck %s --check-prefix=KEEP | ||||
# KEEP-NOT: .gcc_except_table | # KEEP-NOT: .gcc_except_table | ||||
Show All 36 Lines |