brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · a02324c Raw
42 lines · plain
1# REQUIRES: x862# RUN: rm -rf %t; split-file %s %t3# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o4# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/weakfoo.s -o %t/weakfoo.o5# RUN: not %lld -lSystem %t/test.o %t/weakfoo.o -o /dev/null 2>&1 | FileCheck %s6 7# CHECK:      error: duplicate symbol: _weakfoo8# CHECK-NEXT: >>> defined in {{.*}}/test.o9# CHECK-NEXT: >>> defined in {{.*}}/weakfoo.o10 11## Duplicate absolute symbols that will be dead stripped later should not fail.12# RUN: %lld -lSystem -dead_strip --dead-strip-duplicates -map %t/stripped-duplicate-map \13# RUN:     %t/test.o %t/weakfoo.o -o %t/test14# RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=DUP15# DUP-LABEL: SYMBOL TABLE:16# DUP-NEXT:   g F __TEXT,__text _main17# DUP-NEXT:   g F __TEXT,__text __mh_execute_header18# DUP-NEXT:   *UND* dyld_stub_binder19 20## Dead stripped non-section symbols don't show up in map files because there's no input section.21## Check that _weakfoo doesn't show up. This matches ld64.22# RUN: FileCheck --check-prefix=DUPMAP %s < %t/stripped-duplicate-map23# DUPMAP: _main24# DUPMAP-LABEL: Dead Stripped Symbols25# DUPMAP-NOT: _weakfoo26 27#--- weakfoo.s28.globl _weakfoo29## The weak attribute is ignored for absolute symbols, so we will have a30## duplicate symbol error for _weakfoo.31.weak_definition _weakfoo32_weakfoo = 0x123433 34#--- test.s35.globl _main, _weakfoo36.weak_definition _weakfoo37_weakfoo = 0x567838 39.text40_main:41  ret42