| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
A couple more basic relocations plus testcase.
Differential Revision: https://reviews.llvm.org/D47791
llvm-svn: 337484
|
|
|
|
|
|
| |
Code was dead because we call postThunkContents only for SHT_SYMTAB.
llvm-svn: 337460
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D48146
llvm-svn: 337429
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: ruiu, espindola
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D49513
llvm-svn: 337427
|
|
|
|
|
|
|
| |
This reverts commit r336609 as it doesn't seem to work with AArch64
thunk creation when used with ASan.
llvm-svn: 337413
|
|
|
|
| |
llvm-svn: 337405
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, getFdePC() returns uint64_t. Its because the following
encodings might use 8 bytes: DW_EH_PE_absptr and DW_EH_PE_udata8.
But caller assigns returned value to uint32_t field:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L508
Value is used for building .eh_frame_hdr section.
We use DW_EH_PE_sdata4 encoding for building it at this moment:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L2545
And that means that an overflow issue might happen if
DW_EH_PE_absptr/DW_EH_PE_udata8 address encodings are present
in .eh_frame. In that case, before this patch, we silently would
truncate the address and produced broken .eh_frame_hdr section.
It would be not hard to support real 64-bit values for
DW_EH_PE_absptr/DW_EH_PE_udata8 encodings, but it is
unclear if it is usefull and if we should do it.
Since nobody faced/reported it, int this patch I only implement
a check to stop producing broken output silently for now.
llvm-svn: 337382
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a part of ttps://bugs.llvm.org//show_bug.cgi?id=38119
We produce broken ELF header now when the number of output sections is >= SHN_LORESERVE (0xff00).
ELF spec says (http://www.sco.com/developers/gabi/2003-12-17/ch4.eheader.html):
e_shnum:
If the number of sections is greater than or equal to SHN_LORESERVE (0xff00), this member has the value zero
and the actual number of section header table entries is contained in the sh_size field of the section header at index 0.
(Otherwise, the sh_size member of the initial entry contains 0.)
e_shstrndx
If the section name string table section index is greater than or equal to SHN_LORESERVE (0xff00), this member has the
value SHN_XINDEX (0xffff) and the actual index of the section name string table section is contained in the sh_link field of
the section header at index 0. (Otherwise, the sh_link member of the initial entry contains 0.)
We did not set these fields correctly earlier. The patch fixes the issue.
Differential revision: https://reviews.llvm.org/D49371
llvm-svn: 337363
|
|
|
|
|
|
| |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
llvm-svn: 337340
|
|
|
|
| |
llvm-svn: 337332
|
|
|
|
|
|
|
|
|
| |
EhFrameSection::finalizeContents() is called from a single place:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L1559
So code was dead.
llvm-svn: 337287
|
|
|
|
|
|
|
|
| |
Code was dead because caller of the addCie() already
checks that ID is equal to 0:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L431
llvm-svn: 337281
|
|
|
|
|
|
|
|
|
| |
Code was dead because at the moment of BssSection creation
it can never have a parent. Also, code simply does not
make sence as alignment adjastment happens when
BssSection is added to its parent later.
llvm-svn: 337276
|
|
|
|
|
|
|
|
|
|
| |
There are following symbols currently available:
DefinedKind, SharedKind, UndefinedKind, LazyArchiveKind, LazyObjectKind.
Our code calls getSize() only for first two and there
seems to be no reason to return 0 for the rest.
llvm-svn: 337265
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This adds support to option -plugin-opt=dwo_dir=${DIR}. This option is used to specify the directory to store the .dwo files when LTO and debug fission is used
at the same time.
Reviewers: ruiu, espindola, pcc
Reviewed By: pcc
Subscribers: eraman, dexonsmith, mehdi_amini, emaste, arichardson, steven_wu, llvm-commits
Differential Revision: https://reviews.llvm.org/D47904
llvm-svn: 337195
|
|
|
|
|
|
| |
Flow is the same, but a bit shorter after this change.
llvm-svn: 337183
|
|
|
|
|
|
| |
Just use getDataAs for taking sections contents.
llvm-svn: 336892
|
|
|
|
|
|
|
|
|
| |
Code is dead because caller of the isDuplicateArmExidxSex
(https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L1446)
explicitly does not pass sentinel. So no reason to check it.
llvm-svn: 336891
|
|
|
|
|
|
|
|
| |
Archives created with ThinLTO are bitcodes, they also need to be searched for excluded symbols.
Differential Revision: https://reviews.llvm.org/D48857
llvm-svn: 336826
|
|
|
|
|
|
| |
This looks a bit simpler IMO.
llvm-svn: 336815
|
|
|
|
|
|
|
| |
It does not look possible to end up with empty Sections
at this place. And this knowledge allows simplifying the code.
llvm-svn: 336814
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Or code uses constructions like isa<ARMExidxSentinelSection>:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L1428
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L2944
That is confusing, because without ARMExidxSentinelSection::classof()
these lines are equal to isa<SyntheticSection> and the code does not really do
the same what it expected to. I found no good way to break it though, but it is not nice.
Patch adds ARMExidxSentinelSection::classof().
llvm-svn: 336813
|
|
|
|
|
|
|
|
|
|
| |
creating a relocatable output.
This fixes PR37735.
Differential Revision: https://reviews.llvm.org/D48929
llvm-svn: 336799
|
|
|
|
|
|
|
|
|
| |
If we have 2 bitcode inputs for different targets, LLD would
print "<internal>" instead of the name of one of the files.
The patch adds a test and fixes this issue.
llvm-svn: 336794
|
|
|
|
| |
llvm-svn: 336791
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since .gdb_index sections contain all known symbols, they can be very large.
One of my executables has a .gdb_index section of 1350 GiB. Uniquifying
symbols by name takes 3.77 seconds on my machine. This patch parallelize it.
Time to call createSymbols() with 8.4 million unique symbols:
Without this patch: 3773 ms
Parallelism = 1: 4374 ms
Parallelism = 2: 2628 ms
Parallelism = 16: 837 ms
As you can see above, this algorithm is a bit more inefficient
than the non-parallelized version, but even with dual-core, it is
faster than that, so I think it is overall a win.
Differential Revision: https://reviews.llvm.org/D49164
llvm-svn: 336790
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This workaround is for GCC 5.4.1. Without this workaround, lld will
produce larger .gdb_index sections for object files compiled with the
buggy version of the compiler.
Since it is not for correctness, and it affects only debug builds (since
you are generating .gdb_index sections), perhaps the hack shouldn't have been
added in the first place. At least, I think it is time to remove this hack.
Differential Revision: https://reviews.llvm.org/D49149
llvm-svn: 336788
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch merges createGdbIndex function and GdbIndexSection's
constructor into a single static member function of the class.
This patch also change how we keep CU vectors. Previously, CuVector
and GdbSymbols were parallel arrays, but there's no reason to choose that
design. Now, CuVector is a member of GdbSymbol class.
A lot of members are removed from GdbIndexSection. Previously, it has
members that need to be kept in sync over several phases. I belive the new
design is less error-prone, and the new code is much easier to read
than before.
llvm-svn: 336743
|
|
|
|
|
|
|
|
|
| |
This fix add more test cases for routines check MIPS ELF header flags and
flags from .MIPS.abiflags sections. The tests use yaml2obj for object
files generation because not all combinations of flags can be produced
by LLVM tools.
llvm-svn: 336704
|
|
|
|
| |
llvm-svn: 336700
|
|
|
|
| |
llvm-svn: 336690
|
|
|
|
| |
llvm-svn: 336686
|
|
|
|
| |
llvm-svn: 336674
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
.gdb_index sections can be very large. When you are compiling
multi-gibibyte executables, they can be larger than 1 GiB. The previous
implementation of .gdb_index seems to consume too much memory.
This patch reduces memory consumption by eliminating temporary objects.
In one experiment, memory consumption of GdbIndexSection class is
reduced from 962 MiB to 228 MiB when creating a .gdb_index of 1350 GiB.
Differential Revision: https://reviews.llvm.org/D49094
llvm-svn: 336672
|
|
|
|
|
|
|
| |
This adds a file name to the error message,
adds a missing test case and refactors code a bit.
llvm-svn: 336651
|
|
|
|
|
|
| |
We did not report file names for some reason.
llvm-svn: 336650
|
|
|
|
|
|
|
|
|
|
| |
I believe the only way to test this functionality is to create extremely
large object files and attempt to create a .gdb_index that is greater
than 4 GiB. But I think that's too much for most environments and buildbots,
so I'm commiting this without a test that actually triggers the new
error condition.
llvm-svn: 336631
|
|
|
|
|
|
|
|
|
| |
Previously, we didn't create multiple consecutive bitmaps.
Added a test to catch this bug too.
Differential Revision: https://reviews.llvm.org/D49107
llvm-svn: 336620
|
|
|
|
|
|
|
|
|
| |
This patch also speeds it up by making some constants compile-time
constants. Other than that, NFC.
Differential Revision: https://reviews.llvm.org/D49101
llvm-svn: 336614
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch by Matthew Koontz!
Before, direct calls to __wrap_sym would not map to valid PLT entries,
so they would crash at runtime. This change maps such calls to the same
PLT entry as calls to sym that are then wrapped.
Differential Revision: https://reviews.llvm.org/D48502
llvm-svn: 336609
|
|
|
|
| |
llvm-svn: 336599
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch by Rahul Chaudhry!
This change adds experimental support for SHT_RELR sections, proposed
here: https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg
Pass '--pack-dyn-relocs=relr' to enable generation of SHT_RELR section
and DT_RELR, DT_RELRSZ, and DT_RELRENT dynamic tags.
Definitions for the new ELF section type and dynamic array tags, as well
as the encoding used in the new section are all under discussion and are
subject to change. Use with caution!
Pass '--use-android-relr-tags' with '--pack-dyn-relocs=relr' to use
SHT_ANDROID_RELR section type instead of SHT_RELR, as well as
DT_ANDROID_RELR* dynamic tags instead of DT_RELR*. The generated
section contents are identical.
'--pack-dyn-relocs=android+relr --use-android-relr-tags' enables both
'--pack-dyn-relocs=android' and '--pack-dyn-relocs=relr': lld will
encode the relative relocations in a SHT_ANDROID_RELR section, and pack
the rest of the dynamic relocations in a SHT_ANDROID_REL(A) section.
Differential Revision: https://reviews.llvm.org/D48247
llvm-svn: 336594
|
|
|
|
|
|
|
|
|
| |
This patch adds the target call back relaxTlsLdToLe to support TLS relaxation
from local dynamic to local exec model.
Differential Revision: https://reviews.llvm.org/D48293
llvm-svn: 336559
|
|
|
|
|
|
| |
'Pos' is never can be 0 here.
llvm-svn: 336436
|
|
|
|
|
|
| |
'Pos' can never be 0.
llvm-svn: 336435
|
|
|
|
| |
llvm-svn: 336414
|
|
|
|
|
|
|
|
|
| |
Remove support for linking microMIPS 64-bit code because this kind of
ISA is rarely used and unsupported by LLVM.
Differential revision: https://reviews.llvm.org/D48949
llvm-svn: 336413
|
|
|
|
| |
llvm-svn: 336378
|
|
|
|
|
|
|
|
|
|
| |
In this file we only have to handle the v2 ABI, so what we need to do
is to just make sure that all object files have v2 or unspecified version
number.
Differential Revision: https://reviews.llvm.org/D48112
llvm-svn: 336372
|
|
|
|
|
|
|
|
|
|
|
|
| |
We call switchTo() from assignAddresses() for switching to Aether,
and from assignOffsets().
First calls assignOffsets() one by one for each output section.
(https://github.com/llvm-mirror/lld/blob/master/ELF/LinkerScript.cpp#L1045)
That I believe means the condition removed in this patch is dead.
llvm-svn: 336356
|