| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 234167
|
|
|
|
| |
llvm-svn: 234155
|
|
|
|
|
|
|
| |
The readAddend() does not depend on MipsRelocationHandler and should not
be its member function.
llvm-svn: 234154
|
|
|
|
| |
llvm-svn: 234153
|
|
|
|
|
|
| |
getMergeReginfoMask => getMergedReginfoMask
llvm-svn: 234116
|
|
|
|
|
|
|
|
| |
In case of MIPS N64 ABI linker should merge registers usage masks stored
in the input .MIPS.options sections and save result into the output
.MIPS.options section.
llvm-svn: 234115
|
|
|
|
| |
llvm-svn: 234105
|
|
|
|
|
|
|
|
|
|
|
| |
In case of MIPS O32 ABI linker should merge registers usage masks stored
in the input .reginfo sections and save result into the output .reginfo
section.
The ABI states that the .reginfo section should be put into the separate
segment. This requirement is not implemented in this patch.
llvm-svn: 234103
|
|
|
|
|
|
| |
In all other ELF related classes we use `ELFT` abbreviation.
llvm-svn: 234088
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 234072
|
|
|
|
| |
llvm-svn: 234069
|
|
|
|
|
|
|
|
|
|
| |
Only MIPS defined the member function, but this feature is not actually
MIPS-specific. Also, the dependency to the MIPS-only member function
prevented us from merging <Arch>ELF{Object,DSO}Reader classes.
This patch moves the feature from MipsLinkingContext to LinkingContext.
llvm-svn: 234068
|
|
|
|
|
|
| |
It is enough to have single TargetLayout class.
llvm-svn: 234065
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 234052
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 233924
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
<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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
<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: 233859
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 233812
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 233727
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 233692
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 233618
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 233616
|
|
|
|
|
|
|
|
|
| |
Use of llvm::Optional is redundant here. Initializing by default value 0
is enough.
No functional changes.
llvm-svn: 233549
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 233548
|
|
|
|
|
|
|
|
|
| |
If input relocation records have RELA format while output dynamic
relocations have REL format the only way to transfer a dynamic
relocation addendum is to save it into the location modified by
the dynamic relocation.
llvm-svn: 233532
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
This patch defines implicit conversion between integers and PowerOf2
instances, so uses of the classes is now implicit and look like
regular integers. Now we are ready to remove the scaffolding.
llvm-svn: 233245
|
|
|
|
|
|
|
|
|
| |
the separate function
That keeps "extracting" logic into the single place and removes a VC++
compilation warning.
llvm-svn: 233186
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Visual C++ shows the "right shift by too large amount" warning if
`MipsELFReference` is instantiated for 32-bit target and `Elf_Rel_Impl::getType`
method has `unsigned char` return type. We can freely suppress the warning in
that case because MIPS 32-bit ABI does not pack multiple relocation types into
the single field `r_type` and the `MipsELFReference::_tag` should be always
zero in that case.
No functional changes.
llvm-svn: 233088
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 233058
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
N64 ABI relocation record r_info field in fact consists of five subfields:
* r_sym - symbol index
* r_ssym - special symbol
* r_type3 - third relocation type
* r_type2 - second relocation type
* r_type - first relocation type
Up to three these relocations applied one by one. The first relocation
uses an addendum from the relocation record. Each subsequent relocation
takes as its addend the result of the previous operation. Only the final
operation actually modifies the location relocated. The first relocation
uses as a reference symbol specified by the `r_sym` field. The third
relocation assumes NULL symbol.
The patch represents these data using LLD model and takes in account
additional relocation types during a relocation calculation.
Additional relocations do not introduce any new relations between two
atoms and just specify operations need to be done during a relocation
calculation. The first relocation type (`r_type`) stored in the
`Reference::_kindValue`. The rest of relocations and `r_ssym` value are
stored in the new `Reference::_tag` field "as-is". I decided to do not
"decode" these data on the core LLD level to prevent pollution of the
core LLD model by very target specific data.
Also I have to override writing of relocation records in the `RelocationTable`
class to convert MIPS N64 ABI relocation information from the `Reference`
class back to the ELF relocation record.
http://reviews.llvm.org/D8533
llvm-svn: 233057
|
|
|
|
| |
llvm-svn: 233054
|
|
|
|
|
|
|
| |
The ELF backends now depend on lld::script::Sema, which is in libReaderWriter.
Link it explicitly.
llvm-svn: 232953
|
|
|
|
|
|
|
|
|
|
|
| |
separately
This change reduce difference between the trunk and upcoming patch and
simplify the future code review.
No functional changes.
llvm-svn: 232919
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 232915
|