summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/lib/Core/LinkingContext.cpp2
-rw-r--r--lld/test/elf/dynamic-undef.test8
2 files changed, 7 insertions, 3 deletions
diff --git a/lld/lib/Core/LinkingContext.cpp b/lld/lib/Core/LinkingContext.cpp
index 30eda6bb346..cbcf25c17df 100644
--- a/lld/lib/Core/LinkingContext.cpp
+++ b/lld/lib/Core/LinkingContext.cpp
@@ -24,7 +24,7 @@ LinkingContext::LinkingContext()
_warnIfCoalesableAtomsHaveDifferentCanBeNull(false),
_warnIfCoalesableAtomsHaveDifferentLoadName(false),
_printRemainingUndefines(true), _allowRemainingUndefines(false),
- _logInputFiles(false), _allowShlibUndefines(false),
+ _logInputFiles(false), _allowShlibUndefines(true),
_outputFileType(OutputFileType::Default), _nextOrdinal(0) {}
LinkingContext::~LinkingContext() {}
diff --git a/lld/test/elf/dynamic-undef.test b/lld/test/elf/dynamic-undef.test
index 7506b21b3ca..e803ec1a758 100644
--- a/lld/test/elf/dynamic-undef.test
+++ b/lld/test/elf/dynamic-undef.test
@@ -3,14 +3,18 @@
# to create an executable and a shared library
#
# This test will fail because there are unresolved symbols from the shared
-# library and we are not passing --allow-shlib-undefined
+# library and we are passing --no-allow-shlib-undefined
RUN: not lld -flavor gnu -target x86_64-linux %p/Inputs/tls.x86-64 \
-RUN: %p/Inputs/shared.so-x86-64 -o %t -e main 2> %t1
+RUN: %p/Inputs/shared.so-x86-64 -o %t -e main --no-allow-shlib-undefined 2> %t1
RUN: FileCheck -check-prefix=EXEC %s < %t1
# This test will pass because of --allow-shlib-undefined
RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/tls.x86-64 \
RUN: %p/Inputs/shared.so-x86-64 -o %t -e main --allow-shlib-undefined \
RUN: --defsym=__tls_get_addr=0
+# This test will pass becase --allow-shlib-undefined is the default.
+RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/tls.x86-64 \
+RUN: %p/Inputs/shared.so-x86-64 -o %t -e main \
+RUN: --defsym=__tls_get_addr=0
# Building shared libraries should not fail when there is a undefined symbol.
# Test creation of shared library, this should pass because we are using
# shared option and by default, dynamic library wouldn't create undefined atoms
OpenPOWER on IntegriCloud