| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a binary is stripped, which can remove discardable sections (except
for the .reloc section, which also is marked as discardable as it isn't
loaded at runtime, only read by the loader), the .reloc section should
be first of them, in order not to create gaps in the image.
Previously, binaries with relocations were broken if they were stripped
by GNU binutils strip. Trying to execute such binaries produces an error
about "xx is not a valid win32 application".
This fixes GNU binutils bug 23348.
Prior to SVN r329370 (which didn't intend to have functional changes),
the code for moving discardable sections to the end didn't clearly
express how other discardable sections should be ordered compared to
.reloc, but the change retained the exact same end result as before.
After SVN r329370, the code (and comments) more clearly indicate that
it tries to make the .reloc section the absolutely last one; this patch
changes that.
This matches how GNU binutils ld sorts .reloc compared to dwarf debug
info sections.
Differential Revision: https://reviews.llvm.org/D49351
Signed-off-by: Martin Storsjö <martin@martin.st>
llvm-svn: 337598
|
|
|
|
| |
llvm-svn: 337528
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For dwarf debug info, an executable normally either contains the debug
info, or it is stripped out. To reduce the storage needed (slightly)
for the debug info kept separately from the released, stripped binaries,
one can choose to only copy the debug data from the original executable
(essentially the reverse of the strip operation), producing a file with
only debug info.
When copying the debug data from an executable with GNU objcopy,
the build id and debug directory need to reside in a separate section,
as this will be kept while the rest of the .rdata section is removed.
Differential Revision: https://reviews.llvm.org/D49352
llvm-svn: 337526
|
|
|
|
|
|
|
|
| |
Add support and update the testcase.
Differential Revision: https://reviews.llvm.org/D49394
llvm-svn: 337494
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
This is to test the following error message:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L544
Which occurs when LLD meets unsupported address encoding when scans
.eh_frame to build .eh_frame_hdr section.
llvm-svn: 337458
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch changes relative path for source files in obj files to
absolute path in PDB when linking with added flag.
I will make obj file generated by clang-cl independent from build
directory for chromium build. But I don't want to confuse visual studio
debugger or require additional configuration. To attain this goal, I
added flag to convert relative source file path in obj to absolute path
when emitting PDB.
By removing absolute path from obj files, we can share build cache
between chromium developers even when they are doing debug build.
That will make build time faster.
More context:
https://bugs.chromium.org/p/chromium/issues/detail?id=712796
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/5HXSVX-7fPc
llvm-svn: 337439
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Dwarf debug info contains some data that contains absolute addresses.
Since these sections are discardable and aren't loaded at runtime,
there's no point in adding base relocations for them.
This makes sure that after stripping out dwarf debug info, there are no
base relocations that point to nonexistent sections.
Differential Revision: https://reviews.llvm.org/D49350
llvm-svn: 337438
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
Add a test for this by causing a symbol collision
between archive members.
Differential Revision: https://reviews.llvm.org/D49343
llvm-svn: 337426
|
|
|
|
|
|
|
| |
This reverts commit r336609 as it doesn't seem to work with AArch64
thunk creation when used with ASan.
llvm-svn: 337413
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=38018
Reviewers: thakis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D48990
llvm-svn: 337407
|
|
|
|
| |
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 covers the following line of the code:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L525
llvm-svn: 337377
|
|
|
|
|
|
|
| |
This adds .eh_frame_hdr content checking to test
that DW_EH_PE_udata2 address was decoded correctly.
llvm-svn: 337374
|
|
|
|
|
|
| |
This adds a check for .shstrtab section index.
llvm-svn: 337365
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
This adds a test to check LLD can handle such address format correctly.
Test case covers the following line:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L519
llvm-svn: 337362
|
|
|
|
|
|
| |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
llvm-svn: 337340
|
|
|
|
| |
llvm-svn: 337332
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D49113
llvm-svn: 337314
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D48838
llvm-svn: 337300
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This covers a following line with the test:
https://github.com/llvm-mirror/lld/blob/master/ELF/DriverUtils.cpp#L73
llvm-svn: 337268
|
|
|
|
|
|
|
|
|
|
| |
Mentioned flag was never tested together with
--call-graph-ordering-file. And the following line
was uncovered:
https://github.com/llvm-mirror/lld/blob/master/ELF/Symbols.cpp#L248
llvm-svn: 337266
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
error messages.
InputSectionBase::getLocation() have the following block of the code which
is uncovered by our test cases:
https://github.com/llvm-mirror/lld/blob/master/ELF/InputSection.cpp#L238
Patch adds a test to trigger this branch.
llvm-svn: 337256
|
|
|
|
| |
llvm-svn: 337254
|
|
|
|
|
|
|
| |
This test case adds a check for the following line of the code:
https://github.com/llvm-mirror/lld/blob/master/ELF/InputSection.cpp#L194
llvm-svn: 337252
|
|
|
|
|
|
|
|
| |
We did not try to support this intentionally but have
an error handling and reporting logic that can take care
of that and hence needs a test.
llvm-svn: 337250
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This removes the %T/dwo directory before calling ld.lld in ELF/lto/thinlto-debug-fission.ll so that
files aren't left over from previous runs.
Reviewers: espindola, pcc
Reviewed By: pcc
Subscribers: inglorion, emaste, arichardson, eraman, steven_wu, dexonsmith, llvm-commits
Differential Revision: https://reviews.llvm.org/D49390
llvm-svn: 337210
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
There was no test for the first `return`.
llvm-svn: 337182
|
|
|
|
|
|
| |
cf r337092
llvm-svn: 337093
|
|
|
|
|
|
| |
https://reviews.llvm.org/D49319
llvm-svn: 337086
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This more closely matches the behavior of link.exe, and also
simplifies the code slightly.
llvm-svn: 336882
|
|
|
|
|
|
|
|
|
|
|
| |
Some Microsoft tools (e.g. new versions of WPA) fail when the
COFF Debug Directory contains a path to the PDB that contains
dots, such as D:\foo\./bar.pdb. Remove dots before writing this
path.
This fixes pr38126.
llvm-svn: 336873
|
|
|
|
|
|
|
|
| |
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
|