109 lines · yaml
1# REQUIRES: x862 3## This tests that we can handle relocations that are not sorted by address.4## llvm-mc isn't able to emit such a file, hence the use of yaml2obj. ld645## may emit files with unsorted relocations in `-r` mode, so we need to support6## this.7 8# RUN: yaml2obj %s -o %t.o9# RUN: %lld -dylib -o %t %t.o10# RUN: llvm-objdump --macho -d %t | FileCheck %s11 12# CHECK: _foo:13# CHECK-NEXT: movq _bar(%rip), %rax14# CHECK-NEXT: _bar:15# CHECK-NEXT: movq _baz(%rip), %rax16# CHECK-NEXT: _baz:17# CHECK-NEXT: movq _foo(%rip), %rax18 19--- !mach-o20FileHeader:21 magic: 0xFEEDFACF22 cputype: 0x100000723 cpusubtype: 0x324 filetype: 0x125 ncmds: 226 sizeofcmds: 28027 flags: 0x200028 reserved: 0x029LoadCommands:30 - cmd: LC_SEGMENT_6431 cmdsize: 15232 segname: ''33 vmaddr: 034 vmsize: 2135 fileoff: 31236 filesize: 2137 maxprot: 738 initprot: 739 nsects: 140 flags: 041 Sections:42 - sectname: __text43 segname: __TEXT44 addr: 0x045 size: 2146 offset: 0x13847 align: 048 reloff: 0x15049 nreloc: 350 flags: 0x8000040051 reserved1: 0x052 reserved2: 0x053 reserved3: 0x054 content: 488B0500000000488B0500000000488B050000000055 relocations:56 - address: 0x357 symbolnum: 158 pcrel: true59 length: 260 extern: true61 type: 162 scattered: false63 value: 064 - address: 0x1165 symbolnum: 066 pcrel: true67 length: 268 extern: true69 type: 170 scattered: false71 value: 072 - address: 0xA73 symbolnum: 274 pcrel: true75 length: 276 extern: true77 type: 178 scattered: false79 value: 080 - cmd: LC_SYMTAB81 cmdsize: 2482 symoff: 36083 nsyms: 384 stroff: 40885 strsize: 1686LinkEditData:87 NameList:88 - n_strx: 1189 n_type: 0xE90 n_sect: 191 n_desc: 092 n_value: 093 - n_strx: 694 n_type: 0xE95 n_sect: 196 n_desc: 097 n_value: 798 - n_strx: 199 n_type: 0xE100 n_sect: 1101 n_desc: 0102 n_value: 14103 StringTable:104 - ''105 - _baz106 - _bar107 - _foo108...109