| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
And remove git getLocalSymVA because there's no user of the function anymore.
llvm-svn: 250095
|
|
|
|
| |
llvm-svn: 250080
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds AsNeeded and IsUsed bool fields to SharedFile. AsNeeded bit
is set if the DSO is enclosed with --as-needed and --no-as-needed. IsUsed
bit is off by default. When we adds a symbol to the symbol table for dynamic
linking, we set its SharedFile's IsUsed bit.
If AsNeeded is set but IsUsed is not set, we don't want to write that
file's SO name to DT_NEEDED field.
http://reviews.llvm.org/D13579
llvm-svn: 249998
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SymbolTable was not a template class. Instead we had switch-case-based
type dispatch to call desired functions. We had to do that because
SymbolTable was created before we know what ELF type objects had been
passed.
Every time I tried to add a new function to the symbol table, I had to
define a dispatcher which consist of a single switch statement.
It also brought an restriction what the driver can do. For example,
we cannot add undefined symbols before any files are added to the symbol
table. That's because no symbols can be added until the symbol table
knows the ELF type, but when it knows about that, it's too late.
In this patch, the driver makes a decision on what ELF type objects
are being handled. Then the driver creates a SymbolTable object for
an appropriate ELF type.
http://reviews.llvm.org/D13544
llvm-svn: 249902
|
|
|
|
| |
llvm-svn: 249895
|
|
|
|
| |
llvm-svn: 249882
|
|
|
|
|
|
| |
The implementation is a direct translation to c++ of the rules in the ELF spec.
llvm-svn: 249881
|
|
|
|
|
|
| |
Found by inspection.
llvm-svn: 249843
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit r249816.
It broke building llvm with lld:
$ ./bin/FileCheck
./bin/FileCheck: error while loading shared libraries: unexpected PLT reloc type 0x06
I think the only thing that is wrong with this patch is that it is too soon.
The plt we create (and its relocs) don't support lazy loading, so they have
to be relocated as ordinary dynamic relocations.
llvm-svn: 249835
|
|
|
|
|
|
|
|
| |
.rela.plt contains list of elements in the PLT, which are liable to the relocation during the dynamic linking.
Differential Revision: http://reviews.llvm.org/D13569
llvm-svn: 249816
|
|
|
|
| |
llvm-svn: 249793
|
|
|
|
| |
llvm-svn: 249791
|
|
|
|
|
|
|
|
|
| |
The size of a .plt entry is different on different targets (it is,
specifically, much larger than 8 on all PPC ABIs). There is no functional
change here (later patches to create .plt entries for PPC64 will depend on this
change).
llvm-svn: 249756
|
|
|
|
|
|
|
| |
In preparation for making the size of a .plt entry target dependent, use the
existing EntrySize variable when writing (instead of a hard-coded value). NFC.
llvm-svn: 249720
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, output sections that are handled specially by the linker
(e.g. PLT or GOT) were created by Writer and passed to other classes
that need them. The problem was that because these special sections
are required by so many classes, the plumbing work became too much
burden.
This patch is to simply make them accessible from anywhere in the
linker to eliminate the plumbing work once and for all.
http://reviews.llvm.org/D13486
llvm-svn: 249590
|
|
|
|
|
|
| |
var.
llvm-svn: 249568
|
|
|
|
| |
llvm-svn: 249566
|
|
|
|
|
|
|
|
| |
When generating an executable or shared library, mark it to tell the dynamic linker to resolve all symbols when the program is started, or when the shared library is linked to using dlopen, instead of deferring function call resolution to the point when the function is first called.
Differential Revision: http://reviews.llvm.org/D13468
llvm-svn: 249551
|
|
|
|
| |
llvm-svn: 249524
|
|
|
|
| |
llvm-svn: 249520
|
|
|
|
|
|
|
| |
We were writing got entries in the first positions, not in the positions
corresponding to locally defined symbols.
llvm-svn: 249518
|
|
|
|
|
|
| |
If the symbol is not preemptable, we can use a R_X86_64_RELATIVE.
llvm-svn: 249496
|
|
|
|
| |
llvm-svn: 249488
|
|
|
|
| |
llvm-svn: 249485
|
|
|
|
| |
llvm-svn: 249428
|
|
|
|
|
|
|
|
|
|
| |
This is a case that requires --start-group --end-group with regular ELF
linkers. Fortunately it is still possible to handle it with lazy symbols without
taking a second look at archives.
Thanks to Michael Spencer for the bug report.
llvm-svn: 249406
|
|
|
|
| |
llvm-svn: 249404
|
|
|
|
|
|
|
| |
We were already doing the right thing if the symbol was seen in a shared
library, but not if it was completely missing.
llvm-svn: 249397
|
|
|
|
|
|
| |
We were mixing up the relocated and target sections.
llvm-svn: 249360
|
|
|
|
| |
llvm-svn: 249357
|
|
|
|
| |
llvm-svn: 249353
|
|
|
|
|
|
|
| |
The dynamic relocation code needs refactoring, but it is probably better
to do it with this test passing.
llvm-svn: 249340
|
|
|
|
|
|
| |
This matches the behavior of gold and bfd ld.
llvm-svn: 249326
|
|
|
|
| |
llvm-svn: 249324
|
|
|
|
|
|
|
| |
This matches the behavior of bfd ld and gold. It is also convenient for
testing other changes.
llvm-svn: 249323
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The entries are added if there are "_init" or "_fini" entries in
the symbol table respectively. According to the behavior of ld,
entries are inserted even for undefined symbols.
Symbol names can be overridden by using -init and -fini command
line switches. If used, these switches neither add new symbol table
entries nor require those symbols to be resolved.
Differential Revision: http://reviews.llvm.org/D13385
llvm-svn: 249297
|
|
|
|
|
|
|
| |
This adds entries in the dynamic table for .init_array, .fini_array and
.preinit_array.
llvm-svn: 249175
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using the "raw" Elf64_Dyn or Elf32_Dyn structures in
DynamicSection<ELFT>::writeTo does not correctly handle mixed-Endian
situations. Instead, use the corresponding llvm::object::* structures which
have Endian-converting members (like the rest of the code).
This fixes all currently-failing elf2 tests when running on big-Endian
PPC64/Linux (I've added a big-Endian test case which should fail on
little-Endian machines in the same way that test/elf2/shared.s failed on
big-Endian machines prior to this change).
llvm-svn: 249150
|
|
|
|
| |
llvm-svn: 249118
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sort by:
ALLOC
ALLOC && NOBITS
ALLOC & EXEC
ALLOC & EXEC && NOBITS
ALLOC & WRITE
ALLOC & WRITE && NOBITS
<nothing> (ignoring NOBITS)
The dynamic section is finalized early because it adds strings to the dynamic string table, which comes before the dynamic table.
llvm-svn: 249071
|
|
|
|
| |
llvm-svn: 249058
|
|
|
|
|
|
|
|
|
| |
If a shared library has a DT_SONAME entry, that is what should be included
in the DT_NEEDED of a program using it.
We don't implement -soname yet, so check in a .so for now.
llvm-svn: 249025
|
|
|
|
|
|
|
|
| |
According to the ELF specification, these dynamic array entries are mandatory.
http://reviews.llvm.org/D13303
llvm-svn: 248952
|
|
|
|
|
|
| |
So that it is clear that we are incrementing the pointers for sure. NFC.
llvm-svn: 248868
|
|
|
|
| |
llvm-svn: 248866
|
|
|
|
|
|
| |
Also added brief comments.
llvm-svn: 248864
|
|
|
|
|
|
| |
This is just enough for a hello world using a dynamic glibc.
llvm-svn: 248854
|
|
|
|
|
|
|
|
|
| |
They broke elf2/basic-mips.s.
Revert "[elf2] Sort output sections."
Revert "[elf2] Fix build."
llvm-svn: 248851
|
|
|
|
| |
llvm-svn: 248848
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sort by:
ALLOC
ALLOC && NOBITS
ALLOC & EXEC
ALLOC & EXEC && NOBITS
ALLOC & WRITE
ALLOC & WRITE && NOBITS
<nothing> (ignoring NOBITS)
The dynamic section is finalized early because it adds strings to the dynamic string table, which comes before the dynamic table.
llvm-svn: 248845
|