brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · 53e8153 Raw
113 lines · plain
1# RUN: yaml2obj %s -o %t2# RUN: cp %t %t33# RUN: llvm-objcopy --strip-debug %t %t24## Test that debug sections (but not linking or names) are stripped with --strip-debug5# RUN: obj2yaml %t2 | FileCheck --implicit-check-not=.debug %s6#7# RUN: llvm-objcopy -g %t %t2g8# Verify that --strip-debug and -g produce the same output9# RUN: cmp %t2 %t2g10 11# RUN: llvm-strip --strip-debug %t312# RUN: cmp %t2 %t313 14# RUN: cp %t %t415# RUN: llvm-strip -d %t416# RUN: cmp %t2 %t417 18# RUN: cp %t %t519# RUN: llvm-strip -g %t520# RUN: cmp %t2 %t521 22# RUN: cp %t %t623# RUN: llvm-strip -S %t624# RUN: cmp %t2 %t625 26# Verify that an archive with multiple object files is handled correctly.27# RUN: cp %t %t.duplicate28# RUN: cp %t2 %t.duplicate.stripped29# RUN: rm -f %t.multiple-stripped-obj.a30# RUN: llvm-ar crs %t.multiple-stripped-obj.a %t2 %t.duplicate.stripped31# RUN: rm -f %t.multiple-obj.a32# RUN: llvm-ar crs %t.multiple-obj.a %t %t.duplicate33# RUN: llvm-objcopy --strip-debug %t.multiple-obj.a %t.multiple-obj.stripped.a34# RUN: llvm-ar p %t.multiple-stripped-obj.a > %t.multiple-stripped-obj.a.dump35# RUN: llvm-ar p %t.multiple-obj.stripped.a > %t.multiple-obj.stripped.a.dump36# RUN: cmp %t.multiple-stripped-obj.a.dump %t.multiple-obj.stripped.a.dump37 38# CHECK:      Sections:39# CHECK-NEXT:   - Type: TYPE40# CHECK:        - Type: CUSTOM41## We expect the linking section to be preceeded by the removed `.debug_info`42## section.43# CHECK-NEXT:     Name:            .objcopy.removed44# CHECK-NEXT:     Payload:         ''45# CHECK-NEXT:   - Type: CUSTOM46# CHECK-NEXT:     Name: linking47# CHECK:          Name: name48# CHECK-NEXT:     FunctionNames:49# CHECK:          Name: producers50## Following the producers section we expect to find three removed sections.51## The `.debug_line` section that two reloction section corresponding to the52## two debug sections.53# CHECK:        - Type:            CUSTOM54# CHECK-NEXT:     Name:            .objcopy.removed55# CHECK-NEXT:     Payload:         ''56# CHECK-NEXT:   - Type:            CUSTOM57# CHECK-NEXT:     Name:            .objcopy.removed58# CHECK-NEXT:     Payload:         ''59# CHECK-NEXT:   - Type:            CUSTOM60# CHECK-NEXT:     Name:            .objcopy.removed61# CHECK-NEXT:     Payload:         ''62 63 64--- !WASM65FileHeader:66  Version: 0x0000000167Sections:68  - Type: TYPE69    Signatures:70      - Index: 071        ParamTypes: []72        ReturnTypes: []73  - Type: FUNCTION74    FunctionTypes: [ 0 ]75  - Type: CODE76    Functions:77      - Index: 078        Locals: []79        Body: 0B80  - Type: CUSTOM81    Name: .debug_info82    Payload: 'CAFE123456'83    Relocations:84      - Type:   R_WASM_FUNCTION_INDEX_LEB85        Index:  086        Offset: 0x000000087  - Type:            CUSTOM88    Name:            linking89    Version:         290    SymbolTable:91      - Index:           092        Kind:            FUNCTION93        Name:            foo94        Flags:           [ BINDING_LOCAL ]95        Function:        096  - Type: CUSTOM97    Name: name98    FunctionNames:99     - Index:          0100       Name:           foo101  - Type: CUSTOM102    Name: producers103    Tools:104      - Name:   clang105        Version: 9.0.0106  - Type: CUSTOM107    Name: .debug_line108    Payload: 'DEADBEEF01'109    Relocations:110      - Type:   R_WASM_FUNCTION_INDEX_LEB111        Index:  0112        Offset: 0x0000000113