From e02ba98f8ff0d62666f9b6bb035ac2d3307fe776 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Thu, 8 Sep 2016 21:18:38 +0000 Subject: [PATCH] [ELF] Fix DT_NEEDED value. Differential Revision: https://reviews.llvm.org/D24363 llvm-svn: 280990 --- lld/ELF/InputFiles.cpp | 3 ++- lld/test/ELF/as-needed-no-reloc.s | 2 +- lld/test/ELF/shared.s | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 9589a50f7a5f..fbe34e694cb0 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -19,6 +19,7 @@ #include "llvm/CodeGen/Analysis.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" +#include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -477,7 +478,7 @@ template void SharedFile::parseSoName() { } this->initStringTable(); - SoName = this->getName(); + SoName = sys::path::filename(this->getName()); if (!DynamicSec) return; diff --git a/lld/test/ELF/as-needed-no-reloc.s b/lld/test/ELF/as-needed-no-reloc.s index 0706ca0a932d..9cbe25cf1767 100644 --- a/lld/test/ELF/as-needed-no-reloc.s +++ b/lld/test/ELF/as-needed-no-reloc.s @@ -16,7 +16,7 @@ # CHECK-NEXT: Other: 0 # CHECK-NEXT: Section: Undefined -# CHECK: NEEDED SharedLibrary ({{.*}}2.so) +# CHECK: NEEDED SharedLibrary (as-needed-no-reloc{{.*}}2.so) .globl _start _start: diff --git a/lld/test/ELF/shared.s b/lld/test/ELF/shared.s index a81a09370999..086cc7345125 100644 --- a/lld/test/ELF/shared.s +++ b/lld/test/ELF/shared.s @@ -119,7 +119,6 @@ // CHECK-NEXT: EntrySize: 8 // CHECK-NEXT: SectionData ( // CHECK: ) -// CHECK-NEXT: } // CHECK: Name: .symtab // CHECK-NEXT: Type: SHT_SYMTAB