- Sep 21, 2015
-
-
Rui Ueyama authored
This is an LLD extension to MSVC link.exe command line. MSVC linker does not write symbol tables for executables. We do unless no /debug option is given. There's a situation that we want to enable debug info but don't want to emit the symbol table. One example is when we are comparing output file size. With this patch, you can tell the linker to not create a symbol table by just specifying /nosymtab. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@248225 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 19, 2015
-
-
Rui Ueyama authored
Conceptually, garbage collection is not part of Writer, so move the function out of the file. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@248099 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@248081 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 18, 2015
-
-
Rui Ueyama authored
This patch saves 4 ms out of 5 ms. Very small improvement, but maybe better than nothing. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@248063 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
Self-hosting took 801 ms on my machine. Of which this function took 69 ms. Now it takes 37 ms. That is about 4% overall performance improvement. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@248052 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 16, 2015
-
-
Rui Ueyama authored
Basically the concept of "liveness" is for sections (or chunks in LLD terminology) and not for symbols. Symbols are always available or live, or otherwise it indicates a link failure. Previously, we had isLive() and markLive() methods for DefinedSymbol. They are confusing methods. What they actually did is to act as a proxy to backing section chunks. We can simplify eliminate these methods and call section chunk's methods directly. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@247869 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
Only live symbols are written to the symbol table. Because isLive() returned false if dead-stripping was disabled entirely, only non-COMDAT sections were written to the symbol table. This patch fixes the issue. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@247856 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
Now that ICF is complete, we can rename this option so that the driver accepts the MSVC-compatible command line option. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@247816 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 03, 2015
-
-
Rui Ueyama authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@246770 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 02, 2015
-
-
Rui Ueyama authored
This patch fixes a subtle incompatibility with MSVC linker. MSVC linker preserves the original spelling of a DLL in the import descriptor table. LLD previously converted all characters to lowercase. Usually this difference is benign, but if a program explicitly checks for DLL file names, the program could fail. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@246620 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Aug 17, 2015
-
-
Rui Ueyama authored
There are some DLLs whose initializers depends on other DLLs' initializers. The initialization order matters for them. MSVC linker uses the order of the libraries from the command line. LLD used ASCII-betical order. So they were incompatible. This patch makes LLD compatible with MSVC. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@245201 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
A short import library has up to two symbols, so we don't have to do a for-loop and type dispatch in createImportTables. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@245200 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Aug 14, 2015
-
-
Rafael Espindola authored
This is more convenient than the offset from the start of the file as we don't have to worry about it changing when we move the output section. This is a port of r245008 from ELF. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@245018 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Aug 13, 2015
-
-
Rafael Espindola authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@244849 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Aug 11, 2015
-
-
Rui Ueyama authored
Sections must start at page boundaries in memory, but they can be aligned to sector boundaries (512-bytes) on disk. We aligned them to 4096-byte boundaries even on disk, so we wasted disk space a bit. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@244691 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Aug 07, 2015
-
-
Rui Ueyama authored
Handling the symbol this way is consistent with other symbols, such as _tls_used. NFC. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@244367 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@244365 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Aug 06, 2015
-
-
Rafael Espindola authored
This has a few advantages * Less C++ code (about 300 lines less). * Less machine code (about 14 KB of text on a linux x86_64 build). * It is more debugger friendly. Just set a breakpoint on the exit function and you get the complete lld stack trace of when the error was found. * It is a more robust API. The errors are handled early and we don't get a std::error_code hot potato being passed around. * In most cases the error function in a better position to print diagnostics (it has more context). git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@244215 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
On ARM, exception handler entries in .pdata section are 8 byte long. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@244191 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Aug 05, 2015
-
-
Rui Ueyama authored
Various parameters are passed implicitly using Config global variable already. Output file path is no different from others, so there was no special reason to handle that differnetly. This patch changes the signature of writeResult(SymbolTable *, StringRef) to writeResult(SymbolTable *). git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@244180 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@244175 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 30, 2015
-
-
Rui Ueyama authored
I don't remember why I thought that only functions are subject of garbage collection, but the comment here said so, which is not correct. Moreover, the code just below the comment does not do what the comment says -- it handles non-COMDAT, non-function sections as GC root. As a result, it just handles non-COMDAT sections as GC root. This patch cleans that up by removing SectionChunk::isRoot and use isCOMDAT instead. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243700 91177308-0d34-0410-b5e6-96231b3b80d8
-
David Majnemer authored
We want to convince the NT loader not to map these sections into memory. A good first step is to move them to the end of the executable. Differential Revision: http://reviews.llvm.org/D11655 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243680 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 29, 2015
-
-
Rui Ueyama authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243588 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
Windows ARM is the thumb ARM environment, and pointers to thumb code needs to have its LSB set. When we apply relocations, we need to adjust the LSB if it points to an executable section. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243560 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
SECREL should sets the 32-bit offset of the target from the beginning of *target's* output section. Previously, the offset from the beginning of source's output section was used instead. SECTION means the target section's index, and not the source section's index. This patch fixes that issue too. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243535 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243532 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 28, 2015
-
-
Rui Ueyama authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243495 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
Previously, we ignore /merge option if /debug is specified because I thought that was MSVC linker did. This was wrong. /merge shouldn't be ignored even in debug mode. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243375 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243373 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243358 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 27, 2015
-
-
Rui Ueyama authored
Previously no __imp_ symbols nor dllimport thunk functions were written to a symbol table. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243350 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 25, 2015
-
-
Rui Ueyama authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243229 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243199 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
On x64 and x86, we use only one base relocation type, so we handled base relocations just as a list of RVAs. That doesn't work well for ARM becuase we have to handle two types of base relocations on ARM. This patch changes the type of base relocation from uint32_t to {reltype, uint32_t} to make it easy to port this code to ARM. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243197 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 24, 2015
-
-
Rui Ueyama authored
An object file compatible with Safe SEH contains a .sxdata section. The section contains a list of symbol table indices, each of which is an exception handler function. A safe SEH-enabled executable contains a list of exception handler RVAs. So, what the linker has to do to support Safe SEH is basically to read the .sxdata section, interpret the contents as a list of symbol indices, unique-fy and sort their RVAs, and then emit that list to .rdata. This patch implements that feature. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243182 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
__ImageBase is a special symbol whose value is the image base address. Previously, we handled __ImageBase symbol as an absolute symbol. Absolute symbols point to specific locations in memory and the locations never change even if an image is base-relocated. That means that we don't have base relocation entries for absolute symbols. This is not a case for __ImageBase. If an image is base-relocated, its base address changes, and __ImageBase needs to be shifted as well. So we have to have base relocations for __ImageBase. That means that __ImageBase is not really an absolute symbol but a different kind of symbol. In this patch, I introduced a new type of symbol -- DefinedRelative. DefinedRelative is similar to DefinedAbsolute, but it has not a VA but RVA and is a subject of base relocation. Currently only __ImageBase is of the new symbol type. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@243176 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 16, 2015
-
-
Rui Ueyama authored
Load Configuration field points to a structure containing information for SEH. That data strucutre is not created by the linker but provided by an external file. What we have to do is just to set __load_config_used address to the header. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242427 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 13, 2015
-
-
Rui Ueyama authored
If /delayload option is given, we have to resolve __delayLoadHelper2 since the function is the dynamic loader to delay-load DLLs. The function name is mangled in x86 as ___delayLoadHelper2@8. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242078 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rui Ueyama authored
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242066 91177308-0d34-0410-b5e6-96231b3b80d8
-