Skip to content

Commit

Permalink
[Driver][Fuchsia] Pass --hash-style=gnu to the linker
Browse files Browse the repository at this point in the history
The .gnu_hash format is superior, and all versions of the Fuchsia
dynamic linker support it.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310017 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
petrhosek committed Aug 4, 2017
1 parent aa72e29 commit 7a3bb94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Driver/ToolChains/Fuchsia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ void fuchsia::Linker::ConstructJob(Compilation &C, const JobAction &JA,
if (Args.hasArg(options::OPT_s))
CmdArgs.push_back("-s");

if (Args.hasArg(options::OPT_r))
if (Args.hasArg(options::OPT_r)) {
CmdArgs.push_back("-r");
else
} else {
CmdArgs.push_back("--build-id");
CmdArgs.push_back("--hash-style=gnu");
}

CmdArgs.push_back("--eh-frame-hdr");

Expand Down
1 change: 1 addition & 0 deletions test/Driver/fuchsia.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// CHECK: "--sysroot=[[SYSROOT]]"
// CHECK: "-pie"
// CHECK: "--build-id"
// CHECK: "--hash-style=gnu"
// CHECK: "-dynamic-linker" "ld.so.1"
// CHECK: Scrt1.o
// CHECK-NOT: crti.o
Expand Down

0 comments on commit 7a3bb94

Please sign in to comment.