[lld] c3dbd78 - Revert "[ELF] Improve the condition to create .interp"

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 27 13:05:46 PST 2019


Author: Reid Kleckner
Date: 2019-12-27T13:05:41-08:00
New Revision: c3dbd782f1e0578c7ebc342f2e92f54d9644cff7

URL: https://github.com/llvm/llvm-project/commit/c3dbd782f1e0578c7ebc342f2e92f54d9644cff7
DIFF: https://github.com/llvm/llvm-project/commit/c3dbd782f1e0578c7ebc342f2e92f54d9644cff7.diff

LOG: Revert "[ELF] Improve the condition to create .interp"

This reverts commit 1417558e4a61794347c6bfbafaff7cd96985b2c3.
Also reverts commit 019a92bb2832447092bb5c1faf9d03bb03b8c9c8.

This causes check-sanitizer to fail. The "-Nolib" variant of the test
crashes on startup in the loader.

Added: 
    

Modified: 
    lld/ELF/Writer.cpp
    lld/test/ELF/dynamic-linker.s
    lld/test/ELF/ppc64-func-entry-points.s

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index c20b74821d9c..c0ad33473747 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -135,7 +135,7 @@ StringRef getOutputSectionName(const InputSectionBase *s) {
 }
 
 static bool needsInterpSection() {
-  return !config->shared && !config->dynamicLinker.empty() &&
+  return !sharedFiles.empty() && !config->dynamicLinker.empty() &&
          script->needsInterpSection();
 }
 

diff  --git a/lld/test/ELF/dynamic-linker.s b/lld/test/ELF/dynamic-linker.s
index 4d1dab48aec6..d0da77fab295 100644
--- a/lld/test/ELF/dynamic-linker.s
+++ b/lld/test/ELF/dynamic-linker.s
@@ -1,19 +1,21 @@
 # REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/shared.s -o %t1.o
+# RUN: ld.lld -shared %t1.o -o %t.so
 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
 
-# RUN: ld.lld --dynamic-linker foo %t.o -o %t
+# RUN: ld.lld --dynamic-linker foo %t.o %t.so -o %t
 # RUN: llvm-readelf --program-headers --section-headers %t | FileCheck --implicit-check-not=.bss %s
 
-# RUN: ld.lld --dynamic-linker=foo %t.o -o %t
+# RUN: ld.lld --dynamic-linker=foo %t.o %t.so -o %t
 # RUN: llvm-readelf --program-headers --section-headers %t | FileCheck --implicit-check-not=.bss %s
 
 # CHECK: [Requesting program interpreter: foo]
 
-# RUN: ld.lld %t.o -o %t
+# RUN: ld.lld %t.o %t.so -o %t
 # RUN: llvm-readelf -program-headers %t | FileCheck --check-prefix=NO %s
 
-# RUN: ld.lld --dynamic-linker foo --no-dynamic-linker %t.o -o %t
-# RUN: llvm-readelf --program-headers %t | FileCheck --check-prefix=NO %s
+# RUN: ld.lld --dynamic-linker foo --no-dynamic-linker %t.o %t.so -o %t
+# RUN: llvm-readelf -program-headers %t | FileCheck --check-prefix=NO %s
 
 # NO-NOT: PT_INTERP
 

diff  --git a/lld/test/ELF/ppc64-func-entry-points.s b/lld/test/ELF/ppc64-func-entry-points.s
index c322f6563426..1411cbe1c058 100644
--- a/lld/test/ELF/ppc64-func-entry-points.s
+++ b/lld/test/ELF/ppc64-func-entry-points.s
@@ -3,13 +3,13 @@
 // RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t.o
 // RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %p/Inputs/ppc64-func-global-entry.s -o %t2.o
 // RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %p/Inputs/ppc64-func-local-entry.s -o %t3.o
-// RUN: ld.lld %t.o %t2.o %t3.o -o %t
+// RUN: ld.lld -dynamic-linker /lib64/ld64.so.2 %t.o %t2.o %t3.o -o %t
 // RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
 
 // RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t.o
 // RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %p/Inputs/ppc64-func-global-entry.s -o %t2.o
 // RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %p/Inputs/ppc64-func-local-entry.s -o %t3.o
-// RUN: ld.lld %t.o %t2.o %t3.o -o %t
+// RUN: ld.lld -dynamic-linker /lib64/ld64.so.2 %t.o %t2.o %t3.o -o %t
 // RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
 
 	.text


        


More information about the llvm-commits mailing list