- Aug 10, 2017
-
-
Rafael Espindola authored
This is probably a small optimization, but the main motivation is having a way of fixing pr34053 that doesn't require a hash lookup in isPreempitible. llvm-svn: 310602
-
George Rimar authored
GC code contains following logic uncovered by tests: for (StringRef S : Config->Undefined) MarkSymbol(Symtab->find(S)); As far I can tell we never had test for that before, patch fixes it. Differential revision: https://reviews.llvm.org/D36519 llvm-svn: 310556
-
George Rimar authored
This patch restricts following construction: /DISCARD/ : { *(COMMON) } Previously LLD would crash. Differential revision: https://reviews.llvm.org/D36468 llvm-svn: 310554
-
- Aug 09, 2017
-
-
Rui Ueyama authored
--icf=none negates --icf=all. llvm-svn: 310526
-
Zachary Turner authored
In the refactor to merge the publics and globals stream, a bug was introduced that wrote the wrong value for one of the fields of the PublicsStreamHeader. This caused debugging in WinDbg to break. We had no way of dumping any of these fields, so in addition to fixing the bug I've added dumping support for them along with a test that verifies the correct value is written. llvm-svn: 310439
-
Zachary Turner authored
The publics stream and globals stream are very similar. They both contain a list of hash buckets that refer into a single shared stream, the symbol record stream. Because of the need for each builder to manage both an independent hash stream as well as a single shared record stream, making the two builders be independent entities is not the right design. This patch merges them into a single class, of which only a single instance is needed to create all 3 streams. PublicsStreamBuilder and GlobalsStreamBuilder are now merged into the single GSIStreamBuilder class, which writes all 3 streams at once. Note that this patch does not contain any functionality change. So we're still not yet writing any records to the globals stream. All we're doing is making it so that when we do start writing records to the globals, this refactor won't have to be part of that patch. Differential Revision: https://reviews.llvm.org/D36489 llvm-svn: 310438
-
- Aug 08, 2017
-
-
Zachary Turner authored
The compiler outputs PROC32_ID symbols into the object files for functions, and these symbols have an embedded type index which, when copied to the PDB, refer to the IPI stream. However, the symbols themselves are also converted into regular symbols (e.g. S_GPROC32_ID -> S_GPROC32), and type indices in the regular symbol records refer to the TPI stream. So this patch applies two fixes to function records. 1. It converts ID symbols to the proper non-ID record type. 2. After remapping the type index from the object file's index space to the PDB file/IPI stream's index space, it then remaps that index to the TPI stream's index space by. Besides functions, during the remapping process we were also discarding symbol record types which we did not recognize. In particular, we were discarding S_BPREL32 records, which is what MSVC uses to describe local variables on the stack. So this patch fixes that as well by copying them to the PDB. Differential Revision: https://reviews.llvm.org/D36426 llvm-svn: 310394
-
- Aug 07, 2017
-
-
Zachary Turner authored
llvm-svn: 310297
-
- Aug 05, 2017
-
-
Shoaib Meenai authored
Emit these symbols as long as we're building in a static configuration, even if we're emitting a dynamic symbol table. This is consistent with both bfd and gold. Ordinarily, the combination of -static and -export-dynamic wouldn't make much sense. Unfortunately, cmake versions prior to 3.4 forcefully injected -rdynamic [1], so it seems worthwhile to support. [1] https://cmake.org/cmake/help/v3.4/policy/CMP0065.html Differential Revision: https://reviews.llvm.org/D36350 llvm-svn: 310168
-
Rui Ueyama authored
llvm-svn: 310166
-
Rafael Espindola authored
With this Symbol has the same size as before, but DefinedRegular goes from 72 to 64 bytes. I also find this a bit easier to read. There are fewer places initializing File for example. This has a small but measurable speed improvement on all tests (1% max). llvm-svn: 310142
-
- Aug 04, 2017
-
-
Zachary Turner authored
llvm-svn: 310131
-
Zachary Turner authored
llvm-svn: 310130
-
Zachary Turner authored
llvm-svn: 310112
-
Nico Weber authored
llvm-svn: 310111
-
Zachary Turner authored
This matches the behavior of MSVC's linker. Differential Revision: https://reviews.llvm.org/D36334 llvm-svn: 310108
-
Zachary Turner authored
Image section headers are stored in the DBI stream, but we had no way to dump them. This patch adds dumping support, along with some tests that LLD actually dumps them correctly. Differential Revision: https://reviews.llvm.org/D36332 llvm-svn: 310107
-
Rafael Espindola authored
llvm-svn: 310090
-
Rafael Espindola authored
When reporting an invalid relocation we were blaming the destination file instead of the file with the relocation. llvm-svn: 310084
-
Rafael Espindola authored
llvm-svn: 310079
-
George Rimar authored
It can help to detemplate code. Differential revision: https://reviews.llvm.org/D35936 llvm-svn: 310049
-
George Rimar authored
D35945 introduces change when there is useless to check Error flag in few places, but ErrorCount must be checked instead. But then we probably can just check ErrorCount always. That should simplify things. Patch do that. Differential revision: https://reviews.llvm.org/D36266 llvm-svn: 310046
-
George Rimar authored
This is PR33889, Patch adds support of combination of linkerscript and -symbol-ordering-file option. If no sorting commands are present in script inside section declaration and no --sort-section option specified, code uses sorting from ordering file if any exist. Differential revision: https://reviews.llvm.org/D35843 llvm-svn: 310045
-
James Henderson authored
Following r309829, if a string table appears in an executable segment, the strings will not be null terminated. This is a problem, for example, for the .dynstr section when using -no-rosegment. The strings end up being terminated with 0xcc because prior to this patch, LLD did not explicitly write the null terminators. This change fixes that by always writing the null terminators. Reviewers: rafael Differential Revision: https://reviews.llvm.org/D36267 llvm-svn: 310042
-
George Rimar authored
Makes code a bit more convinent to write/read. Differential revision: https://reviews.llvm.org/D36089 llvm-svn: 310040
-
- Aug 03, 2017
-
-
Reid Kleckner authored
The PDB debug data directory entry has an absolute path in it. This will make it different on every machine. llvm-svn: 309989
-
Reid Kleckner authored
Summary: PDB section contributions are supposed to use output section indices and offsets, not input section indices and offsets. This allows the debugger to look up the index of the module that it should look up in the modules stream for symbol information. With this change, windbg can now find line tables, but it still cannot print local variables. Fixes PR34048 Reviewers: zturner Subscribers: hiraditya, ruiu, llvm-commits Differential Revision: https://reviews.llvm.org/D36285 llvm-svn: 309987
-
George Rimar authored
Following possible scripts triggered accessing to Target when it was not yet initialized (was nullptr). MEMORY { name : ORIGIN = DATA_SEGMENT_RELRO_END; } MEMORY { name : ORIGIN = CONSTANT(COMMONPAGESIZE); } Patch errors out instead. Differential revision: https://reviews.llvm.org/D36140 llvm-svn: 309953
-
Rafael Espindola authored
llvm-svn: 309913
-
Reid Kleckner authored
llvm-svn: 309902
-
Reid Kleckner authored
In order to get dbghelp to load our pdb, we have to fill in the PointerToRawData field as well as the AddressOfRawData field. One is the file offset and the other is the RVA. llvm-svn: 309900
-
- Aug 02, 2017
-
-
Rafael Espindola authored
Reviewing another change I noticed that we use "getSymbols" to mean different things in different files. Depending on the file it can return ArrayRef<StringRef> ArrayRef<SymbolBody*> ArrayRef<Symbol*> ArrayRef<Elf_Sym> With this change it always returns an ArrayRef<SymbolBody*>. The other functions are renamed getELFsyms() and getSymbolNames(). Note that we cannot return ArrayRef<Symbol*> instead of ArreyRef<SymbolBody*> because local symbols have a SymbolBody but not a Symbol. llvm-svn: 309840
-
Petr Hosek authored
When the data segment is the last segment, it is correct to leave it unaligned. However, when the code segment is the last segment, it should be aligned to the page boundary to avoid loading the non-segment parts of the ELF file at the end of the file. Differential Revision: https://reviews.llvm.org/D33630 llvm-svn: 309829
-
George Rimar authored
[ELF] - Recommit r309252 "[ELF] - Fix missing relocation when linking executable with --unresolved-symbols=ignore-all" With fix for undefined weak symbols in executable. Original commit message: This is PR32112. Previously when we linked executable with --unresolved-symbols=ignore-all and undefined symbols, like: _start: callq und@PLT we did not create relocations, though it looks in that case we should delegate handling of such symbols to runtime linker, hence should emit them. Patch fixes that. Differential revision: https://reviews.llvm.org/D35724 llvm-svn: 309796
-
- Aug 01, 2017
-
-
George Rimar authored
Enables multithreaded .gdb_index building. Differential revision: https://reviews.llvm.org/D36090 llvm-svn: 309688
-
Rui Ueyama authored
llvm-svn: 309654
-
Rui Ueyama authored
This change makes -gdb-index 40% faster. My test case is self-linking lld. Differential Revision: https://reviews.llvm.org/D36079 llvm-svn: 309652
-
- Jul 31, 2017
-
-
Zachary Turner authored
We don't write any actual symbols to this stream yet, but for now we just create the stream and hook it up to the appropriate places and give it a valid header. Differential Revision: https://reviews.llvm.org/D35290 llvm-svn: 309608
-
Rafael Espindola authored
Before we were doing it with --export-dynamic. That seems incorrect. The intention of --export-dynamic is to export symbols *defined* in the executable. llvm-svn: 309605
-
- Jul 28, 2017
-
-
Rafael Espindola authored
They were being placed before sections that were listed. llvm-svn: 309391
-