Files
clang-p2996/lld/test/ELF/driver.test
George Rimar 786e866fea [ELF] - -pie/--pic-executable option implemented
-pie
--pic-executable

Create a position independent executable.  This is currently only
 supported on ELF platforms.  Position independent executables are
 similar to shared libraries in that they are relocated by the
 dynamic linker to the virtual address the OS chooses for them
 (which can vary between invocations).  Like normal dynamically
 linked executables they can be executed and symbols defined in the
 executable cannot be overridden by shared libraries.

Differential revision: http://reviews.llvm.org/D18183

llvm-svn: 263693
2016-03-17 05:57:33 +00:00

51 lines
1.8 KiB
Plaintext

# REQUIRES: x86
# RUN: not ld.lld --unknown1 --unknown2 -m foo /no/such/file -lnosuchlib \
# RUN: 2>&1 | FileCheck -check-prefix=UNKNOWN %s
# UNKNOWN: warning: unknown argument: --unknown1
# UNKNOWN: warning: unknown argument: --unknown2
# UNKNOWN: unknown argument(s) found
# UNKNOWN: unknown emulation: foo
# UNKNOWN: cannot open /no/such/file
# UNKNOWN: unable to find library -lnosuchlib
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
# RUN: not ld.lld %t -o /no/such/file 2>&1 | FileCheck -check-prefix=MISSING %s
# MISSING: failed to open /no/such/file
# RUN: ld.lld --help 2>&1 | FileCheck -check-prefix=HELP %s
# HELP: USAGE:
# RUN: ld.lld --version 2>&1 | FileCheck -check-prefix=VERSION %s
# VERSION: LLD
## Attempt to link DSO with -r
# RUN: ld.lld -shared %t -o %t.so
# RUN: not ld.lld -r %t.so %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR %s
# ERR: attempted static link of dynamic object
## Attempt to use -r and -shared together
# RUN: not ld.lld -r -shared %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR2 %s
# ERR2: -r and -shared may not be used together
## Attempt to use -r and --gc-sections together
# RUN: not ld.lld -r --gc-sections %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR3 %s
# ERR3: -r and --gc-sections may not be used together
## Attempt to use -r and --icf together
# RUN: not ld.lld -r --icf=all %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR4 %s
# ERR4: -r and --icf may not be used together
## Attempt to use -r and -pie together
# RUN: not ld.lld -r -pie %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR5 %s
# ERR5: -r and -pie may not be used together
## Attempt to use -shared and -pie together
# RUN: not ld.lld -shared -pie %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR6 %s
# ERR6: -shared and -pie may not be used together
.globl _start
_start:
nop