diff options
-rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 4 | ||||
-rw-r--r-- | clang/test/Driver/linux-ld.c | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index 9bc9ae4f6a5..a4e797587cf 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -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"); diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c index 5d1001beb02..e5aa870866d 100644 --- a/clang/test/Driver/linux-ld.c +++ b/clang/test/Driver/linux-ld.c @@ -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. |