Skip to content

Commit

Permalink
[ELF] Rewrite --symbol-ordering-file path in reproducer
Browse files Browse the repository at this point in the history
The --symbol-ordering-file path was not being rewritten in the response file when
using --reproduce. This patch adds this to the list of switches that are rewritten,
so that the path is somewhere within the reproducer directory tree.

Reviewers: ruiu

Differential Revision: https://reviews.llvm.org/D37480

llvm-svn: 312626
  • Loading branch information
jh7370 committed Sep 6, 2017
1 parent c2dffe3 commit 1304e8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions lld/ELF/DriverUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ std::string elf::createResponseFile(const opt::InputArgList &Args) {
case OPT_library_path:
case OPT_rpath:
case OPT_script:
case OPT_symbol_ordering_file:
case OPT_version_script:
OS << Arg->getSpelling() << " " << quote(rewritePath(Arg->getValue()))
<< "\n";
Expand Down
10 changes: 7 additions & 3 deletions lld/test/ELF/reproduce.s
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@
# RUN: echo "{};" > dyn
# RUN: echo > file
# RUN: echo > file2
# RUN: echo "_start" > order
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o 'foo bar'
# RUN: ld.lld --reproduce repro2.tar 'foo bar' -L"foo bar" -Lfile -Tfile2 \
# RUN: --dynamic-list dyn -rpath file --script=file --version-script ver \
# RUN: --dynamic-linker "some unusual/path" -soname 'foo bar' -soname='foo bar'
# RUN: --dynamic-list dyn -rpath file --script=file --symbol-ordering-file order \
# RUN: --version-script ver --dynamic-linker "some unusual/path" -soname 'foo bar' \
# RUN: -soname='foo bar'
# RUN: tar xf repro2.tar
# RUN: FileCheck %s --check-prefix=RSP2 < repro2/response.txt
# RSP2: --chroot .
Expand All @@ -47,14 +49,16 @@
# RSP2-NEXT: --dynamic-list {{.+}}dyn
# RSP2-NEXT: -rpath {{.+}}file
# RSP2-NEXT: --script {{.+}}file
# RSP2-NEXT: --version-script [[PATH:.*]]ver
# RSP2-NEXT: --symbol-ordering-file [[PATH:.+]]order
# RSP2-NEXT: --version-script [[PATH]]ver
# RSP2-NEXT: --dynamic-linker "some unusual/path"
# RSP2-NEXT: -soname "foo bar"
# RSP2-NEXT: -soname "foo bar"

# RUN: tar tf repro2.tar | FileCheck %s
# CHECK: repro2/response.txt
# CHECK-NEXT: repro2/version.txt
# CHECK-NEXT: repro2/{{.*}}/order
# CHECK-NEXT: repro2/{{.*}}/dyn
# CHECK-NEXT: repro2/{{.*}}/ver
# CHECK-NEXT: repro2/{{.*}}/foo bar
Expand Down

0 comments on commit 1304e8d

Please sign in to comment.