| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
I think it is clear by now that the new linker is viable.
llvm-svn: 262158
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
llvm-svn: 257830
|
|
|
|
|
|
|
|
|
|
|
|
| |
In a UI such as XCode, LLVM source files are in 'libraries' while clang
files are in 'clang libraries'.
This change moves the lld source to 'lld libraries' to make code browsing easier.
It should be NFC as the build itself is still the same, just the structure in a
UI differs.
llvm-svn: 257001
|
|
|
|
| |
llvm-svn: 234938
|
|
|
|
|
|
|
|
| |
We don't need to repeat the template argument. They are not
ambiguous. MIPS is parameterized for ELFT, so we can't do this
for MIPS, though.
llvm-svn: 234913
|
|
|
|
| |
llvm-svn: 234862
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, ELFReader takes three template arguments: EFLT,
LinkingContextT and FileT. FileT is itself templated.
So it was a bit complicated. Maybe too much.
Most architectures don't actually need to be parameterized for ELFT.
For example, x86 is always ELF32LE and x86-64 is ELF64LE.
However, because ELFReader requires a ELFT argument, we needed
to parameterize a class even if not needed.
This patch removes the parameter from the class. So now we can
de-templatize such classes (I didn't do that in this patch, though).
This patch also removes ContextT parameter since it didn't have to be
passed as a template argument.
llvm-svn: 234853
|
|
|
|
| |
llvm-svn: 234823
|
|
|
|
| |
llvm-svn: 234790
|
|
|
|
| |
llvm-svn: 234558
|
|
|
|
| |
llvm-svn: 234397
|
|
|
|
|
|
|
|
| |
It's a follow-up to r234347. We do not need to keep a reference to
`GOTFile` instance in a xxxWriter class after ownership is transferred
to the caller of the `createImplicitFiles` method.
llvm-svn: 234396
|
|
|
|
| |
llvm-svn: 234357
|
|
|
|
| |
llvm-svn: 234356
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now 'writer' creates an instance of `RuntimeFile` in the constructor, then
populates the file in the virtual function `addDefaultAtoms`, then pass
owning of this file to the caller of virtual function `createImplicitFiles`.
First, we do not need to keep an instance of `RuntimeFile` so long. It is
enough to create the file, right after that populate it and pass the owning.
Second, relationship between `createImplicitFiles` and `addDefaultAtoms`
is complicated. The `createImplicitFiles` might call `addDefaultAtoms`,
overridden version of `addDefaultAtoms` might call base class `addDefaultAtoms`,
and overridden version of `createImplicitFiles` might call base class
`createImplicitFiles` as well as `addDefaultAtoms`.
The patch solves both problems above. It creates and populates runtime files
right in the createImplicitFiles(), removes `addDefaultAtoms` at all and
does not keep references to runtime files in class fields.
llvm-svn: 234347
|
|
|
|
|
|
|
| |
All instances of the `createImplicitFiles` always return `true` and this
return value is used nowhere.
llvm-svn: 234205
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 234162
|
|
|
|
|
|
|
|
| |
Functions in the files are hard to read because of line wrapping.
Use shorter names for local variables so that the lines fit
within 80 columns.
llvm-svn: 234087
|
|
|
|
| |
llvm-svn: 234085
|
|
|
|
|
|
|
|
| |
These functions are "constructors" of the LinkingContexts. We already
have auxiliary classes and functions for ELFLinkingContext in the header.
They fall in the same category.
llvm-svn: 234082
|
|
|
|
|
|
|
|
|
|
| |
getRelocationHandler is a public interface to get an instance of
TargetRelocationHandler. We don't use any member function other than
applyRelocations to a returned instance. Returning a base class instance
suffices here. (If a return type is a derived class, it looks like we were
using derived classes features.)
llvm-svn: 234081
|
|
|
|
|
|
|
|
|
|
| |
Because of the previous change (r234074), ELFObjectReader became just
an alias for ELFReader. We can replace all occurrences of ELFObjectReader
with ELFReader.
In this patch, I also replaced ELFDSOReader to remove the alias template.
llvm-svn: 234076
|
|
|
|
|
|
|
|
|
|
|
| |
<Arch>ELFReader.h contains only a few typedefs. The typedefs are used
only by one class in <Arch>TargetHandler.h. Thus, the headers don't
worth to be independent files.
Since MipsELFReader.h contains code other than the boilerplate, I didn't
touch that file in this patch.
llvm-svn: 234056
|
|
|
|
|
|
|
| |
<Arch>TargetHandler.h and <ArcH>RelocationHandler.h include each other.
This patch breaks the circular dependencies.
llvm-svn: 234050
|
|
|
|
|
|
|
|
| |
All <Arch>ELFFileCreateFileTraits structs are the same except its file type.
That means that we don't need to pass the type traits. Instead, we can only
pass file types. By doing this, we can remove copy-pasted boilerplates.
llvm-svn: 234047
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
What we are doing in ELFTarget.h was dubious. In the file, we define
partial classes of <Arch>LinkingContexts to declare only static member
functions. We have different (complete) class definitions in other files.
They would conflict if they exist in the same compilation unit (because
the ones defined in ELFTarget.h has only static member functions).
I don't think this was valid C++.
http://reviews.llvm.org/D8797
llvm-svn: 234039
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 233897
|
|
|
|
| |
llvm-svn: 233896
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
<Arch>ELFLinkingContext.
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
|
|
|
|
| |
llvm-svn: 233880
|
|
|
|
|
|
| |
members.
llvm-svn: 233873
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
<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
|
|
|
|
| |
llvm-svn: 233863
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Only MIPS used that member function, and by removing the use of the
function, I removed a static_cast. Seems like it's a win.
llvm-svn: 233748
|
|
|
|
|
|
|
| |
Apparently they are copy-pastes. They need to be merged, or otherwise
they will diverge needlessly as I did in r233723...
llvm-svn: 233741
|
|
|
|
|
|
|
| |
We have GOTAtom and PLTAtom classes because GOT or PLT are acronyms.
"Dynamic offset table" or "dynamic" are not acronyms.
llvm-svn: 233401
|
|
|
|
| |
llvm-svn: 233344
|
|
|
|
| |
llvm-svn: 233319
|
|
|
|
| |
llvm-svn: 233316
|
|
|
|
|
|
|
|
| |
Most developers prefer to not have them, and we agreed to
remove them from LLD.
http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/083368.html
llvm-svn: 233313
|
|
|
|
|
|
|
| |
The ELF backends now depend on lld::script::Sema, which is in libReaderWriter.
Link it explicitly.
llvm-svn: 232953
|
|
|
|
| |
llvm-svn: 231005
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Nothing wrong with reinterpret_cast<llvm::support::ulittle32_t *>(loc),
but that's redundant and not great from readability point of view.
The new functions are wrappers for that kind of reinterpet_casts.
Surprisingly or unsurprisingly, there was no use of big endian read
and write. {read,write}{16,32,64}be have no user. But I think they
still worth to be there in the header for completeness.
http://reviews.llvm.org/D7927
llvm-svn: 230725
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the LinkingContext parameter to the ELFReader. Previously the flags in
that were needed in the Context was passed to the ELFReader, this made it very
hard to access data structures in the LinkingContext when reading an ELF file.
This change makes the ELFReader more flexible so that required parameters can be
grabbed directly from the LinkingContext.
Future patches make use of the changes.
There is no change in functionality though.
llvm-svn: 228905
|
|
|
|
|
|
|
| |
It looks like the Driver manages search path for each Target lld would support
on the Gnu flavor.
llvm-svn: 228440
|
|
|
|
|
|
|
|
| |
Target specific LinkingContext's determine the default search directory.
No change in functionality.
llvm-svn: 227784
|