brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · 59af3d7 Raw
87 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %tfile0.o3# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/common-filespec1.s -o %tfile1.o4# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/common-filespec2.s -o %tfile2.o5# RUN: echo "SECTIONS { .common.incl : { *(EXCLUDE_FILE (*file2.o) COMMON) } .common.excl : { *(COMMON) } }" > %t.script6# RUN: ld.lld -o %t1 --script %t.script %tfile0.o %tfile1.o %tfile2.o7# RUN: llvm-readobj -S --symbols %t1 | FileCheck %s8 9# Commons from file0 and file1 are not excluded, so they must be in .common.incl10# Commons from file2 are excluded from the first rule and should be caught by11# the second in .common.excl12# CHECK:       Section {13# CHECK:         Index:14# CHECK:         Name: .common.incl15# CHECK-NEXT:    Type: SHT_NOBITS16# CHECK-NEXT:    Flags [17# CHECK-NEXT:      SHF_ALLOC18# CHECK-NEXT:      SHF_WRITE19# CHECK-NEXT:    ]20# CHECK-NEXT:    Address: 0x821# CHECK-NEXT:    Offset: 0x22# CHECK-NEXT:    Size: 1623# CHECK-NEXT:    Link: 024# CHECK-NEXT:    Info: 025# CHECK-NEXT:    AddressAlignment: 826# CHECK-NEXT:    EntrySize: 027# CHECK-NEXT:  }28# CHECK:       Section {29# CHECK:         Index:30# CHECK:         Name: .common.excl31# CHECK-NEXT:    Type: SHT_NOBITS32# CHECK-NEXT:    Flags [33# CHECK-NEXT:      SHF_ALLOC34# CHECK-NEXT:      SHF_WRITE35# CHECK-NEXT:    ]36# CHECK-NEXT:    Address: 0x2037# CHECK-NEXT:    Offset: 0x38# CHECK-NEXT:    Size: 4839# CHECK-NEXT:    Link: 040# CHECK-NEXT:    Info: 041# CHECK-NEXT:    AddressAlignment: 1642# CHECK-NEXT:    EntrySize: 043# CHECK-NEXT:  }44# CHECK:       Symbol {45# CHECK:         Name: common_multiple46# CHECK-NEXT:    Value: 0x2047# CHECK-NEXT:    Size: 3248# CHECK-NEXT:    Binding: Global49# CHECK-NEXT:    Type: Object50# CHECK-NEXT:    Other: 051# CHECK-NEXT:    Section: .common.excl52# CHECK-NEXT:  }53# CHECK:       Symbol {54# CHECK:         Name: common_uniq_055# CHECK-NEXT:    Value: 0x856# CHECK-NEXT:    Size: 457# CHECK-NEXT:    Binding: Global58# CHECK-NEXT:    Type: Object59# CHECK-NEXT:    Other: 060# CHECK-NEXT:    Section: .common.incl61# CHECK-NEXT:  }62# CHECK:       Symbol {63# CHECK:         Name: common_uniq_164# CHECK-NEXT:    Value: 0x1065# CHECK-NEXT:    Size: 866# CHECK-NEXT:    Binding: Global67# CHECK-NEXT:    Type: Object68# CHECK-NEXT:    Other: 069# CHECK-NEXT:    Section: .common.incl70# CHECK-NEXT:  }71# CHECK:       Symbol {72# CHECK:         Name: common_uniq_273# CHECK-NEXT:    Value: 0x4074# CHECK-NEXT:    Size: 1675# CHECK-NEXT:    Binding: Global76# CHECK-NEXT:    Type: Object77# CHECK-NEXT:    Other: 078# CHECK-NEXT:    Section: .common.excl79# CHECK-NEXT:  }80 81.globl _start82_start:83  jmp _start84 85.comm common_multiple,8,886.comm common_uniq_0,4,487