We were still fetching them when the archive was seen first.
We should experiment with just letting lazy symbols get to compare, it
might be cleaner for ELF.
llvm-svn: 249417
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
This was clearly wrong (thanks Rui for spotting), and I honestly would
like to get this tested so such mistakes won't repeat. Unfortunately, I
wasn't (easily) able to craft a test that exposes the bad behavior.
Ideally, we would like to get tests of this kind for all relocations, but
at the time of writing, this is not true. So, for now just fix this bug
and try to re-evaluate a way to test this in the future.
llvm-svn: 249359
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
Add symbol specified with -u as undefined which may cause additional
object files from archives to be linked into the resulting binary.
Differential Revision: http://reviews.llvm.org/D13345
llvm-svn: 249295
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
Found while testing a FreeBSD base system build with lld. Ignored for
now while we continue to identify missing options and functionality.
llvm-svn: 249144
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
Summary:
If --whole-archive is used, all symbols from the following archives are added to the output. --no-whole-archive restores default behavior. These switches can be used multiple times.
NB. We have to keep an ArchiveFile instance within SymbolTable even if --whole-archive mode is active since it can be a thin archive which contains just names of external files. In that case actual memory buffers for the archive members will be stored within the File member of ArchiveFile class.
Reviewers: rafael, ruiu
Subscribers: grimar, llvm-commits
Projects: #lld
Differential Revision: http://reviews.llvm.org/D13286
llvm-svn: 249045