brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.0 KiB · daf4567 Raw
141 lines · plain
1# RUN: yaml2obj %s -o %t2# RUN: llvm-objcopy --remove-section=.foo --strip-symbol=unused %t %t.out3# RUN: llvm-readelf -Sr %t.out | FileCheck %s4 5# CHECK:      [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al6# CHECK-NEXT: [ 0]                   NULL            0000000000000000 000000 000000 00      0   0  07# CHECK-NEXT: [ 1] .text             PROGBITS        0000000000000000 {{.*}} 000008 00   A  0   0  08# CHECK-NEXT: [ 2] .crel.text        CREL            0000000000000000 {{.*}} 000022 00      5   1  09# CHECK-NEXT: [ 3] nonalloc          PROGBITS        0000000000000000 {{.*}} 000030 00      0   0  010# CHECK-NEXT: [ 4] .crelnonalloc     CREL            0000000000000000 {{.*}} 00000b 00      5   3  011 12# CHECK:      Relocation section '.crel.text' at offset {{.*}} contains 4 entries:13# CHECK-NEXT:     Offset             Info             Type               Symbol's Value  Symbol's Name + Addend14# CHECK-NEXT: 0000000000000001  {{.*}}           R_X86_64_32            0000000000000000 g1 + 115# CHECK-NEXT: 0000000000000002  {{.*}}           R_X86_64_64            0000000000000000 l1 + 216# CHECK-NEXT: 0000000000000000  {{.*}}           R_X86_64_32S           0000000000000000 g1 - 117# CHECK-NEXT: 0000000000000004  {{.*}}           R_X86_64_32S           0000000000000000 .text - 800000000000000018# CHECK-EMPTY:19# CHECK-NEXT: Relocation section '.crelnonalloc' at offset {{.*}} contains 3 entries:20# CHECK-NEXT:     Offset             Info             Type               Symbol's Value  Symbol's Name + Addend21# CHECK-NEXT: 0000000000000010  {{.*}}           R_X86_64_64            0000000000000000 g1 + 122# CHECK-NEXT: 0000000000000020  {{.*}}           R_X86_64_64            0000000000000000 g2 + 223# CHECK-NEXT: 0000000000000030  {{.*}}           R_X86_64_64                       024 25--- !ELF26FileHeader:27  Class: ELFCLASS6428  Data: ELFDATA2LSB29  Type: ET_REL30  Machine: EM_X86_6431 32Sections:33- Name: .foo34  Type: SHT_PROGBITS35  Flags: [SHF_ALLOC]36- Name: .text37  Type: SHT_PROGBITS38  Content: "0000000000000000"39  Flags: [SHF_ALLOC]40- Name: .crel.text41  Type: SHT_CREL42  Info: .text43  Link: .symtab44  Relocations:45    - Offset: 0x146      Symbol: g147      Type:   R_X86_64_3248      Addend: 149    - Offset: 0x250      Symbol: l151      Type:   R_X86_64_6452      Addend: 253    - Offset: 0x054      Symbol: g155      Type:   R_X86_64_32S56      Addend: 0xffffffffffffffff57    - Offset: 0x458      Symbol: .text59      Type:   R_X86_64_32S60      Addend: 0x800000000000000061- Name: nonalloc62  Type: SHT_PROGBITS63  Size: 0x3064- Name: .crelnonalloc65  Type: SHT_CREL66  Info: nonalloc67  Link: .symtab68  Relocations:69    - Offset: 0x1070      Symbol: g171      Type:   R_X86_64_6472      Addend: 173    - Offset: 0x2074      Symbol: g275      Type:   R_X86_64_6476      Addend: 277    - Offset: 0x3078      Symbol: 079      Type:   R_X86_64_6480 81Symbols:82  - Name: unused83    Section: .text84  - Name: .text85    Type: STT_SECTION86    Section: .text87  - Name:    l188  - Name:    g189    Section: .text90    Value:   0x091    Size:    492    Binding: STB_GLOBAL93  - Name:    g294    Binding: STB_GLOBAL95 96# RUN: yaml2obj --docnum=2 %s -o %t.3297# RUN: llvm-objcopy %t.32 %t.32.out98# RUN: llvm-readobj -r %t.32.out | FileCheck %s --check-prefix=CHECK299 100# CHECK2:      Relocations [101# CHECK2-NEXT:   Section (2) .crel.text {102# CHECK2-NEXT:     0x0 R_X86_64_32S g1 0xFFFFFFFF103# CHECK2-NEXT:     0x4 R_X86_64_32S .text 0x80000000104# CHECK2-NEXT:   }105# CHECK2-NEXT: ]106 107--- !ELF108FileHeader:109  Class: ELFCLASS32110  Data: ELFDATA2LSB111  Type: ET_REL112  Machine: EM_X86_64113 114Sections:115- Name: .text116  Type: SHT_PROGBITS117  Content: "0000000000000000"118  Flags: [SHF_ALLOC]119- Name: .crel.text120  Type: SHT_CREL121  Info: .text122  Link: .symtab123  Relocations:124    - Offset: 0x0125      Symbol: g1126      Type:   R_X86_64_32S127      Addend: 0xffffffff128    - Offset: 0x4129      Symbol: .text130      Type:   R_X86_64_32S131      Addend: 0x80000000132 133Symbols:134  - Name: .text135    Type: STT_SECTION136    Section: .text137  - Name:    g1138    Section: .text139    Size:    4140    Binding: STB_GLOBAL141