2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3 # RUN: ld.lld %t.o -o %t --export-dynamic
4 # RUN: llvm-readelf -r --hex-dump=.data %t | FileCheck %s --check-prefix=NOPIC
5 # RUN: ld.lld %t.o -o %t.pie -pie
6 # RUN: llvm-readobj -r %t.pie | FileCheck %s --check-prefix=PIC
7 # RUN: ld.lld %t.o -o %t.so -shared
8 # RUN: llvm-readobj -r %t.so | FileCheck %s --check-prefix=PIC
10 ## gABI leaves the behavior of weak undefined references implementation defined.
11 ## We choose to resolve them statically for -no-pie and produce dynamic relocations
12 ## for -pie and -shared.
14 ## Note: Some ports of GNU ld support -z nodynamic-undefined-weak that we don't
17 # NOPIC: no relocations
18 # NOPIC: Hex dump of section '.data':
19 # NOPIC-NEXT: {{.*}} 00000000 00000000
23 # PIC-NEXT: R_X86_64_64 foobar 0x0