| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
default.", which was reverted in r330228.
In this reland I removed an unnecessary use of /debug in the test
delayimports32.test and used the /pdbaltpath flag in the test
pdb-publics-import.test, both of which avoid embedding absolute PDB
paths in executables which could affect later RVAs.
Original commit message:
> COFF: Merge .idata, .didat and .edata into .rdata by default.
>
> This saves a little space and matches what link.exe does.
>
> Tested using the chromium Windows trybots:
> https://chromium-review.googlesource.com/c/chromium/src/+/1014784
Differential Revision: https://reviews.llvm.org/D45737
llvm-svn: 330233
|
|
|
|
|
|
|
|
|
|
|
| |
I needed to revert r330223 because we were embedding an absolute PDB
path in the .rdata section, which ended up being laid out before the
.idata section and affecting its RVAs. This flag will let us control
the embedded path.
Differential Revision: https://reviews.llvm.org/D45747
llvm-svn: 330232
|
|
|
|
|
|
| |
Seems to have uncovered some sort of non-determinism on the bots.
llvm-svn: 330228
|
|
|
|
|
|
|
|
|
|
|
| |
This saves a little space and matches what link.exe does.
Tested using the chromium Windows trybots:
https://chromium-review.googlesource.com/c/chromium/src/+/1014784
Differential Revision: https://reviews.llvm.org/D45737
llvm-svn: 330223
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D45740
llvm-svn: 330222
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The DBI stream contains a list of module descriptors. At the
beginning of each descriptor is a structure representing the first
section contribution in the output file for that module. LLD
currently doesn't fill out this structure at all, but link.exe
does. So as a precursor to emitting this data in LLD, we first
need a way to dump it so that it can be checked.
This patch adds support for the dumping, and verifies via a test
that LLD emits bogus information.
llvm-svn: 330208
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D45714
llvm-svn: 330172
|
|
|
|
|
|
|
|
|
|
| |
eliminated DSOs."
This is causing large numbers of Chromium test executables to crash on
shutdown. The relevant symbol seems to be __cxa_finalize, which gets
removed from the dynamic symbol table for some of the support libraries.
llvm-svn: 330164
|
|
|
|
|
|
|
|
|
| |
Using Config->is64() will treat ARM64 as Amd64, which is incorrect.
Furthermore, there are more esoteric architectures that could
theoretically be encountered. Just set it directly to the machine
type, which we already know anyway.
llvm-svn: 330157
|
|
|
|
|
|
|
| |
This fixes the failing tests. They simply hadn't been updated
to match the new output resulting from this patch.
llvm-svn: 330145
|
|
|
|
|
|
|
| |
There are a couple of failing tests which slipped under my radar
so I'm reverting this while I attempt to fix.
llvm-svn: 330133
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of these are pretty trivial and obvious. Setting the toolchain
version to 14.11 is perhaps a little questionable, but we've been bitten
in the past where one of our version fields sidn't match MSVC's, and I
definitely don't want to go through that diagnosis again as it was
pretty time consuming and hard to track down.
I found all of these by using llvm-pdbutil export to dump the dbi and
pdb streams to a file, then using fc followed by llvm-pdbutil explain to
explain the mismatched bytes.
There are still some more, these are just the low hanging fruit.
Differential Revision: https://reviews.llvm.org/D45276
llvm-svn: 330130
|
|
|
|
|
|
|
|
|
|
|
| |
We have a few functions that virtually all command wants to run on
process startup/shutdown. This patch adds InitLLVM class to do that
all at once, so that we don't need to copy-n-paste boilerplate code
to each llvm command's main() function.
Differential Revision: https://reviews.llvm.org/D45602
llvm-svn: 330046
|
|
|
|
|
|
| |
getVA was already implemented in the base class.
llvm-svn: 330036
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MIPS ABI requires creation of the MIPS_RLD_MAP dynamic tag for non-PIE
executables only and MIPS_RLD_MAP_REL tag for both PIE and non-PIE
executables. The patch skips definition of the MIPS_RLD_MAP for PIE
files and defines MIPS_RLD_MAP_REL.
The MIPS_RLD_MAP_REL tag stores the offset to the .rld_map section
relative to the address of the tag itself.
Differential Revision: https://reviews.llvm.org/D43347
llvm-svn: 329996
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If all references to a DSO happen to be weak, and if the DSO is
specified with --as-needed, the DSO is not added to DT_NEEDED.
If that happens, we also need to eliminate shared symbols created
from the DSO. Otherwise, they become dangling references that point
to non-exsitent DSO.
Fixes https://bugs.llvm.org/show_bug.cgi?id=36991
Differential Revision: https://reviews.llvm.org/D45536
llvm-svn: 329960
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The content of custome sections no longer includes the
name itself.
See: https://reviews.llvm.org/D45579
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D45580
llvm-svn: 329948
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D45400
llvm-svn: 329846
|
|
|
|
| |
llvm-svn: 329841
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes PR36716 (https://bugs.llvm.org/show_bug.cgi?id=36716),
Patch sorts local symbols to match the
following order: file1, local1, hidden1, file2, local2, hidden2 ...
Differential revision: https://reviews.llvm.org/D45325
llvm-svn: 329787
|
|
|
|
| |
llvm-svn: 329785
|
|
|
|
|
|
| |
Based on a patch for the ICF warning by Rui.
llvm-svn: 329757
|
|
|
|
|
|
|
|
|
| |
Copy user-defined custom sections into the output, concatenating
sections with the same name.
Differential Revision: https://reviews.llvm.org/D45340
llvm-svn: 329717
|
|
|
|
|
|
|
|
|
|
|
| |
LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in
HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the
default macro instead of a reinvented one.
See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev.
No intended behavior change.
llvm-svn: 329696
|
|
|
|
|
|
|
|
|
| |
Currently, we crash because File is null for
such symbols.
Differential revision: https://reviews.llvm.org/D45440
llvm-svn: 329678
|
|
|
|
| |
llvm-svn: 329642
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I'm proposing a new command line flag, --warn-backrefs in this patch.
The flag and the feature proposed below don't exist in GNU linkers
nor the current lld.
--warn-backrefs is an option to detect reverse or cyclic dependencies
between static archives, and it can be used to keep your program
compatible with GNU linkers after you switch to lld. I'll explain the
feature and why you may find it useful below.
lld's symbol resolution semantics is more relaxed than traditional
Unix linkers. Therefore,
ld.lld foo.a bar.o
succeeds even if bar.o contains an undefined symbol that have to be
resolved by some object file in foo.a. Traditional Unix linkers
don't allow this kind of backward reference, as they visit each
file only once from left to right in the command line while
resolving all undefined symbol at the moment of visiting.
In the above case, since there's no undefined symbol when a linker
visits foo.a, no files are pulled out from foo.a, and because the
linker forgets about foo.a after visiting, it can't resolve
undefined symbols that could have been resolved otherwise.
That lld accepts more relaxed form means (besides it makes more
sense) that you can accidentally write a command line or a build
file that works only with lld, even if you have a plan to
distribute it to wider users who may be using GNU linkers. With
--check-library-dependency, you can detect a library order that
doesn't work with other Unix linkers.
The option is also useful to detect cyclic dependencies between
static archives. Again, lld accepts
ld.lld foo.a bar.a
even if foo.a and bar.a depend on each other. With --warn-backrefs
it is handled as an error.
Here is how the option works. We assign a group ID to each file. A
file with a smaller group ID can pull out object files from an
archive file with an equal or greater group ID. Otherwise, it is a
reverse dependency and an error.
A file outside --{start,end}-group gets a fresh ID when
instantiated. All files within the same --{start,end}-group get the
same group ID. E.g.
ld.lld A B --start-group C D --end-group E
A and B form group 0, C, D and their member object files form group
1, and E forms group 2. I think that you can see how this group
assignment rule simulates the traditional linker's semantics.
Differential Revision: https://reviews.llvm.org/D45195
llvm-svn: 329636
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D45423
llvm-svn: 329609
|
|
|
|
|
|
|
|
| |
debug_pass_manager
Differential Revision: https://reviews.llvm.org/D45275
llvm-svn: 329598
|
|
|
|
| |
llvm-svn: 329563
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently LLD sets OutSecOff in addSection for input sections.
That is a fake offset (just a rude approximation to remember the order),
used for sorting SHF_LINK_ORDER sections
(see resolveShfLinkOrder, compareByFilePosition).
There are 2 problems with such approach:
1. We currently change and reuse Size field as a value assigned. Changing size is
not good because leads to bugs. Currently, SIZEOF(.bss) for empty .bss returns 2
because we add two empty synthetic sections and increase size twice by 1.
(See PR37011: https://bugs.llvm.org/show_bug.cgi?id=37011)
2. Such approach simply does not work when --symbol-ordering-file is involved,
because processing of the ordering file might break the initial section order.
This fixes PR37011.
Differential revision: https://reviews.llvm.org/D45368
llvm-svn: 329560
|
|
|
|
|
|
|
|
|
|
|
|
| |
The intention of -gc-sections flag was to check
that discarded is not in the output. It should be
specified in the executable command line invocation
and also, the symbol must be global as local symbols
are anyways not printed.
Differential revision: https://reviews.llvm.org/D45159
llvm-svn: 329559
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is for PR36716 and
this enables emitting STT_FILE symbols.
Output size affect is minor:
lld binary size changes from 52,883,408 to 52,949,400
clang binary size changes from 83,136,456 to 83,219,600
Differential revision: https://reviews.llvm.org/D45261
llvm-svn: 329557
|
|
|
|
|
|
|
|
|
|
|
| |
Some platforms interpret the pound sign as one character. Platforms that use
Python 2.x actually interpret it as two characters because in the Python 2.x
version of lit, the string used for the file name is a byte string and the pound
sign is two bytes.
Patch by Stella Stamenova!
llvm-svn: 329472
|
|
|
|
|
|
|
|
| |
With this we can merge builtin sections.
Differential Revision: https://reviews.llvm.org/D45350
llvm-svn: 329471
|
|
|
|
|
|
|
| |
Some system libraries have a lot of versioned symbols. When linking
scylla this brings the number of malloc calls from 49154 to 37944.
llvm-svn: 329453
|
|
|
|
| |
llvm-svn: 329384
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently there are a few odd things about the warning about symbols
that cannot be ordered. This patch fixes:
* When there is an undefined symbol that resolves to a shared file, we
were printing the location of the undefined reference.
* If there are multiple comdats, we were reporting them all.
llvm-svn: 329371
|
|
|
|
|
|
|
|
|
| |
With this, all output sections are created in one place. This will make
it simpler to implement merging of builtin sections.
Differential Revision: https://reviews.llvm.org/D45349
llvm-svn: 329370
|
|
|
|
|
|
|
|
| |
This is similar to r329219, but for the entire section. Like r329219 I
don't expect this to have any real impact, it is just more consistent
and simpler.
llvm-svn: 329367
|
|
|
|
|
|
|
|
|
| |
Since InputGlobal makes a copy of a given object, we can use a temporary
object allocated on the stack here.
Differential Revision: https://reviews.llvm.org/D43924
llvm-svn: 329337
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D43725
llvm-svn: 329336
|
|
|
|
| |
llvm-svn: 329333
|
|
|
|
|
|
|
|
|
| |
Previously, "size" column is 9 characters long which is too long
at least for 32-bit (because at maximum it needs 8 columns). This
patch make it one column shorter than before. That's also a reasonable
default for 64-bit.
llvm-svn: 329317
|
|
|
|
|
|
| |
Size can be narrow, but LMA should be the same width as VMA.
llvm-svn: 329312
|
|
|
|
|
|
|
| |
We have a dedicated Live bit, so we don't need a special value and we
were not accounting for in at least one place.
llvm-svn: 329307
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D45264
llvm-svn: 329281
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As was mentioned in comments for D45158,
isPicRel's name does not make much sense,
because what this method does is checks if
we need to create the dynamic relocation or not.
Instead of renaming it to something different,
we can 'isPicRel' completely.
We can reuse the getDynRel method.
They are logically very close, getDynRel can just return
R_*_NONE in case no dynamic relocation should be produced
and that would simplify things and avoid functionality
correlation/duplication with 'isPicRel'.
The patch does this change.
Differential revision: https://reviews.llvm.org/D45248
llvm-svn: 329275
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, LLD print symbol assignment commands to the map file,
but it does not do that for assignments that are outside of the section
descriptions. Such assignments can affect the layout though.
The patch implements the following:
* Teaches LLD to print symbol assignments outside of section declaration.
* Teaches LLD to print PROVIDE/HIDDEN/PROVIDE hidden commands.
In case when symbol is not provided, nothing will be printed.
Differential revision: https://reviews.llvm.org/D44894
llvm-svn: 329272
|
|
|
|
|
|
|
|
|
|
| |
Currently, LLD prints VA, but not LMA in a map file.
It seems can be useful to print both to reveal layout
details and patch implements it.
Differential revision: https://reviews.llvm.org/D44899
llvm-svn: 329271
|