67 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t13# RUN: ld.lld --emit-relocs %t1 -o %t24# RUN: llvm-readobj --sections --section-data %t2 | FileCheck %s5 6## Check lf we produce proper relocations when doing merging of SHF_MERGE sections.7 8## Check addends of relocations are: 0x0, 0x8, 0x8, 0x49# CHECK: Section {10# CHECK: Index:11# CHECK: Name: .foo12# CHECK-NEXT: Type: SHT_PROGBITS13# CHECK-NEXT: Flags [14# CHECK-NEXT: SHF_ALLOC15# CHECK-NEXT: SHF_EXECINSTR16# CHECK-NEXT: ]17# CHECK-NEXT: Address:18# CHECK-NEXT: Offset:19# CHECK-NEXT: Size:20# CHECK-NEXT: Link:21# CHECK-NEXT: Info:22# CHECK-NEXT: AddressAlignment:23# CHECK-NEXT: EntrySize:24# CHECK-NEXT: SectionData (25# CHECK-NEXT: 0000: 00000000 08000000 08000000 0400000026# CHECK-NEXT: )27# CHECK-NEXT: }28 29## Check that offsets for AAA is 0x0, for BBB is 0x8 and CCC has offset 0x4.30# CHECK: Section {31# CHECK: Index:32# CHECK: Name: .strings33# CHECK-NEXT: Type: SHT_PROGBITS34# CHECK-NEXT: Flags [35# CHECK-NEXT: SHF_MERGE36# CHECK-NEXT: SHF_STRINGS37# CHECK-NEXT: ]38# CHECK-NEXT: Address:39# CHECK-NEXT: Offset:40# CHECK-NEXT: Size:41# CHECK-NEXT: Link:42# CHECK-NEXT: Info:43# CHECK-NEXT: AddressAlignment:44# CHECK-NEXT: EntrySize:45# CHECK-NEXT: SectionData (46# CHECK-NEXT: |AAA.CCC.BBB.|47# CHECK-NEXT: )48# CHECK-NEXT: }49 50.section .strings,"MS",@progbits,1,unique,1051.Linfo_string0:52 .asciz "AAA"53.Linfo_string1:54 .asciz "BBB"55 56.section .strings,"MS",@progbits,1,unique,2057.Linfo_string2:58 .asciz "BBB"59.Linfo_string3:60 .asciz "CCC"61 62.section .foo,"ax",@progbits63.long .Linfo_string064.long .Linfo_string165.long .Linfo_string266.long .Linfo_string367