82 lines · yaml
1## Check that local private externs -- symbols without N_EXT but with N_PEXT set2## -- are translation-unit-scoped. These symbols may be generated by `ld -r`,3## which emits an object file. Since LLD does not yet support `-r`, we use4## yaml2obj to construct the input.5 6# RUN: rm -rf %t; mkdir %t7# RUN: yaml2obj %s > %t/foo.o8## No duplicate symbol conflict since _foo is not extern9# RUN: %lld -dylib %t/foo.o %t/foo.o -o %t/foo10# RUN: llvm-nm -m %t/foo | FileCheck %s11 12## Note that the symbols in the output are no longer marked as "was a private13## external".14# CHECK: (absolute) non-external _bar15# CHECK: (absolute) non-external _bar16# CHECK: (__DATA,__data) non-external _foo17# CHECK: (__DATA,__data) non-external _foo18 19--- !mach-o20FileHeader:21 magic: 0xFEEDFACF22 cputype: 0x100000723 cpusubtype: 0x324 filetype: 0x125 ncmds: 226 sizeofcmds: 20827 flags: 0x028 reserved: 0x029LoadCommands:30 - cmd: LC_SEGMENT_6431 cmdsize: 15232 segname: ''33 vmaddr: 034 vmsize: 035 fileoff: 27236 filesize: 037 maxprot: 738 initprot: 739 nsects: 140 flags: 041 Sections:42 - sectname: __data43 segname: __DATA44 addr: 0x045 size: 046 offset: 0x11047 align: 048 reloff: 0x049 nreloc: 050 flags: 0x051 reserved1: 0x052 reserved2: 0x053 reserved3: 0x054 content: ''55 - cmd: LC_SYMTAB56 cmdsize: 2457 symoff: 27258 nsyms: 259 stroff: 30460 strsize: 1661LinkEditData:62 NameList:63 - n_strx: 2 ## _foo64 n_type: 0x1E ## N_PEXT | N_SECT65 n_sect: 166 n_desc: 3267 n_value: 068 - n_strx: 7 ## _bar69 n_type: 0x12 ## N_PEXT | N_ABS70 n_sect: 071 n_desc: 072 n_value: 29173 StringTable:74 - ' '75 - _foo76 - _bar77 - ''78 - ''79 - ''80 - ''81...82