- Dec 09, 2013
-
-
Rui Ueyama authored
/ALTERNATENAME is a rarely-used, undocumented command line option that is needed to link LLD for release build. It seems that the option is for defining an weak alias; /alternatename:foo=bar defines weak symbol "foo" for "bar". If "foo" is defined in an input file, it'll be linked normally and the command line option will have no effect. If it's not defined, "foo" will be handled as an alias for "bar". This patch implements the parser for the option. The actual weak alias handling will be implemented in a separate patch. llvm-svn: 196743
-
Rui Ueyama authored
llvm-svn: 196741
-
- Dec 08, 2013
-
-
Rui Ueyama authored
llvm-svn: 196716
-
Rui Ueyama authored
Because compare() and its heper functions no longer have to be members of LayoutPass class, we can remove it from the class. No functionality change. llvm-svn: 196715
-
Rui Ueyama authored
The comparator used in the layout pass has many calls of map::find(). Because std::sort runs the comparator N*log2(N) times, the maps are looked up with the same key again and again. The map lookup is not a very fast operation. It made the pass slow. This patch eliminates the duplicate map lookups using decorate-sort-undecorate idiom. The pass used to take 1.1 seconds when linking LLD with LLD on Windows, but it now takes only 0.3 seconds. Overall performance gain in that case is from 6.1 seconds to 5.2 seconds. Differential Revision: http://llvm-reviews.chandlerc.com/D2358 llvm-svn: 196714
-
- Dec 07, 2013
-
-
Rui Ueyama authored
GroupedSectionsPass was a complicated pass. That pass's job was to reorder atoms by section name, so that the atoms with the same section prefix will be emitted consecutively to the executable. The pass added layout edges to atoms, and let the layout pass to actually reorder them. This patch simplifies the design by making GroupedSectionPass to directly reorder atoms, rather than adding layout edges. This resembles ELF's ArrayOrderPass. This patch improves the performance of LLD; it used to take 7.1 seconds to link LLD with LLD on my Macbook Pro, but it now takes 6.1 seconds. llvm-svn: 196628
-
- Dec 06, 2013
-
-
Rui Ueyama authored
llvm-svn: 196564
-
Rui Ueyama authored
llvm-svn: 196563
-
Rui Ueyama authored
llvm-svn: 196562
-
- Dec 05, 2013
-
-
Rui Ueyama authored
llvm-svn: 196505
-
Rui Ueyama authored
Currently we do not de-duplicate library files specified by /defaultlib option. As a result, the same files are added multiple times to the input graph. In particular, some popular files, such as kernel32.lib or oldnames.lib, are added more than 10 times during linking of LLD. That makes the linker slower, as it needs to parse the same file again and again. This patch solves the issue by de-duplicating. The same file will be added only once to the input graph. This patch improved the LLD linking time from 10.5 seconds to 7.7 seconds on my 4-core Core i7 Macbook Pro. llvm-svn: 196504
-
Rui Ueyama authored
Because ArrayRef has implicit conversion from C arrays, we don't need makeArrayRef. llvm-svn: 196475
-
Rui Ueyama authored
llvm-svn: 196465
-
Rui Ueyama authored
Emitting idata atoms to their own section would make debugging easier. The Windows loader do not really care about whether the DLL import table is in .rdata or its own .idata section, so there is no change in functionality. llvm-svn: 196458
-
- Dec 04, 2013
-
-
Rui Ueyama authored
llvm-svn: 196366
-
Rui Ueyama authored
If /functionpadmin is specified, the linker is supposed to make room at the beginning of each function, so that self-modifying program would easily hotpatch existing functions. Since I'm not sure if this feature is really used, I'll make LLD to ignore the option for now. llvm-svn: 196363
-
Rui Ueyama authored
llvm-svn: 196332
-
- Dec 03, 2013
-
-
Rui Ueyama authored
These relocations are used in .debug section. llvm-svn: 196262
-
Rui Ueyama authored
llvm-svn: 196200
-
Rui Ueyama authored
llvm-svn: 196196
-
Rui Ueyama authored
llvm-svn: 196185
-
- Dec 02, 2013
-
-
Rui Ueyama authored
llvm-svn: 196092
-
Rui Ueyama authored
This reverts commit r195852 because LLD seems to create broken executables with that patch when compiled with MSVC 2013. llvm-svn: 196078
-
Alp Toker authored
llvm-svn: 196056
-
Rui Ueyama authored
llvm-svn: 196055
-
Alp Toker authored
llvm-svn: 196054
-
Alp Toker authored
No change in functionality. llvm-svn: 196053
-
- Dec 01, 2013
-
-
Rui Ueyama authored
/DEBUG option is to make the linker to emit debug information to the resulting executable. It's not for enable debugging of the linker itself. llvm-svn: 196040
-
- Nov 28, 2013
-
-
Rui Ueyama authored
This is a patch to let the PECOFF writer to use the information passed by the parser for /section option. The implementation of /section should now be complete. llvm-svn: 195893
-
- Nov 27, 2013
-
-
Rui Ueyama authored
/MERGE option is a bit complicated for many reasons. Firstly, it takes both positive and negative arguments. That means we have to have one of three distinctive values (set, clear or unchange) for each permission bit. In this patch we represent the three values using two bitmasks. Secondly, the permissions specified by the parameter is bitwise or-ed with the default permissions of a section. There is an exception for that rule; if one of READ, WRITE or EXECUTE bit is specified, unspecified bits need to be cleared. (So if you specify only WRITE for example, the resulting section will not have WRITE nor EXECUTE bits.) Lastly, multiple /merge options are allowed. llvm-svn: 195882
-
Rui Ueyama authored
This patch is to improve the readability of the tests before making a change to /merge option. llvm-svn: 195863
-
Rui Ueyama authored
/MERGE:foo=bar command line option merges section foo to section bar. If section bar does not exist, foo is just renamed as bar. llvm-svn: 195856
-
Rui Ueyama authored
llvm-svn: 195855
-
Rui Ueyama authored
llvm-svn: 195854
-
Rui Ueyama authored
llvm-svn: 195853
-
Rui Ueyama authored
Atom ordinals are the indeces in a file. Currently the PECOFF reader assigns ordinals for each section, so it's (incorrectly) assigning duplicate ordinals. llvm-svn: 195852
-
Rui Ueyama authored
llvm-svn: 195801
-
Rui Ueyama authored
Instead of having multiple SectionChunks for each section (.text, .data, .rdata and .bss), we could have one chunk writer that can emit any sections. This patch does that -- removing all section-sepcific chunk writers and replace them with one "generic" writer. This change should simplify the code because it eliminates similar-but- slightly-different classes. It also fixes an issue in the previous design. Before this patch, we could emit only limited set of sections (i.e. .text, .data, .rdata and .bss). With this patch, we can emit any sections. llvm-svn: 195797
-
Rui Ueyama authored
This reverts accidental commit r195794. llvm-svn: 195795
-
Rui Ueyama authored
llvm-svn: 195794
-