This converts the writeFile method, as well as some of the ones it calls
in the normalized binary file writer and yaml writer.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@264961 91177308-0d34-0410-b5e6-96231b3b80d8
This is to enable isa<> support for any files which need it.
It will be used in an upcoming patch to differentiate MachOFile from other implicitly generated files.
Reviewed by Lang Hames.
Differential Revision: http://reviews.llvm.org/D16103
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@257830 91177308-0d34-0410-b5e6-96231b3b80d8
It's not our business to resolve those undefined symbols.
We just trust the linker will load the library and its dependencies
correctly, which is actually what happens, modulo bugs in the dynamic
linker itself.
PR: 23035
Differential Revision: http://reviews.llvm.org/D8886
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@234378 91177308-0d34-0410-b5e6-96231b3b80d8
All instances of the `createImplicitFiles` always return `true` and this
return value is used nowhere.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@234205 91177308-0d34-0410-b5e6-96231b3b80d8
Use the environment variable "LLD_RUN_ROUNDTRIP_TEST" in the test that you want
to disable, as
RUN: env LLD_RUN_ROUNDTRIP_TEST= <run>
This was a patch that I made, but I find this a better way to accomplish what we
want to do.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@228376 91177308-0d34-0410-b5e6-96231b3b80d8
Before this patch there was a cyclic dependency between lldCore and
lldReaderWriter. Only lldConfig could be built as a shared library.
* Moved Reader and Writer base classes into lldCore.
* The following shared libraries can now be built:
lldCore
lldYAML
lldNative
lldPasses
lldReaderWriter
Differential Revision: http://reviews.llvm.org/D7105
From: Greg Fitzgerald <garious@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@226732 91177308-0d34-0410-b5e6-96231b3b80d8
RoundTripPasses should always be called in DEBUG mode if the environment
variable "LLD_RUN_ROUNDTRIP_TEST" is set.
Flavors should not be able to override this behavior.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@223073 91177308-0d34-0410-b5e6-96231b3b80d8
This would allow other flavor specific contexts to override the default value,
if they want to optionally run the round trip passes.
There is some information lost like the original file owner of the atom with
RoundTripPasses. The Gnu flavor needs this information inorder to implement
LinkerScript matching and for other diagnostic outputs such as Map files.
The flag also can be used to record information in the Atom if the information
to the Writer needs to be conveyed through References too.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@222983 91177308-0d34-0410-b5e6-96231b3b80d8
No functionality change. This removes a down-cast from LinkingContext to
MachOLinkingContext.
Also, remove const from LinkingContext::createImplicitFiles() to remove
the need for another const cast. Seems reasonable for createImplicitFiles()
to need to modify the context (MachOLinkingContext does).
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@218796 91177308-0d34-0410-b5e6-96231b3b80d8
Alias symbols are SimpleDefinedAtoms and are platform neutral. They
don't have to belong ELF. This patch is to make it available to all
platforms. No functionality change intended.
Differential Revision: http://reviews.llvm.org/D3862
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@209475 91177308-0d34-0410-b5e6-96231b3b80d8
LinkingContext and InputGraph are unnecessarily entangled. Most linker
input file data, e.g. the vector containing input files, the next index
of the input file, etc. are managed by InputGraph, but only the current
input file is for no obvious reason managed by LinkingContext.
This patch is to move code from LinkingContext to InputGraph to fix it.
It's now clear who's reponsible for managing input file state, which is
InputGraph, and LinkingContext is now free from that responsibility.
It improves the readability as we now have fewer dependencies between
classes. No functionality change.
Differential Revision: http://llvm-reviews.chandlerc.com/D3259
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205394 91177308-0d34-0410-b5e6-96231b3b80d8
This patch is to support --defsym option for ELF file format/GNU-compatible
driver. Currently it takes a symbol name followed by '=' and a number. If such
option is given, the driver sets up an absolute symbol with the specified
address. You can specify multiple --defsym options to define multiple symbols.
GNU LD's --defsym provides many more features. For example, it allows users to
specify another symbol name instead of a number to define a symbol alias, or it
even allows a symbol plus an offset (e.g. --defsym=foo+3) to define symbol-
relative alias. This patch does not support that, but will be supported in
subsequent patches.
Differential Revision: http://llvm-reviews.chandlerc.com/D3208
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205029 91177308-0d34-0410-b5e6-96231b3b80d8