[PATCH] [lld][ELF] Add linker script ENTRY command
Rui Ueyama
ruiu at google.com
Mon May 20 21:56:19 PDT 2013
bool Driver::link(TargetInfo targetInfo, const std::vector<LinkerInput> &inputs, raw_ostream &diagnostics);
Got it and agreed. That signature turned out that it doesn't really work because object slicing of targetInfo, so I'll change this slightly. I'll move LinkerInputs out of TargetInfo in a different patch.
================
Comment at: include/lld/Core/TargetInfo.h:248-257
@@ -247,2 +247,12 @@
+ /// This method is called by core linking to fix missing options that were
+ /// not specified by linker script or object file.
+ ///
+ /// On GNU, many linker options can be specified by linker script. On
+ /// Windows, object files may contain linker options. Because of that
+ /// reason, we do not have a complete list of linker options until all input
+ /// files are parsed. This method is supposed to set missing options that
+ /// were not specified neither by command line nor linker script or object
+ /// file.
+ virtual void maybeSetDefaultOptions() { };
----------------
Shankar Kalpathi Easwaran wrote:
> This should not be in the base TargetInfo class and the function not exposed to the user.
I will remove this method and leave _entrySymbolName empty. We can compute this value when it's really needed.
================
Comment at: lib/ReaderWriter/ReaderLinkerScript.cpp:85
@@ -84,3 +84,3 @@
std::vector<std::unique_ptr<File> > &result) const {
auto lsf = LinkerScriptFile::create(_targetInfo, std::move(mb));
if (!lsf)
----------------
Shankar Kalpathi Easwaran wrote:
> The _targetInfo should be changed to _elfTargetInfo I think.
LinkerScript does not use ELFTargetInfo-specific methods or fields, so this seems ok.
http://llvm-reviews.chandlerc.com/D833
BRANCH
linker-script-entry
ARCANIST PROJECT
lld
More information about the llvm-commits
mailing list