blob: 3432e18bf4daf4010bc14f637a91f43462f83577 [file] [log] [blame] [edit]
// This test checks that the pointers to PLT are properly updated.
// The test uses lld and links against a DSO to ensure PLT entries.
RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
// Non-PIE:
RUN: %clang %cflags -no-pie %p/../Inputs/plt.c %t.so -fuse-ld=lld \
RUN: -o %t.lld.exe -Wl,-q
RUN: llvm-bolt %t.lld.exe -o %t.lld.bolt.exe --use-old-text=0 --lite=0
RUN: %t.lld.bolt.exe | FileCheck %s
// PIE:
RUN: %clang %cflags -fPIC -pie %p/../Inputs/plt.c %t.so -fuse-ld=lld \
RUN: -o %t.lld.pie.exe -Wl,-q
RUN: llvm-bolt %t.lld.pie.exe -o %t.lld.bolt.pie.exe --use-old-text=0 --lite=0
RUN: %t.lld.bolt.pie.exe | FileCheck %s
CHECK: Test completed