- Jan 09, 2017
-
-
Rui Ueyama authored
Previously, files added using INCLUDE directive weren't added to reproduce archives. In this patch, I defined a function to open a file and use that from Driver and LinkerScript. llvm-svn: 291413
-
- Jan 06, 2017
-
-
Rui Ueyama authored
This is how we use TarWriter in LLD. Now LLD does not append a file extension, so you need to pass `--reproduce foo.tar` instead of `--reproduce foo`. Differential Revision: https://reviews.llvm.org/D28103 llvm-svn: 291210
-
- Dec 23, 2016
-
-
Rui Ueyama authored
We managed new MemoryBuffers in different ways in LinkerScript.cpp and Driver.cpp. With this patch, they are managed in the same way. llvm-svn: 290411
-
- Dec 08, 2016
-
-
Rafael Espindola authored
The feature is documented as ----------------------------- The format of the dynamic list is the same as the version node without scope and node name. See *note VERSION:: for more information. -------------------------------- And indeed qt uses a dynamic list with an 'extern "C++"' in it. With this patch we support that The change to gc-sections-shared makes us match bfd. Just because we kept bar doesn't mean it has to be in the dynamic symbol table. The changes to invalid-dynamic-list.test and reproduce.s are because of the new parser. The changes to version-script.s are the only case where we change behavior with regards to bfd, but I would like to see a mix of --version-script and --dynamic-list used in the wild before complicating the code. llvm-svn: 289082
-
- Nov 20, 2016
-
-
Rui Ueyama authored
We have a .cpp and a .h for parseDynamicList(). This patch moves the function to DriverUtil.cpp. llvm-svn: 287468
-
- Nov 19, 2016
-
-
Rui Ueyama authored
llvm-svn: 287456
-
Rui Ueyama authored
This patch also changes its return type to simplify callers. llvm-svn: 287455
-
- Nov 11, 2016
-
-
Peter Collingbourne authored
The functions getBitcodeTargetTriple(), isBitcodeContainingObjCCategory(), getBitcodeProducerString() and hasGlobalValueSummary() now return errors via their return value rather than via the diagnostic handler. To make this work, re-implement these functions using non-member functions so that they can be used without the LLVMContext required by BitcodeReader. Differential Revision: https://reviews.llvm.org/D26532 llvm-svn: 286623
-
- Oct 28, 2016
-
-
Rui Ueyama authored
Previously, we have a lot of BumpPtrAllocators, but all these allocators virtually have the same lifetime because they are not freed until the linker finishes its job. This patch aggregates them into a single allocator. Differential revision: https://reviews.llvm.org/D26042 llvm-svn: 285452
-
- Oct 26, 2016
-
-
Rafael Espindola authored
As the state of lld gets more complicated, shutting down gets more expensive. In a normal lld run we can just call _exit immediately after renaming the temporary output file. We still want the ability to run a full shutdown since that is useful for detecting memory leaks. This patch adds a --full-shutdown flag and changes lit to use it. llvm-svn: 285224
-
Rui Ueyama authored
llvm-svn: 285164
-
- Oct 20, 2016
-
-
Rui Ueyama authored
This member is used only by LinkerDriver, so move it to LinkerDriver. llvm-svn: 284696
-
Rui Ueyama authored
llvm-svn: 284695
-
Rui Ueyama authored
llvm-svn: 284694
-
- Oct 19, 2016
-
-
Rui Ueyama authored
llvm-svn: 284641
-
- Sep 29, 2016
-
-
Rui Ueyama authored
llvm-svn: 282668
-
- Sep 14, 2016
-
-
Rui Ueyama authored
Previously, all input files were owned by the symbol table. Files were created at various places, such as the Driver, the lazy symbols, or the bitcode compiler, and the ownership of new files was transferred to the symbol table using std::unique_ptr. All input files were then free'd when the symbol table is freed which is on program exit. I think we don't have to transfer ownership just to free all instance at once on exit. In this patch, all instances are automatically collected to a vector and freed on exit. In this way, we no longer have to use std::unique_ptr. Differential Revision: https://reviews.llvm.org/D24493 llvm-svn: 281425
-
- Sep 10, 2016
-
-
Michael J. Spencer authored
Implemented by building an ELF file in memory. elf, default, and binary match gold behavior. Differential Revision: https://reviews.llvm.org/D24060 llvm-svn: 281108
-
- Jul 26, 2016
-
-
Peter Collingbourne authored
This flag is implemented similarly to --reproduce in the ELF linker. This patch implements /linkrepro by moving the cpio writer and associated utility functions to lldCore, and using that implementation in both linkers. One COFF-specific detail is that we store the object file from which the resource files were created in our reproducer, rather than the resource files themselves. This allows the reproducer to be used on non-Windows systems for example. Differential Revision: https://reviews.llvm.org/D22418 llvm-svn: 276719
-
- Jun 06, 2016
-
-
Rui Ueyama authored
Differential Revision: http://reviews.llvm.org/D21008 llvm-svn: 271901
-
- May 15, 2016
-
-
Rui Ueyama authored
This code separates the code to create cpio archive from the driver. llvm-svn: 269593
-
- May 13, 2016
-
-
Rui Ueyama authored
If you specify the option in the form of --build-id=0x<hexstring>, that hexstring is set as a build ID. We observed that the feature is actually in use in some builds, so we want this feature. llvm-svn: 269495
-
- May 03, 2016
-
-
Rafael Espindola authored
We want --reproduce to * not rewrite scripts and thin archives * work with absolute paths Given that, it pretty much has to create a full directory tree. On windows that is problematic because of the very short maximum path limit. On most cases users can still work around it with "--repro c:\r", but that is annoying and not viable for automated testing. We then need to produce some form of archive with the files. The first option that comes to mind is .a files since we already have code for writing them. There are a few problems with them The format has a dedicated string table, so we cannot start writing it until all members are known. Regular implementations don't support creating directories. We could make llvm-ar support that, but that is probably not a good idea. The next natural option would be tar. The problem is that to support long path names (which is how this started) it needs a "pax extended header" making this an annoying format to write. The next option I looked at seems a natural fit: cpio files. They are available on pretty much every unix, support directories and long path names and are really easy to write. The only slightly annoying part is a terminator, but at least gnu cpio only prints a warning if it is missing, which is handy for crashes. This patch still makes an effort to always create it. llvm-svn: 268404
-
- May 01, 2016
-
-
Rui Ueyama authored
Previuosly, only files appeared on the command line were copied. llvm-svn: 268171
-
- Apr 30, 2016
-
-
Rui Ueyama authored
The aim of this patch is to make it easy to re-run the command without updating paths in the command line. Here is a use case. Assume that Alice is having an issue with lld and is reporting the issue to developer Bob. Alice's current directly is /home/alice/work and her command line is "ld.lld -o foo foo.o ../bar.o". She adds "--reproduce repro" to the command line and re-run. Then the following text will be produced as response.txt (notice that the paths are rewritten so that they are relative to /home/alice/work/repro.) -o home/alice/work/foo home/alice/work/foo.o home/alice/bar.o The command also produces the following files by copying inputs. /home/alice/repro/home/alice/work/foo.o /home/alice/repro/home/alice/bar.o Alice zips the directory and send it to Bob. Bob get an archive from Alice and extract it to his home directory as /home/bob/repro. Now his directory have the following files. /home/bob/repro/response.txt /home/bob/repro/home/alice/work/foo.o /home/bob/repro/home/alice/bar.o Bob then re-run the command with these files by the following commands. cd /home/bob/repro ld.lld @response.txt This command will run the linker with the same command line options and the same input files as Alice's, so it is very likely that Bob will see the same issue as Alice saw. Differential Revision: http://reviews.llvm.org/D19737 llvm-svn: 268169
-
- Apr 28, 2016
-
-
Rafael Espindola authored
Using multiple context used to be a really big memory saving because we could free memory from each file while the linker proceeded with the symbol resolution. We are getting lazier about reading data from the bitcode, so I was curious if this was still a good tradeoff. One thing that is a bit annoying is that we still have to copy the symbol names. The problem is that the names are stored in the Module and get freed when we move the module bits during linking. Long term I think the solution is to add a symbol table to the bitcode. That way IRObject file will not need to use a Module or a Context and we can drop it while still keeping a StringRef to the names. This patch is still be an interesting medium term improvement. When linking llvm-as without debug info this patch is a small speedup: master: 29.861877513 seconds patch: 29.814533787 seconds With debug info the numbers are master: 34.765181469 seconds patch: 34.563351584 seconds The peak memory usage when linking llvm-as with debug info was master: 599.10MB patch: 600.13MB llvm-svn: 267921
-
- Apr 26, 2016
-
-
Rui Ueyama authored
llvm-svn: 267602
-
- Apr 22, 2016
-
-
Peter Collingbourne authored
This patch only implements support for version scripts of the form: { [ global: symbol1; symbol2; [...]; symbolN; ] local: *; }; No wildcards are supported, other than for the local entry. Symbol versioning is also not supported. It works by introducing a new Symbol flag which tracks whether a symbol appears in the global section of a version script. This patch also simplifies the logic in SymbolBody::isPreemptible(), and teaches it to handle the case where symbols with default visibility in DSOs do not appear in the dynamic symbol table because of a version script. Fixes PR27482. Differential Revision: http://reviews.llvm.org/D19430 llvm-svn: 267208
-
- Apr 13, 2016
-
-
Rafael Espindola authored
llvm-svn: 266231
-
Adhemerval Zanella authored
This patch implements the --dynamic-list option, which adds a list of global symbol that either should not be bounded by default definition when creating shared libraries, or add in dynamic symbol table in the case of creating executables. The patch modifies the ScriptParserBase class to use a list of Token instead of StringRef, which contains information if the token is a quoted or unquoted strings. It is used to use a faster search for exact match symbol name. The input file follow a similar format of linker script with some simplifications (it does not have scope or node names). It leads to a simplified parser define in DynamicList.{cpp,h}. Different from ld/gold neither glob pattern nor mangled names (extern 'C++') are currently supported. llvm-svn: 266227
-
- Apr 07, 2016
-
-
Rui Ueyama authored
start-lib and end-lib are options to link object files in the same semantics as archive files. If an object is in start-lib and end-lib, the object is linked only when the file is needed to resolve undefined symbols. That means, if an object is in start-lib and end-lib, it behaves as if it were in an archive file. In this patch, I introduced a new notion, LazyObjectFile. That is analogous to Archive file type, but that works for a single object file instead of for an archive file. http://reviews.llvm.org/D18814 llvm-svn: 265710
-
- Apr 01, 2016
-
-
Peter Collingbourne authored
Differential Revision: http://reviews.llvm.org/D18669 llvm-svn: 265073
-
- Mar 15, 2016
-
-
Rui Ueyama authored
Fixes pr26908. This patch is based on Filipe Cabecinhas' patch (http://reviews.llvm.org/D18167) http://reviews.llvm.org/D18169 llvm-svn: 263569
-
- Mar 02, 2016
-
-
Rui Ueyama authored
Now that DarwinLdDriver is the only derived class of Driver. This patch merges them and actually removed the class because they can now just be non-member functions. This change simplifies a common header, Driver.h. http://reviews.llvm.org/D17788 llvm-svn: 262502
-
- Feb 28, 2016
-
-
Rui Ueyama authored
llvm-svn: 262168
-
Rui Ueyama authored
llvm-svn: 262167
-
Rafael Espindola authored
llvm-svn: 262159
-
- Feb 11, 2016
-
-
Rui Ueyama authored
llvm-svn: 260598
-
- Feb 02, 2016
-
-
Rui Ueyama authored
http://reviews.llvm.org/D16668 llvm-svn: 259597
-
Rui Ueyama authored
This reverts r259395 which reverted r259143. llvm-svn: 259572
-