brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.2 KiB · 12f14b5 Raw
135 lines · plain
1## Test that bogus associative section symbols in executables are ignored.2##3## The executable contains two (bogus) associative section symbols, both for4## (parts of) the .rdata section; one pointing at the .debug_info section5## (which will be stripped out) and one pointing at a nonexistent section.6##7## Check that stripping does succeed, and that it doesn't end up removing8## the .rdata section.9 10# RUN: yaml2obj %s -o %t.in.exe11 12# RUN: llvm-strip --strip-debug %t.in.exe -o %t.out.exe13# RUN: llvm-readobj --sections %t.out.exe | FileCheck %s14 15# CHECK: Name: .rdata16 17--- !COFF18OptionalHeader:19  AddressOfEntryPoint: 409620  ImageBase:       536870912021  SectionAlignment: 409622  FileAlignment:   51223  MajorOperatingSystemVersion: 424  MinorOperatingSystemVersion: 025  MajorImageVersion: 026  MinorImageVersion: 027  MajorSubsystemVersion: 528  MinorSubsystemVersion: 229  Subsystem:       IMAGE_SUBSYSTEM_WINDOWS_CUI30  DLLCharacteristics: [  ]31  SizeOfStackReserve: 209715232  SizeOfStackCommit: 409633  SizeOfHeapReserve: 104857634  SizeOfHeapCommit: 409635header:36  Machine:         IMAGE_FILE_MACHINE_AMD6437  Characteristics: [  ]38sections:39  - Name:            .text40    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]41    VirtualAddress:  409642    VirtualSize:     4843    SectionData:     E806000000E802000000C3C3C30F1F00FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF000000000000000044    SizeOfRawData:   51245  - Name:            .rdata46    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]47    VirtualAddress:  819248    VirtualSize:     449    SectionData:     '00000000'50    SizeOfRawData:   51251  - Name:            .debug_info52    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]53    VirtualAddress:  1638454    VirtualSize:     455    SectionData:     '00000000'56    SizeOfRawData:   51257symbols:58  - Name:            .text59    Value:           060    SectionNumber:   161    SimpleType:      IMAGE_SYM_TYPE_NULL62    ComplexType:     IMAGE_SYM_DTYPE_NULL63    StorageClass:    IMAGE_SYM_CLASS_STATIC64    SectionDefinition:65      Length:          1166      NumberOfRelocations: 267      NumberOfLinenumbers: 068      CheckSum:        170369229569      Number:          170  - Name:            '.text$func1'71    Value:           1172    SectionNumber:   173    SimpleType:      IMAGE_SYM_TYPE_NULL74    ComplexType:     IMAGE_SYM_DTYPE_NULL75    StorageClass:    IMAGE_SYM_CLASS_STATIC76    SectionDefinition:77      Length:          178      NumberOfRelocations: 079      NumberOfLinenumbers: 080      CheckSum:        4073549881      Number:          382      Selection:       IMAGE_COMDAT_SELECT_ANY83  - Name:            .rdata84    Value:           085    SectionNumber:   286    SimpleType:      IMAGE_SYM_TYPE_NULL87    ComplexType:     IMAGE_SYM_DTYPE_NULL88    StorageClass:    IMAGE_SYM_CLASS_STATIC89    SectionDefinition:90      Length:          191      NumberOfRelocations: 092      NumberOfLinenumbers: 093      CheckSum:        094      Number:          395      Selection:       IMAGE_COMDAT_SELECT_ASSOCIATIVE96  - Name:            '.text$func2'97    Value:           1298    SectionNumber:   199    SimpleType:      IMAGE_SYM_TYPE_NULL100    ComplexType:     IMAGE_SYM_DTYPE_NULL101    StorageClass:    IMAGE_SYM_CLASS_STATIC102    SectionDefinition:103      Length:          1104      NumberOfRelocations: 0105      NumberOfLinenumbers: 0106      CheckSum:        40735498107      Number:          4108      Selection:       IMAGE_COMDAT_SELECT_ANY109  - Name:            .rdata110    Value:           1111    SectionNumber:   2112    SimpleType:      IMAGE_SYM_TYPE_NULL113    ComplexType:     IMAGE_SYM_DTYPE_NULL114    StorageClass:    IMAGE_SYM_CLASS_STATIC115    SectionDefinition:116      Length:          1117      NumberOfRelocations: 0118      NumberOfLinenumbers: 0119      CheckSum:        0120      Number:          4121      Selection:       IMAGE_COMDAT_SELECT_ASSOCIATIVE122  - Name:            .debug_info123    Value:           0124    SectionNumber:   3125    SimpleType:      IMAGE_SYM_TYPE_NULL126    ComplexType:     IMAGE_SYM_DTYPE_NULL127    StorageClass:    IMAGE_SYM_CLASS_STATIC128    SectionDefinition:129      Length:          4130      NumberOfRelocations: 0131      NumberOfLinenumbers: 0132      CheckSum:        0133      Number:          0134...135