Index: lib/Core/LinkingContext.cpp =================================================================== --- lib/Core/LinkingContext.cpp +++ lib/Core/LinkingContext.cpp @@ -24,7 +24,7 @@ _warnIfCoalesableAtomsHaveDifferentCanBeNull(false), _warnIfCoalesableAtomsHaveDifferentLoadName(false), _printRemainingUndefines(true), _allowRemainingUndefines(false), - _logInputFiles(false), _allowShlibUndefines(false), + _logInputFiles(false), _allowShlibUndefines(true), _outputFileType(OutputFileType::Default), _nextOrdinal(0) {} LinkingContext::~LinkingContext() {} Index: test/elf/dynamic-undef.test =================================================================== --- test/elf/dynamic-undef.test +++ 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