result_type is always ErrorOr<unique_ptr<File>>, and since the type traits
is for instantiating ELF files, it's unlikely that we want to return
something else. This patch removes that type.
llvm-svn: 233948
Since we no longer support MSVC 2012, we can assume that variadic
templates are always supported. This patch removes an #ifdef for
C++ compilers that don't support variadic templates.
llvm-svn: 233901
The function call that goes through PLT table may be performed
from both ARM and Thumb code.
This situation requires adding a veneer to original PLT code
(which is always ARM) to effect Thumb-to-ARM transition.
Differential Revision: http://reviews.llvm.org/D8701
llvm-svn: 233900
There is one-to-one correspondence between ELF machine type and a
LinkingContext. We passed them as separate arguments to the constructor.
This patch is to teach the LinkingContexts about their machine types,
so that we don't need to pass that data as separate arguments.
llvm-svn: 233894
Looks like MipsTargetHandler::_runtimeFile is unused.
MipsRuntimeFile doesn't seem to add values to the base class,
so I removed that class too.
llvm-svn: 233888
registerRelocationNames() function is called to register all known
ELF relocation types to the central registry. Since we have separate
LinkingContext class for each ELF machine type, we need to call the
function for each LinkingContext.
However, the function belonged to TargetHandler instead of LinkingContext.
So we needed to do ctx.getTargetHandler().registerRelocationNames().
This patch removes that redundant getTargetHandler call by moving the
function from TargetHandler to LinkingContext.
Conceptually this patch is small, but in reality it's not that small.
It's because the same code is copied to each architecture.
Most of this patch is just repetition. We need to merge them, but
that cannot be done in this patch.
llvm-svn: 233883
Also removed some over-generalization added in r232866, such as
making a function take two parameters and pass two equivalent
arguments to the function.
llvm-svn: 233882
Other createWriter<Arch> functions take <Arch>LinkingContext as arguments.
Only createWriterELF was an exception. This patch makes it consistent with
others.
llvm-svn: 233878
<Arch>TargetHandler::kindString is a static member variable
containg a list of names of relocation types.
The member is used only by one function, registerRelocationNames,
so they don't have to be a static member.
This patch makes the visibility of the data narrower by making
them file-scoped variables in small files.
llvm-svn: 233867
In r233772, I removed an empty class, DefaultTargetHandler, from
the class hierarchy by merging the class with TargetHandler. I then
found that TargetHandler and its base class, TargetHandlerBase,
are also almost the same.
We need to go deeper.
In this patch, I merged TargetHandlerBase with TargetHandler.
The only difference between them is the existence (or absense)
of a pure virtual function registerRelocationName(). I added that
function to the (new) TargetHandler.
One more thing is that TargetHandler was templated for no reason.
I made it non-templated class.
llvm-svn: 233773
DefaultTargetHandler is the base class of all <Arch>TargetHandler classes,
and it's the only derived class of TargetHandler class.
TargetHandler and DefaultTargetHandler are actually the same. They define
the same set of pure virtual functions. DefaultTargetHandler is a useless
class in the class hierarchy -- it shouldn't have been added in the first place.
This patch makes all <Arch>TargetHandler classes directly derive from
TargetHandler and removes DefaultTargetHandler.
llvm-svn: 233772
All calls of findAbsoluteAtoms seem a bit awkward because of the type
of the function. It semantically returns a pointer to an AtomLayout or
nothing, so I made the function return AtomLayout*.
In this patch, I also expanded some "auto"s because their actual type
were not obvious in their contexts.
llvm-svn: 233769
Multiple inheritance is casually used here. Rewriting to not
using multiple inheritance reduces the complexity of the code
and also makes it shorter.
llvm-svn: 233718
Type of `OutputSection::_type` field is int64_t. This change makes
the field's and the argument's types consistent and allows to assign
full range of values to the `OutputSection::_type` field.
llvm-svn: 233617