brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.8 KiB · 924a4d3 Raw
110 lines · plain
1# RUN: yaml2obj %s -o %t.in.o2#3# RUN: llvm-objdump --section-headers %t.in.o | FileCheck %s --check-prefixes=SECTIONS,SECTIONS-PRE4# RUN: llvm-objdump -t %t.in.o | FileCheck %s --check-prefixes=SYMBOLS,SYMBOLS-PRE5#6# RUN: llvm-objcopy --strip-debug %t.in.o %t.out.o7# RUN: llvm-objdump --section-headers %t.out.o | FileCheck %s --check-prefixes=SECTIONS8# RUN: llvm-objdump -t %t.out.o | FileCheck %s --check-prefixes=SYMBOLS9#10# Test that --strip-all, --strip-all-gnu, --discard-all and --strip-unneeded,11# plus llvm-strip without arguments all produce a similiar set of sections12# (while they remove symbols differently).13#14# RUN: llvm-objcopy --strip-all %t.in.o %t.strip-all.o15# RUN: llvm-objdump --section-headers %t.strip-all.o | FileCheck %s --check-prefixes=SECTIONS16#17# RUN: llvm-objcopy --strip-all-gnu %t.in.o %t.strip-all-gnu.o18# RUN: llvm-objdump --section-headers %t.strip-all-gnu.o | FileCheck %s --check-prefixes=SECTIONS19#20# RUN: llvm-objcopy --discard-all %t.in.o %t.discard-all.o21# RUN: llvm-objdump --section-headers %t.discard-all.o | FileCheck %s --check-prefixes=SECTIONS22#23# RUN: llvm-objcopy --discard-all %t.in.o %t.strip-unneeded.o24# RUN: llvm-objdump --section-headers %t.strip-unneeded.o | FileCheck %s --check-prefixes=SECTIONS25#26# SECTIONS:        Sections:27# SECTIONS-NEXT:   Idx Name28# SECTIONS-NEXT:     0      .text29# SECTIONS-NEXT:     1      .data30# SECTIONS-NEXT:     2      .bss31# SECTIONS-NEXT:     3      .xdata32# SECTIONS-NEXT:     4      .reloc33# SECTIONS-PRE-NEXT: 5      .debug_discardable34# SECTIONS-NEXT:     {{.*}} .debug_undiscardable35# SECTIONS-NEXT:     {{.*}} .llvm_addrsig36# SECTIONS-EMPTY:37#38# Test that --strip-debug doesn't remove e.g. unreferenced local symbols.39#40# SYMBOLS:          SYMBOL TABLE:41# SYMBOLS-NEXT:     external42# SYMBOLS-NEXT:     local_unreferenced43# SYMBOLS-PRE-NEXT: debug_discardable_sym44# SYMBOLS-NEXT:     debug_undiscardable_sym45# SYMBOLS-EMPTY:46 47--- !COFF48header:          49  Machine:         IMAGE_FILE_MACHINE_AMD6450  Characteristics: [  ]51sections:        52  - Name:            .text53    Characteristics: [  ]54    Alignment:       455    SectionData:     0000000056  - Name:            .data57    Characteristics: [  ]58    Alignment:       459    SectionData:     0000000060  - Name:            .bss61    Characteristics: [  ]62    Alignment:       463    SectionData:     0000000064  - Name:            .xdata65    Characteristics: [  ]66    Alignment:       467    SectionData:     0000000068  - Name:            .reloc69    Characteristics: [ IMAGE_SCN_MEM_DISCARDABLE ]70    Alignment:       471    SectionData:     0000000072  - Name:            .debug_discardable73    Characteristics: [ IMAGE_SCN_MEM_DISCARDABLE ]74    Alignment:       475    SectionData:     0000000076  - Name:            .debug_undiscardable77    Characteristics: [  ]78    Alignment:       479    SectionData:     0000000080  - Name:            .llvm_addrsig81    Characteristics: [ IMAGE_SCN_LNK_REMOVE ]82    Alignment:       483    SectionData:     0000000084symbols:         85  - Name:            external86    Value:           087    SectionNumber:   188    SimpleType:      IMAGE_SYM_TYPE_NULL89    ComplexType:     IMAGE_SYM_DTYPE_NULL90    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL91  - Name:            local_unreferenced92    Value:           093    SectionNumber:   194    SimpleType:      IMAGE_SYM_TYPE_NULL95    ComplexType:     IMAGE_SYM_DTYPE_NULL96    StorageClass:    IMAGE_SYM_CLASS_STATIC97  - Name:            debug_discardable_sym98    Value:           099    SectionNumber:   6100    SimpleType:      IMAGE_SYM_TYPE_NULL101    ComplexType:     IMAGE_SYM_DTYPE_NULL102    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL103  - Name:            debug_undiscardable_sym104    Value:           0105    SectionNumber:   7106    SimpleType:      IMAGE_SYM_TYPE_NULL107    ComplexType:     IMAGE_SYM_DTYPE_NULL108    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL109...110