r292496 - [Hexagon] Linux linker does not support .gnu-hash
Sumanth Gundapaneni via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 19 08:54:04 PST 2017
Author: sgundapa
Date: Thu Jan 19 10:54:04 2017
New Revision: 292496
URL: http://llvm.org/viewvc/llvm-project?rev=292496&view=rev
Log:
[Hexagon] Linux linker does not support .gnu-hash
Hexagon Linux dynamic loader does not use (in fact does not support)
.gnu-hash
Differential Revision: https://reviews.llvm.org/D28865
Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/test/Driver/linux-ld.c
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=292496&r1=292495&r2=292496&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Thu Jan 19 10:54:04 2017
@@ -4122,6 +4122,7 @@ Linux::Linux(const Driver &D, const llvm
const bool IsAndroid = Triple.isAndroid();
const bool IsMips = isMipsArch(Arch);
+ const bool IsHexagon = Arch == llvm::Triple::hexagon;
if (IsMips && !SysRoot.empty())
ExtraOpts.push_back("--sysroot=" + SysRoot);
@@ -4131,7 +4132,8 @@ Linux::Linux(const Driver &D, const llvm
// .gnu.hash needs symbols to be grouped by hash code whereas the MIPS
// ABI requires a mapping between the GOT and the symbol table.
// Android loader does not support .gnu.hash.
- if (!IsMips && !IsAndroid) {
+ // Hexagon linker/loader does not support .gnu.hash
+ if (!IsMips && !IsAndroid && !IsHexagon) {
if (Distro.IsRedhat() || Distro.IsOpenSUSE() ||
(Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick))
ExtraOpts.push_back("--hash-style=gnu");
Modified: cfe/trunk/test/Driver/linux-ld.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-ld.c?rev=292496&r1=292495&r2=292496&view=diff
==============================================================================
--- cfe/trunk/test/Driver/linux-ld.c (original)
+++ cfe/trunk/test/Driver/linux-ld.c Thu Jan 19 10:54:04 2017
@@ -705,6 +705,14 @@
// CHECK-PPC64LE-ELFv2: "-m" "elf64lppc"
// CHECK-PPC64LE-ELFv2: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld64.so.2"
//
+// Check that we do not pass --hash-style=gnu or --hash-style=both to
+// hexagon linux linker
+// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=hexagon-linux-gnu \
+// RUN: | FileCheck --check-prefix=CHECK-HEXAGON %s
+// CHECK-HEXAGON: "{{.*}}hexagon-link{{(.exe)?}}"
+// CHECK-HEXAGON-NOT: "--hash-style={{gnu|both}}"
+//
// Check that we do not pass --hash-style=gnu and --hash-style=both to linker
// and provide correct path to the dynamic linker and emulation mode when build
// for MIPS platforms.
More information about the cfe-commits
mailing list