]> granicus.if.org Git - clang/commitdiff
[Hexagon] Linux linker does not support .gnu-hash
authorSumanth Gundapaneni <sgundapa@codeaurora.org>
Thu, 19 Jan 2017 16:54:04 +0000 (16:54 +0000)
committerSumanth Gundapaneni <sgundapa@codeaurora.org>
Thu, 19 Jan 2017 16:54:04 +0000 (16:54 +0000)
Hexagon Linux dynamic loader does not use (in fact does not support)
.gnu-hash

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292496 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp
test/Driver/linux-ld.c

index 9bc9ae4f6a523ff670d12360562075ed35cd0d13..a4e797587cfeda833dbfa505516ea6313be32037 100644 (file)
@@ -4122,6 +4122,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
 
   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::Triple &Triple, const ArgList &Args)
   // .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");
index 5d1001beb02c758c40c2f18e2e347a20be0186ae..e5aa870866d242bac69c0e20d954e6a6b671e4c5 100644 (file)
 // 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.