| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 210014
|
|
|
|
|
|
|
|
| |
Reference::target() never returns a nullptr, so NULL check
is not needed and is more harmful than doing nothing.
No functionality change.
llvm-svn: 210008
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Arrange .ctors/.dtors sections in the following order:
.ctors from crtbegin.o or crtbegin?.o
.ctors from regular object files
.ctors.* (sorted) from regular object files
.ctors from crtend.o or crtend?.o
This order is specific for MIPS traget. For example, on X86
the .ctors.* sections are merged into the .init_array section.
llvm-svn: 209987
|
|
|
|
| |
llvm-svn: 209958
|
|
|
|
|
|
|
| |
There is no std::error_code::success, so this removes much of the noise
in transitioning to std::error_code.
llvm-svn: 209948
|
|
|
|
| |
llvm-svn: 209928
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main problem is in the predicate passed to the `std::stable_sort()`.
This predicate always returns false if **both** section's names do not
start with `.init_array` or `.fini_array` prefixes. In short, it does not
define a strict weak orderng. Suppose we have the following sections:
.A .init_array.1 .init_array.2
The predicate states that:
not .init_array.1 < .A
not .A < .init_array.2
but .init_array.1 < .init_array.2 !!!
The second problem is that `.init_array` section without number should
go last in the list. Not it has the lowest priority '0' and goes first.
The patch fixes both of the problems.
llvm-svn: 209875
|
|
|
|
| |
llvm-svn: 209868
|
|
|
|
| |
llvm-svn: 209865
|
|
|
|
|
|
| |
whether symbols in a section are ignored or illegal
llvm-svn: 209858
|
|
|
|
| |
llvm-svn: 209844
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 209709
|
|
|
|
| |
llvm-svn: 209707
|
|
|
|
| |
llvm-svn: 209704
|
|
|
|
| |
llvm-svn: 209700
|
|
|
|
| |
llvm-svn: 209685
|
|
|
|
| |
llvm-svn: 209684
|
|
|
|
|
|
|
|
|
|
|
| |
This is a short-term fix to allow lld Readers to return error messages
with dynamic content.
The long term fix will be to enhance ErrorOr<> to work with errors other
than error_code. Or to change the interface to Readers to pass down a
diagnostics object through which all error messages are written.
llvm-svn: 209681
|
|
|
|
| |
llvm-svn: 209644
|
|
|
|
|
|
| |
size of global GOT entries map for that.
llvm-svn: 209616
|
|
|
|
|
|
| |
perform calculations for R_MIPS_GOT16 and R_MIPS_CALL16 relocations.
llvm-svn: 209594
|
|
|
|
|
|
| |
separate function.
llvm-svn: 209593
|
|
|
|
|
|
| |
the MipsELFWriters member function.
llvm-svn: 209592
|
|
|
|
| |
llvm-svn: 209591
|
|
|
|
|
|
| |
perform similar calculations.
llvm-svn: 209590
|
|
|
|
| |
llvm-svn: 209582
|
|
|
|
| |
llvm-svn: 209497
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
/alternatename is a command line option to define a weak alias. You
can use it as /alternatename:foo=bar to define "foo" as a weak alias
for "bar".
Because it's a command line option, the weak alias mapping is in the
LinkingContext object, and not in a object file being read.
Previously, we looked up the mapping each time we read a new symbol
from a file, to check if there is a weak alias defined for the symbol.
That's not wrong, but had made function signature's a bit complicated --
we had to pass the mapping object to many functions. Now their
parameter lists are much cleaner.
This also has another (unrealized) benefit. parseFile() now read a
file and then add alias symbols to the file. In the first pass a
LinkingContext object is not used at all. That should make it easy
to read files from archive files speculatively, as the first pass
is free from side effect.
llvm-svn: 209486
|
|
|
|
|
|
|
|
|
|
| |
Alias symbols are SimpleDefinedAtoms and are platform neutral. They
don't have to belong ELF. This patch is to make it available to all
platforms. No functionality change intended.
Differential Revision: http://reviews.llvm.org/D3862
llvm-svn: 209475
|
|
|
|
| |
llvm-svn: 209469
|
|
|
|
| |
llvm-svn: 209379
|
|
|
|
| |
llvm-svn: 209357
|
|
|
|
| |
llvm-svn: 209323
|
|
|
|
| |
llvm-svn: 209317
|
|
|
|
|
|
| |
against _gp_disp symbol.
llvm-svn: 209315
|
|
|
|
| |
llvm-svn: 209274
|
|
|
|
| |
llvm-svn: 209271
|
|
|
|
|
|
|
|
|
|
|
| |
addResolvableSymbols() queues input files, and readAllSymbols() reads
from them. In practice it's currently safe because they are called from
a single thread. But it's not guaranteed.
Also, acquiring the same mutex is needed not to see inconsistent memory
contents that is allowed in the C++ memory model.
llvm-svn: 209254
|
|
|
|
| |
llvm-svn: 209243
|
|
|
|
| |
llvm-svn: 209213
|
|
|
|
|
|
|
| |
relocation. In fact this case violates ABI but sometimes compilers might
produce such code.
llvm-svn: 209153
|
|
|
|
|
|
| |
referenced by a local symbol.
llvm-svn: 209063
|
|
|
|
| |
llvm-svn: 208928
|
|
|
|
| |
llvm-svn: 208919
|
|
|
|
|
|
|
|
| |
ExportedSymbolRenameFile is not always used. In most cases we don't
need to read given files at all. So lazy load would help. This doesn't
change the meaining of the program.
llvm-svn: 208818
|
|
|
|
|
|
| |
atoms in yaml
llvm-svn: 208813
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In r205566, I made a change to Resolver so that Resolver revisit
only archive files in --start-group and --end-group pair. That's
not correct, as it also has to revisit DSO files.
This patch is to fix the issue.
Added a test to demonstrate the fix. I confirmed that it succeeded
before r205566, failed after r205566, and is ok with this patch.
Differential Revision: http://reviews.llvm.org/D3734
llvm-svn: 208797
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As written in the comment in this patch, symbol names specified with
/export option is resolved in a special way; for /export:foo, linker
finds a foo@<number> symbol if such symbols exists.
On Windows, a function in stdcall calling convention is mangled with
a leading underscore and following "@" and numbers. This name
mangling is kind of automatic, so you can sometimes omit _ and @number
when specifying a symbol. /export option is that case.
Previously, if a file in an archive file foo.lib provides a symbol
_fn@8, and /export:fn is specified, LLD failed to resolve the symbol.
It only tried to find _fn, and failed to find _fn@8. With this patch,
_fn@8 will be searched on the second iteration.
Differential Revision: http://reviews.llvm.org/D3736
llvm-svn: 208754
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make it possible to add observers to an Input Graph, so that files
returned from an Input Graph can be examined before they are
passed to Resolver.
To implement some PE/COFF features we need to know all the symbols
that *can* be solved, including ones in archive files that are not
yet to be read.
Currently, Resolver only maintains a set of symbols that are
already read. It has no knowledge on symbols in skipped files in
an archive file.
There are many ways to implement that. I chose to apply the
observer pattern here because it seems most non-intrusive. We don't
want to mess up Resolver with architecture specific features.
Even in PE/COFF, the feature that needs this mechanism is minor.
So I chose not to modify Resolver, but add a hook to Input Graph.
Differential Revision: http://reviews.llvm.org/D3735
llvm-svn: 208753
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If one or more dynamic relocation might modify a read-only section,
dynamic table should contain DT_TEXTREL tag.
The patch introduces new `RelocationTable::canModifyReadonlySection()`
method. This method checks through the relocations to see if any modifies
a read-only section. The DynamicTable class calls this method and emits
the DT_TEXTREL tag if necessary.
The patch reviewed by Rui Ueyama and Shankar Easwaran.
llvm-svn: 208670
|