Commit Graph

408 Commits

Author SHA1 Message Date
Rafael Espindola
9327084f92 Simplify by passing in the section of the symbol. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241603 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 16:45:55 +00:00
Rafael Espindola
c2966a3ac7 Remove getRelocationAddress.
Originally added in r139314.

Back then it didn't actually get the address, it got whatever value the
relocation used: address or offset.

The values in different object formats are:

* MachO: Always an offset.
* COFF: Always an address, but when talking about the virtual address of
  sections it says: "for simplicity, compilers should set this to zero".
* ELF: An offset for .o files and and address for .so files. In the case of the
  .so, the relocation in not linked to any section (sh_info is 0). We can't
  really compute an offset.

Some API mappings would be:

* Use getAddress for everything. It would be quite cumbersome. To compute the
  address elf has to follow sh_info, which can be corrupted and therefore the
  method has to return an ErrorOr. The address of the section is also the same
  for every relocation in a section, so we shouldn't have to check the error
  and fetch the value for every relocation.

* Use a getValue and make it up to the user to know what it is getting.

* Use a getOffset and:
 * Assert for dynamic ELF objects. That is a very peculiar case and it is
   probably fair to ask any tool that wants to support it to use ELF.h. The
   only tool we have that reads those (llvm-readobj) already does that. The
   only other use case I can think of is a dynamic linker.
 * Check that COFF .obj files have sections with zero virtual address spaces. If
   it turns out that some assembler/compiler produces these, we can change
   COFFObjectFile::getRelocationOffset to subtract it. Given COFF format,
   this can be done without the need for ErrorOr.

The getRelocationAddress method was never implemented for COFF. It also
had exactly one use in a very peculiar case: a shortcut for adding the
section value to a pcrel reloc on MachO.

Given that, I don't expect that there is any use out there of the C API. If
that is not the case, let me know and I will add it back with the implementation
inlined and do a proper deprecation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241450 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 14:55:37 +00:00
Petar Jovanovic
d095a756cc [Mips] Add support for MCJIT for MIPS32r6
Add support for resolving MIPS32r6 relocations in MCJIT.

Patch by Vladimir Radosavljevic.

Differential Revision: http://reviews.llvm.org/D10687


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241442 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 12:50:55 +00:00
Lang Hames
b21c7647d8 [RuntimeDyld] Skip relocations for external symbols with 64-bit address ~0ULL.
Requested by Eugene Rozenfeld of the LLILC team, this feature allows JIT
clients to skip relocations for selected external symbols by returning ~0ULL
from their symbol resolver. If this value is returned for a given symbol,
RuntimeDyld will skip all relocations for that symbol. The client will be
responsible for applying the skipped relocations manually before the code
is executed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241383 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-04 01:35:26 +00:00
Rafael Espindola
5954faae4d Return ErrorOr from getSymbolAddress.
It can fail trying to get the section on ELF and COFF. This makes sure the
error is handled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241366 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 18:19:00 +00:00
Rafael Espindola
8a80641a85 Return ErrorOr from SymbolRef::getName.
This function can really fail since the string table offset can be out of
bounds.

Using ErrorOr makes sure the error is checked.

Hopefully a lot of the boilerplate code in tools/* can go away once we have
a diagnostic manager in Object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241297 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 20:55:21 +00:00
Rafael Espindola
28a83187a2 Use ErrorOr in getRelocationAdress.
We can probably do better in this method, but this is an improvement and
enables further ErrorOr cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241114 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 20:32:26 +00:00
Rafael Espindola
7ede9649c1 Don't return error_code from a function that doesn't fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241033 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 01:53:01 +00:00
Rafael Espindola
de4d844704 Cleanup getRelocationAddend.
Realistically, this will be returning ErrorOr for some time as refactoring the
user code to check once per section will take some time.

Given that, use it for checking if a relocation has addend or not.

While at it, add ELFRelocationRef to simplify the users.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241028 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 00:33:59 +00:00
Rafael Espindola
ff67629985 Don't return error_code from function that never fails.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241021 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 23:29:12 +00:00
Rafael Espindola
5add4ddba8 Expose getFlags via ELFSectionRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240779 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26 12:44:10 +00:00
Rafael Espindola
db7a9f12bc Add a ELFSectionRef class and use it to expose getSectionType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240778 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26 12:33:37 +00:00
Rafael Espindola
50bea40e8e Simplify getSymbolType.
This is still a really odd function. Most calls are in object format specific
contexts and should probably be replaced with a more direct query, but at least
now this is not too obnoxious to use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240777 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26 12:18:49 +00:00
Rafael Espindola
3e750a4ebf Make getOther ELF only.
No other format has this field.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240774 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26 11:39:57 +00:00
Rafael Espindola
1171dada02 Use Symbol.getValue to simplify RuntimeDyldCOFF::getSymbolOffset. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240572 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 19:27:53 +00:00
Rafael Espindola
821b06f3a8 Change how symbol sizes are handled in lib/Object.
COFF and MachO only define symbol sizes for common symbols. Reflect that
in the class hierarchy by having a method for common symbols only in the base
and a general one in ELF.

This avoids the need of using a magic value for the size, which had a few
problems
* Most callers didn't check for it.
* The ones that did could not tell the magic value from a file actually having
  that value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240529 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 10:20:30 +00:00
Petar Jovanovic
7c5bf4d38a [mips64] Emit correct addend for some PC-relative relocations
So far, LLVM has not emitted correct addend for N64 and N32 ABI. This patch
fixes that. It also removes fixup from MCJIT for R_MIPS_PC16 relocation.

Patch by Vladimir Radosavljevic.

Differential Revision: http://reviews.llvm.org/D10565


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240404 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 13:54:42 +00:00
Alexander Kornienko
cd52a7a381 Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
Apparently, the style needs to be agreed upon first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240390 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 09:49:53 +00:00
Rafael Espindola
7edd010739 Improve error handling of getRelocationAddend.
This patch changes getRelocationAddend to use ErrorOr and considers it an error
to try to get the addend of a REL section.

If, for example, a x86_64 file has a REL section, that file is corrupted and
we should reject it.

Using ErrorOr is not ideal since we check the section type once per relocation
instead of once per section.

Checking once per section would involve getRelocationAddend just asserting and
callers checking the section before iterating over the relocations.

In any case, this is an improvement and includes a test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240176 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 20:58:43 +00:00
Douglas Katzman
ae7a59fa3e Avoid warning about inability to cast from ptr-to-obj to ptr-to-fun.
Use POSIX.1-2003 Technical Corrigendum 1 suggested workaround.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240140 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 17:21:02 +00:00
Alexander Kornienko
cf0db29df2 Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:

tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
  -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
  llvm/lib/


Thanks to Eugene Kosov for the original patch!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240137 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 15:57:42 +00:00
Duncan P. N. Exon Smith
5449852030 modules: Add explicit dependency on intrinsics_gen
`LLVM_ENABLE_MODULES` builds sometimes fail because `Intrinsics.td`
needs to regenerate `Instrinsics.h` before anyone can include anything
from the LLVM_IR module.  Represent the dependency explicitly to prevent
that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239796 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-16 00:44:12 +00:00
Alexei Starovoitov
e11157c668 fix crash
fix segfault by checking for UnknownArch, since
getArchTypePrefix() will return nullptr for UnknownArch.

This fixes regression caused by r238424.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239456 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-10 03:06:06 +00:00
Rui Ueyama
eae4673c2f Remove object_error::success and use std::error_code() instead
make_error_code(object_error) is slow because object::object_category()
uses a ManagedStatic variable. But the real problem is that the function is
called too frequently. This patch uses std::error_code() instead of
object_error::success. In most cases, we return "success", so this patch
reduces number of function calls to that function.

http://reviews.llvm.org/D10333



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239409 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-09 15:20:42 +00:00
Petar Jovanovic
f8aad6c1ef [Mips64][mcjit] Add R_MIPS_PC32 relocation
This patch adds R_MIPS_PC32 relocation for Mips64.

Patch by Vladimir Radosavljevic.

Differential Revision: http://reviews.llvm.org/D10235


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239301 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-08 14:10:23 +00:00
Daniel Sanders
682b194cd6 Re-commit r238838, r238844 with fix for host/target endian mismatch and windows buildbot.
The windows buildbot originally failed because the check expressions are
evaluated as 64-bit values, even for 32-bit symbols. Fixed this by comparing
bottom 32-bits of the expressions.

The host/target endian mismatch issue is that it's invalid to read/write target
values using a host pointer without taking care of endian differences between
the target and host. Most (if not all) instances of
reinterpret_cast<uint32_t*>() in the RuntimeDyld are examples of this bug.
This has been fixed for Mips using the endian aware read/write functions.

The original commits were:
r238838:
[mips] Add RuntimeDyld tests for currently supported O32 relocations.

Reviewers: petarj, vkalintiris

Reviewed By: vkalintiris

Subscribers: vkalintiris, llvm-commits

Differential Revision: http://reviews.llvm.org/D10126

r238844:
[mips][mcjit] Add support for R_MIPS_PC32.

Summary:
This allows us to resolve relocations for DW_EH_PE_pcrel TType encodings
in the exception handling LSDA.

Also fixed a nearby typo.

Reviewers: petarj, vkalintiris

Reviewed By: vkalintiris

Subscribers: vkalintiris, llvm-commits

Differential Revision: http://reviews.llvm.org/D10127



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238915 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-03 10:27:28 +00:00
Rafael Espindola
60e0898710 This reverts commit r238838, r238844 and r238888.
Trying to bring back a windows bot:

http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/1224/steps/ninja%20check%202/logs/FAIL%3A%20LLVM%3A%3AELF_O32_PIC_relocations.s

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238903 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-03 05:39:59 +00:00
Daniel Sanders
6c55f8dda7 [mips][mcjit] Add support for R_MIPS_PC32.
Summary:
This allows us to resolve relocations for DW_EH_PE_pcrel TType encodings
in the exception handling LSDA.

Also fixed a nearby typo.

Reviewers: petarj, vkalintiris

Reviewed By: vkalintiris

Subscribers: vkalintiris, llvm-commits

Differential Revision: http://reviews.llvm.org/D10127

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238844 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 15:28:29 +00:00
Rafael Espindola
9751e35f20 Simplify now that we always use an alignment of 2 for ELF files.
This saves 123144 bytes out of llvm-nm on powerpc64le.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238824 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 12:05:27 +00:00
Davide Italiano
69aef63931 [RuntimeDydlELF] Use range-based loop.
Differential Revision:	http://reviews.llvm.org/D10165
Reviewed by:	rafael


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238804 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 01:52:28 +00:00
Rafael Espindola
481f35f113 Simplify another function that doesn't fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238703 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 00:27:26 +00:00
Rafael Espindola
64afb8375d Simplify interface of function that doesn't fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238700 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-31 23:52:50 +00:00
Petar Jovanovic
a703f676f7 [Mips64] Add support for MCJIT for MIPS64r2 and MIPS64r6
Add support for resolving MIPS64r2 and MIPS64r6 relocations in MCJIT.

Patch by Vladimir Radosavljevic.

Differential Revision: http://reviews.llvm.org/D9667


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238424 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 13:48:41 +00:00
Lang Hames
8cc212a07e [RuntimeDyld] Fix MachO i386 SECTDIFF relocation to support non-zero addends.
Previously, relocations of the form 'A - B + C' would fail on i386 when C was
non-zero.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238356 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 20:50:01 +00:00
NAKAMURA Takumi
25103832b2 Reapply part of r237975, "Fix Clang -Wmissing-override warning", except for DIContext.h, to apease g++-4.7.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238012 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 10:11:07 +00:00
Tobias Grosser
b7888bd5ea Revert "Fix Clang -Wmissing-override warning"
This reverts commit r237975. This seems also to break with gcc 4.7

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238004 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 06:01:04 +00:00
David Blaikie
a89d43a2ce Fix Clang -Wmissing-override warning
& remove the duplication by introducing a CRTP base to implement the
clone behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237975 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 00:00:00 +00:00
Keno Fischer
b6976af3cd Make it easier to use DwarfContext with MCJIT
Summary:
This supersedes http://reviews.llvm.org/D4010, hopefully properly
dealing with the JIT case and also adds an actual test case.
DwarfContext was basically already usable for the JIT (and back when
we were overwriting ELF files it actually worked out of the box by
accident), but in order to resolve relocations correctly it needs
to know the load address of the section.
Rather than trying to get this out of the ObjectFile or requiring
the user to create a new ObjectFile just to get some debug info,
this adds the capability to pass in that info directly.
As part of this I separated out part of the LoadedObjectInfo struct
from RuntimeDyld, since it is now required at a higher layer.

Reviewers: lhames, echristo

Reviewed By: echristo

Subscribers: vtjnash, friss, rafael, llvm-commits

Differential Revision: http://reviews.llvm.org/D6961

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237961 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 21:24:32 +00:00
David Majnemer
e892415f25 [RuntimeDyld] Use isInt to assert that a relocation didn't overflow
isInt is a little easier to read, let's use that more consistently.
Incidentally, this also silences a warning for shifting a negative
number.

This fixes PR23532.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237476 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-15 20:32:25 +00:00
Keno Fischer
277d81e680 Reapply [RuntimeDyldELF] Fold Placeholder into Addend
This reapplies r235060 and 235070, which were reverted because of test failures
in LLDB. The failure was caused because at  moment RuntimeDyld is processing
relocations for all sections, irrespective of whether we actually load them
into memory or not, but RuntimeDyld was not actually remembering where in memory
the unrelocated section is. This commit includes a fix for that issue by
remembering that pointer, though the longer term fix should be to stop processing
unneeded sections.

Original Summary:

This allows us to get rid of the original unrelocated object file after
we're done processing relocations (but before applying them).
MachO and COFF already do not require this (currently we have temporary hacks
to prevent ownership from being released, but those are brittle and should be
removed soon).

The placeholder mechanism allowed the relocation resolver to look at original
object file to obtain more information that are required to apply the
relocations. This is usually necessary in two cases:

- For relocations targetting sub-word memory locations, there may be pieces
  of the instruction at the target address which we should not override.
- Some relocations on some platforms allow an extra addend to be encoded in
  their immediate fields.

The problem is that in the second case the information cannot be recovered
after the relocations have been applied once because they will have been
overridden. In the first case we also need to be careful to not use any bits
that aren't fixed and may have been overriden by applying a first relocation.

In the past both have been fixed by just looking at original object file. This
patch attempts to recover the information from the first by looking at the
relocated object file, while the extra addend in the second case is read
upon relocation processing and addend to the regular addend.

I have tested this on X86. Other platforms represent my best understanding
of how those relocations should work, but I may have missed something because
I do not have access to those platforms.
We will keep the ugly workarounds in place for a couple of days, so this commit
can be reverted if it breaks the bots.

Differential Revision: http://reviews.llvm.org/D9028

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236341 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-01 20:21:45 +00:00
Lang Hames
14660f8f21 [RuntimeDyld][COFF] Add external symbol resolution support to RuntimeDyldCOFF.
Patch by Andy Ayers. Thanks Andy!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235554 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 21:38:37 +00:00
Pavel Labath
61cf1a8047 Revert "[RuntimeDyldELF] Fold Placeholder into Addend"
This reverts commit cbbeac14f0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235082 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-16 08:58:15 +00:00
Pavel Labath
e0eb40474c Revert "[RuntimeDyldELF] Fix missing cases in Placeholder processing"
This reverts commit ec0a34f850.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235081 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-16 08:58:11 +00:00
Keno Fischer
ec0a34f850 [RuntimeDyldELF] Fix missing cases in Placeholder processing
Try to appease the build bots. We should write rtdyld test cases for these
to make them testible on other platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235070 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-16 02:00:38 +00:00
Keno Fischer
cbbeac14f0 [RuntimeDyldELF] Fold Placeholder into Addend
Summary:

This allows us to get rid of the original unrelocated object file after
we're done processing relocations (but before applying them).
MachO and COFF already do not require this (currently we have temporary hacks
to prevent ownership from being released, but those are brittle and should be
removed soon).

The placeholder mechanism allowed the relocation resolver to look at original
object file to obtain more information that are required to apply the
relocations. This is usually necessary in two cases:

- For relocations targetting sub-word memory locations, there may be pieces
  of the instruction at the target address which we should not override.
- Some relocations on some platforms allow an extra addend to be encoded in
  their immediate fields.

The problem is that in the second case the information cannot be recovered
after the relocations have been applied once because they will have been
overridden. In the first case we also need to be careful to not use any bits
that aren't fixed and may have been overriden by applying a first relocation.

In the past both have been fixed by just looking at original object file. This
patch attempts to recover the information from the first by looking at the
relocated object file, while the extra addend in the second case is read
upon relocation processing and addend to the regular addend.

I have tested this on X86. Other platforms represent my best understanding
of how those relocations should work, but I may have missed something because
I do not have access to those platforms.
We will keep the ugly workarounds in place for a couple of days, so this commit
can be reverted if it breaks the bots.

Reviewers: petarj, t.p.northover, lhames

Reviewed By: lhames

Subscribers: aemerson, llvm-commits

Differential Revision: http://reviews.llvm.org/D9028

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235060 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-15 23:49:29 +00:00
Lang Hames
29da637826 [RuntimeDyld] Add casts to make delta computation 64-bit.
Hopefully this will fix the i686/msvc build failure described at:
http://bb.pgr.jp/builders/ninja-clang-i686-msc18-R/builds/803



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234977 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-15 04:46:01 +00:00
Lang Hames
a01f355245 [RuntimeDyld] Make sure we emit MachO __eh_frame and __gcc_except_tab sections,
even if there are no references to them in the code.

This allows exceptions thrown from JIT'd code to be caught by the JIT itself.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234975 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-15 03:39:22 +00:00
Lang Hames
1e3aa641b0 [RuntimeDyld] Make SectionEntry's Name field a std::string.
StringRef is unsafe here, since SectionEntry instances can outlive the
ObjectFile instances they are created from.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234910 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-14 17:13:10 +00:00
Keno Fischer
4edb309c27 [RuntimeDyldELF] Improve GOT support
Summary:
This is the first in a series of patches to eventually add support for TLS relocations to RuntimeDyld. This patch resolves an issue in the current GOT handling, where GOT entries would be reused between object files, which leads to the same situation that necessitates the GOT in the first place, i.e. that the 32-bit offset can not cover all of the address space. Thus this patch makes the GOT object-file-local.
Unfortunately, this still isn't quite enough, because the MemoryManager does not yet guarantee that sections are allocated sufficiently close to each other, even if they belong to the same object file. To address this concern, this patch also adds a small API abstraction on top of the GOT allocation mechanism that will allow (temporarily, until the MemoryManager is improved) using the stub mechanism instead of allocating a different section. The actual switch from separate section to stub mechanism will be part of a follow-on commit, so that it can be easily reverted independently at the appropriate time.

Test Plan: Includes a test case where the GOT of two object files is artificially forced to be apart by several GB.

Reviewers: lhames

Reviewed By: lhames

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8813

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234839 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-14 02:10:35 +00:00
Alexander Kornienko
c16fc54851 Use 'override/final' instead of 'virtual' for overridden methods
The patch is generated using clang-tidy misc-use-override check.

This command was used:

  tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
    -checks='-*,misc-use-override' -header-filter='llvm|clang' \
    -j=32 -fix -format

http://reviews.llvm.org/D8925



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234679 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-11 02:11:45 +00:00