[lld] r289146 - Print a warning message if ENTRY() symbol is not found.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 8 14:26:31 PST 2016
Author: ruiu
Date: Thu Dec 8 16:26:31 2016
New Revision: 289146
URL: http://llvm.org/viewvc/llvm-project?rev=289146&view=rev
Log:
Print a warning message if ENTRY() symbol is not found.
Modified:
lld/trunk/ELF/Driver.cpp
lld/trunk/test/ELF/linkerscript/linkerscript.s
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=289146&r1=289145&r2=289146&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Thu Dec 8 16:26:31 2016
@@ -570,7 +570,6 @@ void LinkerDriver::readConfigs(opt::Inpu
Config->SortSection = getSortKind(Args);
Config->Target2 = getTarget2Option(Args);
Config->UnresolvedSymbols = getUnresolvedSymbolOption(Args);
- Config->WarnMissingEntry = (Args.hasArg(OPT_entry) || !Config->Shared);
// --omagic is an option to create old-fashioned executables in which
// .text segments are writable. Today, the option is still in use to
@@ -779,6 +778,7 @@ template <class ELFT> void LinkerDriver:
// Use default entry point name if no name was given via the command
// line nor linker scripts. For some reason, MIPS entry point name is
// different from others.
+ Config->WarnMissingEntry = (!Config->Entry.empty() || !Config->Shared);
if (Config->Entry.empty() && !Config->Relocatable)
Config->Entry = (Config->EMachine == EM_MIPS) ? "__start" : "_start";
Modified: lld/trunk/test/ELF/linkerscript/linkerscript.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/linkerscript.s?rev=289146&r1=289145&r2=289146&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/linkerscript.s (original)
+++ lld/trunk/test/ELF/linkerscript/linkerscript.s Thu Dec 8 16:26:31 2016
@@ -83,6 +83,12 @@
# ENTRY-SCRIPT: Entry: 0x1
+# RUN: echo "ENTRY(no_such_symbol);" > %t.script
+# RUN: ld.lld -o %t2 %t.script %t 2>&1 | \
+# RUN: FileCheck -check-prefix=ENTRY-MISSING %s
+
+# ENTRY-MISSING: warning: cannot find entry symbol no_such_symbol
+
# RUN: echo "OUTPUT_FORMAT(elf64-x86-64) /*/*/ GROUP(\"%t\" )" > %t.script
# RUN: ld.lld -o %t2 %t.script
# RUN: llvm-readobj %t2 > /dev/null
More information about the llvm-commits
mailing list