Rui Ueyama
e96044a370
[lld] Move AtomLayout from ELF to ReaderWriter so that it can be used by non-ELF writers.
...
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D977
llvm-svn: 184061
2013-06-16 17:14:58 +00:00
Shankar Easwaran
a97f12e00a
[ELF] Add test so that _end value is set appropriately for NMAGIC/OMAGIC executables(Fix comment from espindola)
...
llvm-svn: 184060
2013-06-16 15:06:18 +00:00
Benjamin Kramer
2b004debde
Fix typo in comment. Found by -Wdocumentation.
...
llvm-svn: 184058
2013-06-16 11:09:47 +00:00
Shankar Easwaran
a42a473893
[ELF] add NMAGIC/OMAGIC support
...
llvm-svn: 184055
2013-06-16 05:06:28 +00:00
Rui Ueyama
4a4079e839
[WinLink] Support /nxcompat command line option.
...
llvm-svn: 184050
2013-06-16 03:07:08 +00:00
Rui Ueyama
3b0321c182
[PECOFF] Add a test for r184036.
...
llvm-svn: 184037
2013-06-15 05:20:05 +00:00
Rui Ueyama
b95e833278
[PECOFF] Support .lib archive file.
...
Archive file in Windows has file extension of ".lib" but the file format is
in fact the same as Unix. It's an ar archive holding multiple .obj files.
The existing archive reader can read .lib files.
llvm-svn: 184036
2013-06-15 05:15:41 +00:00
Rui Ueyama
779a714766
[PECOFF] Handle scope of absolute atom correctly.
...
llvm-svn: 184035
2013-06-15 05:04:07 +00:00
Rui Ueyama
642c1a2968
[PECOFF] Fix build error on Win64.
...
llvm-svn: 183965
2013-06-14 02:43:30 +00:00
Rui Ueyama
ef2c5413a9
[lld][PECOFF] Read relocation entries.
...
Summary:
COFFReference class is defined to represent relocation information for
COFFDefinedAtom, as ELFReference for ELFDefinedAtom. ReaderCOFF can now
read relocation entries and create COFFReferences accordingly.
I need to make WriterPECOFF to handle the relocation references created by
the reader, but this patch is already big, so I think it's probably better
to get it reviewed now.
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D976
llvm-svn: 183964
2013-06-14 02:30:34 +00:00
Rui Ueyama
78a617f4c1
[PECOFF] Make readSymbolTable a const function.
...
llvm-svn: 183887
2013-06-13 05:23:47 +00:00
Rui Ueyama
8338716e8d
[ARM] Remove isThumb() as it's not used and it's not in the right place.
...
Architecture specific code should reside in architecture specific directory
not in Atom. Looks like there are no efforts being made at this moment to
support ARM, so let's remove it for now.
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D959
llvm-svn: 183877
2013-06-13 00:26:16 +00:00
Rui Ueyama
cc14c02f7f
[PECOFF] Define constants for page size and disk sector size.
...
llvm-svn: 183876
2013-06-12 23:45:32 +00:00
Rui Ueyama
2e3c4025ae
[PECOFF] Rename basic.test -> trivial.test.
...
Because the test does not actually cover basic features.
llvm-svn: 183870
2013-06-12 22:19:05 +00:00
Rui Ueyama
0e17c37c57
[PECOFF] Test for r183705.
...
llvm-svn: 183853
2013-06-12 19:13:27 +00:00
Rui Ueyama
969e70265a
[ELF] Remove unused parameter from ELFReference c'tor.
...
Reviewers: shankarke
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D961
llvm-svn: 183850
2013-06-12 18:21:36 +00:00
Shankar Easwaran
ec36f9a734
[test] fix test as the atom name is available only in DEBUG mode
...
llvm-svn: 183819
2013-06-12 00:46:37 +00:00
Shankar Easwaran
08470c4b6b
[ELF][X86_64] Create GOT entries for external TLS symbols properly without Segfaults.
...
llvm-svn: 183817
2013-06-12 00:32:39 +00:00
Shankar Easwaran
79dbc5b5d1
[ELF] NMAGIC support : Find the BSS section to setup the virtual address of _end.
...
llvm-svn: 183816
2013-06-12 00:32:35 +00:00
Shankar Easwaran
d5ff08ca5f
[ELF] TBSS section has to be special cased so that it doesnot occupy memory space
...
llvm-svn: 183815
2013-06-12 00:32:32 +00:00
Rui Ueyama
9f56df8e43
[Darwin][Driver] Add unit tests.
...
llvm-svn: 183806
2013-06-11 23:07:43 +00:00
Rafael Espindola
70d0c820ef
Include Path.h instead of PathV2.h.
...
I am about to move PathV2.h to Path.h.
llvm-svn: 183796
2013-06-11 22:17:04 +00:00
Rui Ueyama
dd76f067f7
[PECOFF][Writer] Structure of pe32_header was changed.
...
Change for http://llvm-reviews.chandlerc.com/D952
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D953
llvm-svn: 183789
2013-06-11 21:39:58 +00:00
Rafael Espindola
2fa59a9330
Convert another use of sys::identifyFileType.
...
No functionality change.
llvm-svn: 183762
2013-06-11 18:12:28 +00:00
Rafael Espindola
c1b32686fe
Factor duplicated yamlReader creation.
...
The yaml reader is not specific to any file format. This patch moves
it to TargetInfo and makes validate a non virtual interface so that it
can be constructed from a single location.
The same method will be used to create a reader for llvm bitcode
files.
llvm-svn: 183740
2013-06-11 12:36:05 +00:00
Rui Ueyama
daadcc59ad
[WinLink] Add -force command line option to allow undefined symbols.
...
llvm-svn: 183724
2013-06-11 04:52:14 +00:00
Rui Ueyama
fe36b40019
[PECOFF] Refactoring: Split FileCOFF c'tor. No functionality change.
...
Split FileCOFF's constructor into mainly two private methods.
One method is responsible to iterate over symbol tables, and other
method is to atomize defined atoms. This is for readability and
no changes in functionality.
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D940
llvm-svn: 183708
2013-06-10 22:57:49 +00:00
Rui Ueyama
787ee4e099
[PECOFF][Writer] Set required OS version numbers.
...
llvm-svn: 183705
2013-06-10 22:25:41 +00:00
Rui Ueyama
b07cebffb2
[PECOFF] Add comments for symbols.
...
llvm-svn: 183700
2013-06-10 22:09:21 +00:00
Rui Ueyama
e3ee514aa7
[ELF] Refactor File.h.
...
- Split createAtom() in lib/ReaderWriter/ELF/File.h into small methods.
- Added comments to code in other methods.
No functionality changes.
Reviewers: shankarke
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D921
llvm-svn: 183696
2013-06-10 21:32:44 +00:00
Rafael Espindola
808dfba985
Use the StringRef version of identifyFileType.
...
llvm-svn: 183670
2013-06-10 15:36:21 +00:00
Rafael Espindola
4cdc6c14ed
Use early returns.
...
No functionality change.
llvm-svn: 183659
2013-06-10 14:27:58 +00:00
Rui Ueyama
9dd08d912d
[PECOFF][Driver] Add -heap command line option.
...
llvm-svn: 183622
2013-06-08 22:59:10 +00:00
Rui Ueyama
eb0cc96e4b
[PECOFF][Driver] Add -stack command line option.
...
llvm-svn: 183604
2013-06-08 03:59:00 +00:00
Rui Ueyama
7b5592bc0b
[WinLink] Fix use-after-return.
...
llvm-svn: 183603
2013-06-08 03:39:35 +00:00
Rafael Espindola
a0af48fc93
Fix handling of files without a symbol table.
...
This fixes a recent regression (r183338). Stripped elf files (like installed
crtn.o for example), are not required to have a symbol table. Handle that
correctly.
llvm-svn: 183573
2013-06-07 21:08:19 +00:00
Rui Ueyama
a6b71cabb3
[LayoutPass] Add a method to check the followon graph structure.
...
Found that having a method to check the strucutre of the followon graph makes
it easy to debug file readers. The method checks if there's no wrong edge in
followOnNexts and followOnRoots. It is called only when debuggging is enabled
for LayoutPass.
Reviewers: shankarke
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D922
llvm-svn: 183553
2013-06-07 20:18:39 +00:00
Rui Ueyama
8d6151fd29
[PECOFF][Writer] Implement the writer that can emit text section.
...
lld can now output a valid Windows executable with a text section that does nothing
but just returns immediately. It's not able to handle relocations, symbol tables,
data sections, etc, so it still can't do anything practical, though.
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D892
llvm-svn: 183478
2013-06-07 01:31:51 +00:00
Rui Ueyama
911d60a1e4
[Driver][Core] Handle -mllvm option.
...
llvm-svn: 183347
2013-06-05 23:19:18 +00:00
Rafael Espindola
0b87956542
Update for llvm's r183337.
...
llvm-svn: 183338
2013-06-05 20:35:36 +00:00
Rafael Espindola
e699c60021
Now that llvm-readobj is fixed, enable this test.
...
llvm-svn: 183285
2013-06-05 01:38:12 +00:00
Rui Ueyama
143672c7e5
[lld][ELF] Add parser for linker script ENTRY command
...
This is the parser for the ENTRY command. Note that because the parsing result
is currentlyd discarded, lld can parse but just ignore the command.
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D833
llvm-svn: 183141
2013-06-03 18:05:21 +00:00
Rui Ueyama
feaa72a4b0
Fix typo in comment.
...
llvm-svn: 183050
2013-05-31 22:08:30 +00:00
Rui Ueyama
739730e299
[WinLink][Driver] Add -entry command line option.
...
llvm-svn: 183034
2013-05-31 19:34:29 +00:00
Rui Ueyama
ce42bcc304
[WinLink][Driver] Add support for -subsystem optional OS version number.
...
llvm-svn: 182988
2013-05-31 06:30:10 +00:00
Rui Ueyama
d752c9cc89
Fix typo in file header.
...
llvm-svn: 182985
2013-05-31 04:46:44 +00:00
Rui Ueyama
7eb1d49a58
[Driver] Add unit tests for GnuLdDriver.
...
llvm-svn: 182980
2013-05-31 02:12:34 +00:00
Michael J. Spencer
615c076fc1
Revert "[Passes] Parallelize the layout pass sort."
...
Inconsistent (and wrong) sort order on non-Windows.
llvm-svn: 182975
2013-05-31 00:05:49 +00:00
Rui Ueyama
a21397fb01
[WinLink] Add a test for Windows-style command line options.
...
llvm-svn: 182971
2013-05-30 23:29:28 +00:00
Rui Ueyama
5f037590de
[lld][WinLink] Fix use-after-return and add unit tests.
...
llvm-svn: 182970
2013-05-30 23:17:58 +00:00
Rui Ueyama
b33e8bcef8
[WinLink][Driver] Handle file extensions and defualt output file name.
...
llvm-svn: 182912
2013-05-30 06:00:10 +00:00
Shankar Easwaran
a5008e3a63
[lld][elf] Add --dynamic-linker option to the ELF linker.
...
Users can override the default value of the dynamic linker to be set to the
one that appears in the command line. The path can even be empty!.
Added a test for the option.
llvm-svn: 182889
2013-05-29 22:51:01 +00:00
Rui Ueyama
81247063bf
[WinLink] Add -subsystem and -out command line option parsing.
...
The code to actually consume these flags will be added soon.
llvm-svn: 182824
2013-05-29 05:07:49 +00:00
Michael J. Spencer
20cd8b6114
Parallel write.
...
llvm-svn: 182795
2013-05-28 19:09:56 +00:00
Michael J. Spencer
5b904eccad
[Core] Add parallel_for_each.
...
llvm-svn: 182794
2013-05-28 19:09:39 +00:00
Michael J. Spencer
9ae1408556
[ELF] Make addressOfAtom thread safe.
...
The expression _atomToAddressMap[atom] may modify _atomToAddressMap.
llvm-svn: 182793
2013-05-28 19:09:25 +00:00
Michael J. Spencer
0d9d3110c7
[Passes] Parallelize the layout pass sort.
...
llvm-svn: 182792
2013-05-28 19:03:29 +00:00
Michael J. Spencer
bd66d04f34
Instrument things.
...
llvm-svn: 182789
2013-05-28 18:55:39 +00:00
Michael J. Spencer
427354ee21
[ELF][Reader] Kind in this context refers to File::Kind. Qualify with Reference::Kind.
...
llvm-svn: 182787
2013-05-28 18:43:17 +00:00
Michael J. Spencer
e5b8fe1274
[Driver] Parallelize reading initial object files.
...
llvm-svn: 182786
2013-05-28 18:37:39 +00:00
Rui Ueyama
9e56839a83
[lld][PECOFF] Add WinLinkDriver and PECOFFTargetInfo.
...
Add WinLinkDriver and connect it to the existing COFF reader. Remaining
parts are still stubs, so while it can now read a COFF file, it still
cannot link or output PE/COFF files yet.
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D865
llvm-svn: 182784
2013-05-28 18:13:31 +00:00
Rui Ueyama
4cf437a1e9
[PECOFF] Skip section names in the symbol table because they are not atoms.
...
llvm-svn: 182721
2013-05-26 23:09:01 +00:00
Rui Ueyama
37645e5953
Remove unreachable statement.
...
llvm-svn: 182714
2013-05-26 01:25:39 +00:00
Rui Ueyama
f52a930cfb
Fix indentation.
...
llvm-svn: 182709
2013-05-25 04:59:32 +00:00
Michael J. Spencer
e24b872188
Use new version of countLeadingZeros.
...
llvm-svn: 182697
2013-05-25 00:25:21 +00:00
Rui Ueyama
25c208c020
[lld][LayoutPass] Add comment on _followOn{Nexts,Roots}.
...
Reviewers: shankarke
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D847
llvm-svn: 182595
2013-05-23 17:43:39 +00:00
Rui Ueyama
9c4f89ad2d
[lld][LayoutPass] Consolidate debug flags, removing "layout" flag.
...
DEBUG_TYPE is already defined at the beginning of this file. We don't
want to have two different debug flags for a single pass.
Reviewers: shankarke
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D845
llvm-svn: 182543
2013-05-23 01:31:25 +00:00
Rui Ueyama
972b0d3b0c
[lld] Fix wrong content permission bit.
...
Summary: "W" bit value was not consistent in ContentPermissions enum. It should always be 2.
Reviewers: kledzik
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D810
llvm-svn: 182515
2013-05-22 21:13:21 +00:00
Shankar Easwaran
d8da989e78
[lld][LayoutPass] An earlier commit moved the functionality so that Atoms would
...
be laid out by their ordinal overrides first, there was a bug that two atoms may
get the same override index due to which atoms were not ordered properly. This
commit fixes the problem.
Now the atoms are ordered by
- Section Position hints
- Atom override (Using layout-after/layout-before/in-group)
- Content Permissions
- Content Type
- File Ordinal
This also fixes the problem of running c++ static executables that
was broken by an earlier patch.
llvm-svn: 182494
2013-05-22 17:41:04 +00:00
Shankar Easwaran
4df05caadb
[lld][ELF] Inline header files into the one file using it
...
llvm-svn: 182427
2013-05-21 21:47:33 +00:00
Rui Ueyama
0e171fe3c4
[lld] Update a test file for r180209.
...
This binary file is created from shared.c.
llvm-svn: 182410
2013-05-21 20:05:55 +00:00
Shankar Easwaran
87a594835f
[lld][ELF][x86_64,hexagon] Changed dynamic atoms to live in anonymous namespace
...
so that their names are hidden.
This addresses comments raised by Sean/Rafael.
llvm-svn: 182230
2013-05-20 03:57:01 +00:00
Shankar Easwaran
9af77a2cab
[lld][ELF][All Archs] Addend is used by dynamic relocations
...
only if they are relative. This removes the FIXME when the
relocations are being emitted and checks if the relocation
is relative and only then populates the addend information.
I couldnt add a testcase for this as llvm-readobj lacks
functionality of printing dynamic relocations.
When the functionality is added, remove the commented lines
from elf/ifunc.test to test functionality.
llvm-svn: 182077
2013-05-17 05:10:30 +00:00
Shankar Easwaran
f9a7933d90
[lld][ELF][X86_64] Reorganize X86_64 Target specific code
...
This patch splits X86_64Target specific code so that
the dynamic atoms and the Relocation handlers are in seperate
files for easier maintenace. The files are sure to grow and this
makes it easier to work with.
* There is no change in functionality *
llvm-svn: 182076
2013-05-17 04:19:53 +00:00
Rui Ueyama
d819aa5c54
[lld] Do not create a temporary pair.
...
llvm-svn: 182033
2013-05-16 17:58:14 +00:00
Rui Ueyama
bd314482e1
[lld] Fix inconsistent style and do cleanup.
...
llvm-svn: 182031
2013-05-16 17:53:34 +00:00
Rui Ueyama
5f689e24de
[lld] Fix compiler warning that shift count is too big on P64.
...
llvm-svn: 181852
2013-05-14 23:51:50 +00:00
Rui Ueyama
fe81cf8f91
[lld] Allow flags other than -std= in CMAKE_CXX_FLAGS. Also simplify the IF conditions.
...
llvm-svn: 181822
2013-05-14 19:53:41 +00:00
Rui Ueyama
0196d1062f
[lld][LayoutPass] Cleanup: replace (*atom).size() with atom->size().
...
llvm-svn: 181804
2013-05-14 16:53:59 +00:00
Rui Ueyama
5ec6d1a9cd
[lld][LayoutPass] Fix a bug that caused buildbot to fail on some platforms.
...
llvm-svn: 181752
2013-05-14 01:51:56 +00:00
Rui Ueyama
ca8ca55b52
[lld][LayoutPass] Split buildFollowOnTable for readability.
...
Summary:
Split buildFollowOnTable to small functions to improve
code readability and remove code duplication. No change
in functionality.
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D790
llvm-svn: 181749
2013-05-14 00:41:52 +00:00
Rui Ueyama
deb979bf7a
[lld] Add help text for -flavor option.
...
llvm-svn: 181655
2013-05-11 01:24:38 +00:00
Rui Ueyama
0227be6b0e
[lld] Fix typo in document.
...
llvm-svn: 181652
2013-05-11 00:26:26 +00:00
Rui Ueyama
eaadec3a39
[lld] Document about how to enable debug output.
...
llvm-svn: 181640
2013-05-10 22:19:28 +00:00
Shankar Easwaran
bd525a3f63
[lld][ELF] set ordinals for mergeAtoms and fix testcase
...
llvm-svn: 181622
2013-05-10 18:52:29 +00:00
Shankar Easwaran
3c5d2c8a24
[lld][LayoutPass] This commit fixes a problem in the
...
Layoutpass by ordering atoms if they appear in the override
list first and then looking at the way of ordering atoms in
the default way.
The fix also fixes issues with the sizes of the sections,
that appear in the output properly too.
The commit also adds a testcase(orderatoms-by-override.test)
to test it and fixes all the other relevant testcases.
llvm-svn: 181605
2013-05-10 16:44:02 +00:00
Rui Ueyama
eb6b6e4857
[lld] Fix broken test. -layout-pass option does not exist.
...
Also shuffle the atoms so that it can verify the layout pass
actually changed the layout.
llvm-svn: 181573
2013-05-10 00:50:33 +00:00
Rui Ueyama
4689326d4c
[lld] Fix wrong comment.
...
llvm-svn: 181547
2013-05-09 21:14:02 +00:00
Rui Ueyama
90b3b92a8b
[lld] Use range based for loop instead of explicit iterators (no functionality change)
...
llvm-svn: 181503
2013-05-09 04:00:44 +00:00
Rui Ueyama
60f5f30687
[lld] Add comments to InputFiles::searchLibraries() arguments.
...
llvm-svn: 181492
2013-05-08 23:54:10 +00:00
Rui Ueyama
980e52d7ae
[lld][Core] Fix latch synchronization bug.
...
We need to acquire a lock before signal a condition.
Otherwise threads waiting on a condition variable can
miss a signal.
Consider two threads: Thread A executing dec() and thread
B executing sync(). The initial value of _count is 1. If
these two threads are interleaved in the following order,
thread B misses the signal sent by thread A, because at the
time thread A sends a signal, B is not waiting for it.
Thread A | Thread B
| std::unique_lock<std::mutex> lock(_condMut);
| while (!(_count == 0)) {
if (--_count == 0) |
_cond_notify_all() |
| _cond.wait();
| }
Note that "wait(lock, pred)" is equivalent to "while(!pred())
wait(lock)", so I expanded it in the above example.
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D764
llvm-svn: 181484
2013-05-08 23:29:24 +00:00
Rui Ueyama
ec504cfffd
[lld] Add "explicit" to constructors where appropriate.
...
Summary:
Add the explicit keyword to one-parameter
constructors to prevent unintended type conversions.
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D765
llvm-svn: 181483
2013-05-08 23:20:53 +00:00
Nick Kledzik
80d8308b57
Use anonymous namespace for local classes. Patch by Rui Ueyama
...
llvm-svn: 181473
2013-05-08 21:34:11 +00:00
Shankar Easwaran
e796006333
[lld][ELF] fix build failure
...
llvm-svn: 181325
2013-05-07 15:27:02 +00:00
Shankar Easwaran
790ede43de
[lld][ELF] split ELF reader into multiple functions for readability (no change in functionality)
...
llvm-svn: 181288
2013-05-07 04:58:09 +00:00
Michael J. Spencer
75ed350132
[ELF] Initialize readers and writers on creation.
...
This makes the target handler a constructor argument because the constructor of
OutputELFWriter relies on it being initialized.
llvm-svn: 181280
2013-05-07 00:28:07 +00:00
Michael J. Spencer
b5fb0dee0c
[Core] Properly stop the ThreadPoolExecutor and use the ConcRT memory allocator.
...
llvm-svn: 181279
2013-05-07 00:27:40 +00:00
Shankar Easwaran
c8858b3469
[lld]remove lld-core
...
llvm-svn: 181244
2013-05-06 20:24:39 +00:00
Tim Northover
d11e5bc03c
[lld][ELF] fix header comment typos
...
llvm-svn: 181188
2013-05-06 08:31:58 +00:00
Shankar Easwaran
6e1f5b7d1a
[lld][ELF] reduce the number of symbols emitted in the symbol table
...
llvm-svn: 180872
2013-05-01 19:36:38 +00:00
Shankar Easwaran
02078464e1
[lld][ELF] continue on finding a section with no symbols, tests already present
...
llvm-svn: 180769
2013-04-30 03:14:01 +00:00
Shankar Easwaran
cc06891c42
[lld][ELF] (no testable functionality change) resize the number of entries in the string table for static linking
...
llvm-svn: 180692
2013-04-29 04:10:42 +00:00
Shankar Easwaran
d846d9852e
[lld][ELF] (no testable functionality change) resize the number of entries in the string table for static linking
...
llvm-svn: 180691
2013-04-29 04:10:11 +00:00
Shankar Easwaran
45a5f93517
[lld][LayoutPass] initialize the number of entries for the densehash (no functionality change)
...
llvm-svn: 180690
2013-04-29 03:27:57 +00:00
Michael J. Spencer
9d70cef481
[Core] Allow weak symbols in shared library when linking.
...
Patch by Rui Ueyama.
llvm-svn: 180209
2013-04-24 19:00:26 +00:00
Andy Gibbs
93383381d7
Distinguish between unsupported and unrecognised flavours.
...
Suggested by Nick Kledzik in reference to r179590.
llvm-svn: 179617
2013-04-16 19:24:13 +00:00
Andy Gibbs
bab932b850
Moved llvm_unreachable out of switch blocks to avoid the "control reaches end of non-void function" warning.
...
llvm-svn: 179590
2013-04-16 11:52:34 +00:00
Michael J. Spencer
1eb3b89d92
[Core] Add parallel infrastructure to lld.
...
Uses ConcRT and PPL on Windows.
llvm-svn: 179397
2013-04-12 18:40:39 +00:00
Nico Rieck
bdfd4eb223
Replace elf-dump with llvm-readobj in lld tests
...
llvm-svn: 179364
2013-04-12 04:29:01 +00:00
Shankar Easwaran
bba9fe8495
[test] missing underscore while checking for test output
...
llvm-svn: 179264
2013-04-11 04:20:21 +00:00
Shankar Easwaran
4cb24b38f6
[test] fix failing test, the test was not accounting for - in the path
...
llvm-svn: 179260
2013-04-11 04:08:11 +00:00
Shankar Easwaran
eeee23e60a
This adds functionality for undefined atoms from dynamic libraries to be added
...
to the list of undefined atoms.
The processing of undefined atoms from dynamic libraries is controlled by
use-shlib-undefines command line option.
This patch also adds additional command line arguments to allow/disallow
unresolved symbols from shared libraries and mimics GNU ld behavior.
llvm-svn: 179257
2013-04-11 02:56:30 +00:00
Michael J. Spencer
d4eb47c110
Add VTune as an optional external dependency and add task tracking.
...
llvm-svn: 178940
2013-04-06 00:56:40 +00:00
Michael J. Spencer
e6d5609de4
Revert "Correctly pass ownership of MemoryBuffers."
...
llvm-svn: 178918
2013-04-05 22:04:44 +00:00
Michael J. Spencer
ce1e53e19c
Correctly pass ownership of MemoryBuffers.
...
llvm-svn: 178914
2013-04-05 21:08:30 +00:00
Michael J. Spencer
096ea03f31
Fix uninitialized variables. Found by ubsan.
...
llvm-svn: 178913
2013-04-05 21:07:44 +00:00
Shankar Easwaran
f4a5e2f439
[ELF][test] add dynamic library search
...
llvm-svn: 178840
2013-04-05 04:34:57 +00:00
Shankar Easwaran
a4323a5cca
This fixes a SIGSEGV failure in ReaderArchive while trying to trace what
...
InputFile is being pulled from the Archive library to resolve a symbol.
The buffer which was being used was already being handed over to the
MemoryBuffer object and was being accessed after the hand over.
Moving it before the buffer is handed over.
llvm-svn: 178838
2013-04-05 03:50:15 +00:00
Shankar Easwaran
831b4a0503
[test] remove printing the file to stdout
...
llvm-svn: 178817
2013-04-04 23:53:46 +00:00
Shankar Easwaran
d953d66ee9
[ELF] fix atom order
...
llvm-svn: 178815
2013-04-04 23:51:36 +00:00
Michael J. Spencer
dfe85483d5
[Driver] Fix symlinked universal driver behavior and add a test.
...
llvm-svn: 178798
2013-04-04 22:04:16 +00:00
Nick Kledzik
563d9dc1b2
temp change to test case to debug buildbot failure
...
llvm-svn: 178788
2013-04-04 20:34:37 +00:00
Nick Kledzik
f4fa8c0a75
fix DEBUG_WITH_TYPE to build without warnings in non-debug builds
...
llvm-svn: 178787
2013-04-04 20:32:18 +00:00
Michael J. Spencer
3ab4db67f7
Fix MSVC build.
...
llvm-svn: 178781
2013-04-04 19:45:34 +00:00
Nick Kledzik
be7b005d83
fix darwin driver to validate command line options
...
llvm-svn: 178778
2013-04-04 19:26:14 +00:00
Nick Kledzik
9a632dbe0c
fix command line option to use -o
...
llvm-svn: 178777
2013-04-04 19:17:58 +00:00
Nick Kledzik
c314b46e71
This is my Driver refactoring patch.
...
The major changes are:
1) LinkerOptions has been merged into TargetInfo
2) LinkerInvocation has been merged into Driver
3) Drivers no longer convert arguments into an intermediate (core) argument
list, but instead create a TargetInfo object and call setter methods on
it. This is only how in-process linking would work. That is, you can
programmatically set up a TargetInfo object which controls the linking.
4) Lots of tweaks to test suite to work with driver changes
5) Add the DarwinDriver
6) I heavily doxygen commented TargetInfo.h
Things to do after this patch is committed:
a) Consider renaming TargetInfo, given its new roll.
b) Consider pulling the list of input files out of TargetInfo. This will
enable in-process clients to create one TargetInfo the re-use it with
different input file lists.
c) Work out a way for Drivers to format the warnings and error done in
core linking.
llvm-svn: 178776
2013-04-04 18:59:24 +00:00
Rafael Espindola
26cf0b5130
Update for API change for handling mips64el.
...
llvm-svn: 178695
2013-04-03 21:03:19 +00:00
Rafael Espindola
13de1566d0
Update the lld testsuite for the llvm-readobj format change.
...
llvm-svn: 178693
2013-04-03 20:53:45 +00:00
Shankar Easwaran
34353270a0
[ELF][Hexagon] fix few relocations and add test
...
llvm-svn: 178495
2013-04-01 20:20:11 +00:00
Shankar Easwaran
1d9e531856
[ELF][Hexagon] Create .got.plt entries with the appropriate alignment
...
llvm-svn: 178467
2013-04-01 15:14:34 +00:00
Shankar Easwaran
cbe06ca340
[ELF] Set the symbol type for undefined atoms properly
...
llvm-svn: 178466
2013-04-01 15:12:54 +00:00
Shankar Easwaran
bb9d4a5ca0
[ELF] Add dynamic hash table and get simple dynamic libraries working with Hexagon
...
llvm-svn: 178323
2013-03-29 00:53:25 +00:00
Michael J. Spencer
8759beb424
[ELF] Cache contentType and permissions.
...
llvm-svn: 178269
2013-03-28 18:58:50 +00:00
Michael J. Spencer
1067ff61e6
[Driver] Don't open files multiple times.
...
llvm-svn: 178268
2013-03-28 18:58:35 +00:00
Shankar Easwaran
c3048de5ac
[ELF][Hexagon] remove duplicated code
...
llvm-svn: 178027
2013-03-26 15:06:52 +00:00
Shankar Easwaran
7404004a4c
[ELF][Hexagon] Fixing failing test on Bots, few symbol names are available only in debug builds, dont check the symbol names
...
llvm-svn: 177991
2013-03-26 04:01:26 +00:00
Shankar Easwaran
14bfcd3e0f
[ELF] no change in functionality, add functions to symbol table so that they can be overridden by derived classes
...
llvm-svn: 177990
2013-03-26 03:53:33 +00:00
Shankar Easwaran
499aa9e028
[ELF][Hexagon] add GOTREL/GOT relocations
...
llvm-svn: 177970
2013-03-26 02:20:56 +00:00
Shankar Easwaran
1af701ec6a
[ELF] order rela.dyn/rela.plt properly
...
llvm-svn: 177969
2013-03-26 02:20:08 +00:00
Shankar Easwaran
aec2165123
[ELF] fix dynamic symbol table entries and update tests
...
llvm-svn: 177875
2013-03-25 16:41:14 +00:00
Shankar Easwaran
71738cafe6
[ELF][Hexagon][test] check .got.plt order
...
llvm-svn: 177604
2013-03-20 23:39:43 +00:00
Shankar Easwaran
0fa1b3c86a
[X86_64][test] check that interp section is not emitted when building dynamic libraries
...
llvm-svn: 177603
2013-03-20 23:34:36 +00:00
Michael J. Spencer
67f25272f1
[SymbolTable][Perf] Use hash_combine instead of a custom hash, also use memcmp.
...
ArrayRef<uint8_t>::equals(); lowers to a byte compare loop :(.
TODO: Figure out if we are getting hash collisions, or just have a lot of equal
content. Also test if crypto hashing the content instead of full compare is
better.
llvm-svn: 177588
2013-03-20 22:18:22 +00:00
Michael J. Spencer
417c19923b
[ELF][Reader] Add debug message to print all inputs the linker actually read.
...
llvm-svn: 177564
2013-03-20 19:26:10 +00:00
Michael J. Spencer
da384eebe5
[ELF][Reader][Perf] Only do loookup once.
...
llvm-svn: 177563
2013-03-20 19:25:58 +00:00
Michael J. Spencer
602ffc13b8
[ELF][Reader] Refactor how relocations are read. Improves performance.
...
This changes from reading each relocation individually for each section to just
storing the range of relocations. It also counts the relocations to preallocate
the _references array.
llvm-svn: 177562
2013-03-20 19:25:47 +00:00
Michael J. Spencer
55a7070bea
[ELF][Reader] Remove static ordinal.
...
llvm-svn: 177561
2013-03-20 19:25:34 +00:00
Michael J. Spencer
9dc5489441
memcpy instead of copy_n. Faster than copy_n on MSVC :(.
...
llvm-svn: 177557
2013-03-20 18:58:07 +00:00
Michael J. Spencer
fa405277cb
Devirtualize Reference::kind.
...
Improves performance.
llvm-svn: 177556
2013-03-20 18:57:52 +00:00
Michael J. Spencer
0f3dd616bd
Devirtualize File::kind.
...
This is the standard way of implementing LLVM RTTI.
llvm-svn: 177555
2013-03-20 18:57:27 +00:00
Michael J. Spencer
6580d1f226
Set ordinals correctly.
...
This actually doesn't change behavior with the current LinkerInvocation, but
it's needed when you make reading parallel.
llvm-svn: 177554
2013-03-20 18:56:57 +00:00
Shankar Easwaran
452ba13271
[ELF][Hexagon] Add Hexagon dynamic relocations
...
llvm-svn: 177484
2013-03-20 05:10:02 +00:00
Shankar Easwaran
06a4039572
[ELF] Interp section is only needed in dynamic executables
...
llvm-svn: 177483
2013-03-20 05:06:40 +00:00
Shankar Easwaran
1e848e0edf
[ELF] Order .got.plt properly
...
llvm-svn: 177482
2013-03-20 04:52:08 +00:00
Andy Gibbs
1fb8ce4002
Fix "control reaches end of non-void function" compiling lld on gcc.
...
llvm-svn: 177424
2013-03-19 19:13:36 +00:00
Alexey Samsonov
2712b064d8
Add virtual destructors to fix -Wnon-virtual-dtor warnings
...
llvm-svn: 177392
2013-03-19 11:41:16 +00:00
Shankar Easwaran
8962feb915
[lld] remove trailing whitespace
...
llvm-svn: 177079
2013-03-14 16:09:49 +00:00
Shankar Easwaran
74fc23fa5d
[ELF][X86_64][Hexagon] order plt/got entries properly and fix test
...
llvm-svn: 176970
2013-03-13 20:30:11 +00:00
Shankar Easwaran
8c25685be7
[Pass][Layout] Add extra debugging information
...
llvm-svn: 176925
2013-03-13 04:05:38 +00:00
Michael J. Spencer
c4e45f855c
[ELF][Writer] Let std::vector handle allocating space instead of reserving tiny portions.
...
llvm-svn: 176916
2013-03-13 00:30:08 +00:00
Michael J. Spencer
1ecf890215
[Pass][Layout] Make algorithm not n^2.
...
This reduces the time spent in this function while linking ASTMatchersTests
from %43 to %2.4 of total link time.
llvm-svn: 176842
2013-03-12 00:10:00 +00:00
Shankar Easwaran
fc9d0a7d9b
[ELF] Set values for bss_start and end symbols properly, If there are two load segments with RW permissions, bss_start and end may get set inappropriate
...
llvm-svn: 176795
2013-03-11 01:38:22 +00:00
Michael J. Spencer
9b5e8da3b4
[Driver][GNU] Accept and ignore more options.
...
llvm-svn: 176749
2013-03-09 01:41:37 +00:00
Michael J. Spencer
52fdb8bf13
Fix (possible) MSVC miscompile in debug mode.
...
llvm-svn: 176748
2013-03-09 01:41:27 +00:00
Michael J. Spencer
2d224509af
[Writer][ELF] Use correct data types for sizes. Fixes integer overflow bug.
...
This only happens when the section header count is > 1024.
llvm-svn: 176747
2013-03-09 01:41:16 +00:00
Shankar Easwaran
b327810215
[ELF] Create baseclass for all ELF writers
...
llvm-svn: 176724
2013-03-08 21:42:51 +00:00
Shankar Easwaran
c44bc347cb
[ELF] Order weak symbols properly
...
llvm-svn: 176583
2013-03-06 21:59:27 +00:00
Shankar Easwaran
7d89b2b6a7
[ELF][Hexagon] fixing dynlib test
...
llvm-svn: 176503
2013-03-05 19:00:21 +00:00
Shankar Easwaran
b6ef6c5a52
[ELF][Hexagon] fixing test failure
...
llvm-svn: 176497
2013-03-05 18:39:16 +00:00
Dmitri Gribenko
e16bc92063
Fix -Wdocumentation warning: use a correct Doxygen comment marker
...
llvm-svn: 176494
2013-03-05 18:11:01 +00:00
Shankar Easwaran
49ae019997
[ELF] Set symbol type to STT_SECTION, so that objdump.bfd doesnot get confused when disassembling output
...
llvm-svn: 176489
2013-03-05 16:09:32 +00:00
Shankar Easwaran
3ff62ade38
[ELF] add dynamic library support
...
llvm-svn: 176483
2013-03-05 14:52:48 +00:00
Shankar Easwaran
bcb722a452
[ELF] Remove comment
...
llvm-svn: 176482
2013-03-05 14:45:59 +00:00
Shankar Easwaran
7b0ae11c82
[ELF] no functionality change, update dynamicTable functionality
...
llvm-svn: 176430
2013-03-04 02:21:16 +00:00
Shankar Easwaran
03a525d6fd
[lld][ELF] Add modified writer
...
llvm-svn: 176425
2013-03-03 22:10:57 +00:00
Shankar Easwaran
1993b0000c
[lld][ELF] rename to add new support in the ELF Writer
...
llvm-svn: 176424
2013-03-03 22:09:22 +00:00
Shankar Easwaran
62bba5ddfb
[ELF] rename Writer to ExecutableWriter
...
llvm-svn: 176416
2013-03-03 07:37:17 +00:00
Shankar Easwaran
1729e12358
[ELF][Hexagon] add initial changes to add GOT/PLT
...
llvm-svn: 176415
2013-03-03 07:34:56 +00:00
Shankar Easwaran
b0e356e223
move dynamic linking atoms to Atoms.h
...
llvm-svn: 176370
2013-03-01 19:33:42 +00:00
Michael J. Spencer
8c0526593a
[Writer][ELF][x86-64] Handle GOTPCREL relocations to SharedLibraryAtoms.
...
llvm-svn: 176324
2013-03-01 01:09:46 +00:00
Michael J. Spencer
3e00c5015f
[ELF][x86-64] Only emit a PLT entry for a PLT relocation if the target atom is a SharedLibraryAtom.
...
This seems to be what ld does, but I'm not sure how it works with symbol interposition.
With this hello-world with glibc dynamically linked works.
llvm-svn: 176310
2013-03-01 00:03:56 +00:00
Michael J. Spencer
a55e37f477
Add basic linker script parsing.
...
llvm-svn: 176309
2013-03-01 00:03:36 +00:00
Shankar Easwaran
da28895597
[ELF][Hexagon] add quickdata relocations
...
llvm-svn: 176298
2013-02-28 20:54:03 +00:00
Michael J. Spencer
a26f71c9ed
[ELF][x86-64] Separate static and dynamic GOT/PLT generation.
...
llvm-svn: 176294
2013-02-28 20:04:32 +00:00
Shankar Easwaran
4685069152
[ELF][tests] changes for test cases
...
llvm-svn: 176280
2013-02-28 18:38:20 +00:00
Shankar Easwaran
937aa19a4b
[ELF] Set header flags to 0 by default
...
llvm-svn: 176279
2013-02-28 18:36:34 +00:00
Shankar Easwaran
dac3873442
[ELF][Hexagon] change Header flags
...
llvm-svn: 176278
2013-02-28 18:35:27 +00:00
Shankar Easwaran
8a2d1990d8
[lld][ELF][Hexagon] add more relocations
...
llvm-svn: 176277
2013-02-28 18:29:23 +00:00
Shankar Easwaran
d4ac74ffcc
[lld][ELF] Order segments
...
llvm-svn: 176207
2013-02-27 20:24:47 +00:00
Michael J. Spencer
2e41976893
[test] Don't start elf-dump until lld-core is done writing the output.
...
llvm-svn: 176205
2013-02-27 20:01:43 +00:00
Shankar Easwaran
c5eda3ad2b
fixing build error properly according to comment from David
...
llvm-svn: 176169
2013-02-27 05:53:38 +00:00
Shankar Easwaran
4f4ed0acdf
adding a return to fix compilation error from buildbot, build #75
...
llvm-svn: 176167
2013-02-27 05:33:27 +00:00
Shankar Easwaran
2ce6b43f40
fixing typo in header file
...
llvm-svn: 176162
2013-02-27 04:02:30 +00:00
Michael J. Spencer
2063679ec4
[ELF][Writer] Add dynamic relocation tables.
...
This adds separate PLT and dynamic relocation tables. It also fills in the dynamic table
entries for them.
llvm-svn: 176150
2013-02-27 01:30:27 +00:00
Michael J. Spencer
7f09a3d54e
[Pass][Layout] Fix bug and add debug printing.
...
Fix a bug where if two atoms had the same index in the override map,
the compare would return false. It now goes to the next check when
they are equal.
No test because it currently can't be tested. An upcomming patch will test it.
llvm-svn: 176073
2013-02-26 01:35:30 +00:00
Michael J. Spencer
f10c0a3aa0
[ELF][Writer] Fill in dynamic table entries.
...
llvm-svn: 176045
2013-02-25 20:03:09 +00:00
Shankar Easwaran
596b40871a
[ELF][Hexagon] add _SDA_BASE_(absolute symbol pointing to start of quickdata)
...
llvm-svn: 175997
2013-02-24 16:02:24 +00:00
Shankar Easwaran
1b095842ec
[ELF] Change functions to virtual, in ExecutableAtoms
...
llvm-svn: 175993
2013-02-24 15:11:55 +00:00
Shankar Easwaran
5f0afe84f5
[ELF]Change name of runtime files, so that targets can change runtime files that they own
...
llvm-svn: 175992
2013-02-24 14:54:02 +00:00
Shankar Easwaran
db74ffbe72
[ELF][Hexagon]add typeZeroFillFast
...
llvm-svn: 175983
2013-02-24 03:09:10 +00:00
Michael J. Spencer
3407211b2f
[ELF][Writer] Add hash table.
...
llvm-svn: 175972
2013-02-23 19:46:18 +00:00
Michael J. Spencer
13db19d64e
[ELF][Writer] Add a PHDR program table entry for dynamic files.
...
llvm-svn: 175951
2013-02-23 03:58:06 +00:00
Michael J. Spencer
942dbcc209
[ELF][Writer] Add dynamic string and symbol table.
...
llvm-svn: 175941
2013-02-23 01:02:31 +00:00
Shankar Easwaran
8c55c01d2a
sort quickdata for the hexagon target
...
llvm-svn: 175904
2013-02-22 18:01:08 +00:00
Shankar Easwaran
873c9ffba0
add changes for typeDataFast
...
llvm-svn: 175901
2013-02-22 17:18:53 +00:00
Michael J. Spencer
e4c0e3712f
[ELF][Writer] Add .interp section.
...
llvm-svn: 175657
2013-02-20 20:13:47 +00:00
Michael J. Spencer
b71ce655a8
[ELF][Writer] Add dynamic table.
...
llvm-svn: 175654
2013-02-20 19:46:12 +00:00
Shankar Easwaran
8a1a4e7cf7
rename fixupAddend to relocAddend
...
llvm-svn: 175638
2013-02-20 17:42:00 +00:00
Shankar Easwaran
25832ede03
functionality to handle global atoms in Merge sections
...
llvm-svn: 175636
2013-02-20 17:38:37 +00:00
Michael J. Spencer
2139795dfa
[Driver][GNULD] Lookup .so files and default to dynamic output.
...
llvm-svn: 175572
2013-02-19 23:05:36 +00:00
Michael J. Spencer
cadb082e5a
[ELF] Fix memory leak by deleting BumpPtr allocated objects.
...
llvm-svn: 175558
2013-02-19 21:04:30 +00:00
Chandler Carruth
21aaf2534d
Switch a vector<pair<const T &, const U &>> to a vector<pair<const T *,
...
const U *>>. Even in C++11 it doesn't seem this is valid as vector's
emplace support requires move assignment, and there is no way to move
assign a reference.
The real motivation however is that this fixes the build of lld with
libstdc++ 4.6.
llvm-svn: 175481
2013-02-19 01:58:11 +00:00
Michael J. Spencer
be03e2a861
[Core,Driver,ELF] Differentiate static and dynamic executables.
...
This also adds a simple relocation change for dynamic executables to
x86-64 ELF.
llvm-svn: 175208
2013-02-14 20:32:00 +00:00
Michael J. Spencer
db18847b01
[ELF][Writer] Refactor Section to not have atoms. Move atoms into AtomSection.
...
The purpose of this change is to simplify creating non-atom sections.
Previously _contentType, _sectionKind and _order were used for multiple
purposes and collided in places. This moves all of the Atom specific logic down
into AtomSection and makes Section just have raw Elf_Shdr flags.
llvm-svn: 175207
2013-02-14 20:24:38 +00:00
Shankar Easwaran
4b9cea7317
fix the mergeable string atom, when the target points to a symbol which is at a relative offset from the start of the .rodata section
...
llvm-svn: 175039
2013-02-13 06:35:33 +00:00
Shankar Easwaran
96d594b14e
add merge strings option, this temporarily fixes the problem bringing up helloworld with glibc on x86_64
...
llvm-svn: 175038
2013-02-13 06:12:52 +00:00
Shankar Easwaran
0da6d71b54
add support for merging common strings
...
llvm-svn: 174990
2013-02-12 18:46:53 +00:00
Michael J. Spencer
c3c8bc1e5c
[ELF] Add support for reading dynamic libraries.
...
llvm-svn: 174916
2013-02-11 23:03:35 +00:00
Shankar Easwaran
710b4c8fa2
fix segment ordering of elf segments
...
llvm-svn: 174659
2013-02-07 20:33:55 +00:00
Shankar Easwaran
34ab70f1e6
add changes for layoutafter/layoutbefore/ingroup/layoutpass and test cases
...
llvm-svn: 174658
2013-02-07 20:16:12 +00:00
Michael J. Spencer
ac4f444e39
[docs] lld self hosts.
...
llvm-svn: 174592
2013-02-07 07:26:45 +00:00
Michael J. Spencer
7799d15f6e
[Driver] Add -L and -l support.
...
llvm-svn: 174590
2013-02-07 06:47:17 +00:00
Michael J. Spencer
cfe59fd0d3
[Driver] Replace Target with TargetInfo. Simplify LinkerInput.
...
This removes Target and moves the functionality it had over to TargetInfo.
This also simplifies LinkerInput by removing the InputKind. This will be handled elsewhere.
llvm-svn: 174589
2013-02-07 06:46:48 +00:00
Michael J. Spencer
7a0e212f6f
[ELF][x86-64] Handle PLT32 relocations to IFUNC.
...
llvm-svn: 174428
2013-02-05 19:15:03 +00:00
Michael J. Spencer
7fec00b20e
[ELF][Layout] Provide a proper way to get the TLS segment size.
...
llvm-svn: 174427
2013-02-05 19:14:43 +00:00
Michael J. Spencer
359b6ff6bb
[ELF] Implement GOTPCREL for defined atoms.
...
llvm-svn: 174426
2013-02-05 19:14:28 +00:00
Michael J. Spencer
e6ab9f80a7
[ELF] Replace local dynamic tls access with direct access.
...
llvm-svn: 174425
2013-02-05 19:14:07 +00:00
Michael J. Spencer
be1100e192
[Resolver] Improve undefined symbol error.
...
llvm-svn: 174277
2013-02-03 10:50:06 +00:00
Michael J. Spencer
7b7e8edb86
[ELF] Use LLVM_IS_UNALIGNED_ACCESS_FAST.
...
llvm-svn: 174276
2013-02-03 10:49:57 +00:00
Michael J. Spencer
7e813242af
[ELF][Reader] Improve performance by removing calls to malloc.
...
llvm-svn: 174275
2013-02-03 10:49:47 +00:00
Michael J. Spencer
9a1da075b2
[ELF] Fix uninitialized variable.
...
llvm-svn: 174274
2013-02-03 10:49:37 +00:00
Michael J. Spencer
4673da27ef
[Archive] Update to LLVM change.
...
llvm-svn: 174273
2013-02-03 10:49:26 +00:00
Alex Rosenberg
b65e88863e
Spelling and grammar corrections.
...
llvm-svn: 174268
2013-02-03 07:05:26 +00:00
Shankar Easwaran
a47495898c
remove duplicate strings from the string table
...
llvm-svn: 174200
2013-02-01 18:06:15 +00:00
Shankar Easwaran
d476528e3d
add alignment to .got/.got.plt/.plt sections & fix tests
...
llvm-svn: 174199
2013-02-01 18:03:32 +00:00
Shankar Easwaran
f23fc86ca8
add proper copyright header
...
llvm-svn: 174178
2013-02-01 15:05:11 +00:00
Michael J. Spencer
18950a174e
[Docs] Update status :)
...
llvm-svn: 174162
2013-02-01 09:20:24 +00:00
Michael J. Spencer
08b49bf27e
[ELF][x86-64] Fix ifunc and add test.
...
In an previous commit I managed to completely disable the IRELATIVE relocation
writing code. I also used the wrong addend for the static relocation. Fix both
these issues and add a test. This test is quite brittle because there's no way
to do arithmetic on variables in FileCheck.
llvm-svn: 174161
2013-02-01 09:14:21 +00:00
Michael J. Spencer
b5d6f5e988
[ELF][x86-64] Implement static relocation model for TLS.
...
This implements the static relocation model for GOT accesses to TLS.
llvm-svn: 174155
2013-02-01 07:14:14 +00:00
Michael J. Spencer
b0ed8e80d8
[ELF][x86-84] Add static TLS support.
...
llvm-svn: 174154
2013-02-01 07:13:49 +00:00
Michael J. Spencer
3c75665fdd
[ELF][x86-64] Add the _GLOBAL_OFFSET_TABLE_ Atom in the correct location.
...
Now we link against glibc without --noinhibit-exec.
llvm-svn: 174150
2013-02-01 05:36:14 +00:00
Michael J. Spencer
c8803d27aa
[ELF] Add more absolute atoms. Simplify how they are resolved.
...
llvm-svn: 174149
2013-02-01 05:36:00 +00:00
Shankar Easwaran
73ef70b50f
add hexagon scatter bits and split hexgontargethandler to hexagonrelocationhander
...
llvm-svn: 174148
2013-02-01 05:26:02 +00:00
Michael J. Spencer
280dadbbaf
[Core] Only complain about undefined symbols if they are marked as canBeNullNever.
...
llvm-svn: 174107
2013-01-31 22:56:13 +00:00
Michael J. Spencer
461d33648b
[ELF][x86-64] Improve unknown relocation message.
...
llvm-svn: 174092
2013-01-31 21:00:57 +00:00
Michael J. Spencer
3830d2c49f
[ELF] Create atoms for progbits sections with no symbols but still have content.
...
llvm-svn: 174091
2013-01-31 21:00:42 +00:00
Shankar Easwaran
fb8565a9c6
add support for assigning virtual addresses to TDATA/TBSS sections
...
llvm-svn: 174065
2013-01-31 16:04:47 +00:00
Michael J. Spencer
b3c04d28c8
[ELF] Fix circular initialization bug.
...
llvm-svn: 173968
2013-01-30 20:36:56 +00:00
Michael J. Spencer
901fd6a4c8
[ELF] Use the target's LayoutHandler.
...
llvm-svn: 173966
2013-01-30 20:05:27 +00:00
Shankar Easwaran
e07245cdfc
hexagon targetinfo changes for getting the relocation kind from string and vice versa
...
llvm-svn: 173942
2013-01-30 16:05:43 +00:00
Shankar Easwaran
ddb122811b
simplify hexagon relocations handling
...
llvm-svn: 173938
2013-01-30 15:38:41 +00:00
Michael J. Spencer
23d23953b3
[ELF][x86-64] Add TargetLayout.
...
llvm-svn: 173922
2013-01-30 10:43:25 +00:00
Michael J. Spencer
8254185eea
Whitespace.
...
llvm-svn: 173921
2013-01-30 10:43:10 +00:00
Michael J. Spencer
d21b72730f
[ELF] Remove ReferenceKinds.
...
llvm-svn: 173912
2013-01-30 07:46:54 +00:00
Michael J. Spencer
f35c3e434a
[ELF] Use TargetRelocationHandler to apply relocations.
...
llvm-svn: 173911
2013-01-30 07:46:31 +00:00
Michael J. Spencer
409a737f36
[ELF] Add {Hexagon,PPC,X86}TargetHandler.
...
llvm-svn: 173909
2013-01-30 07:36:45 +00:00
Shankar Easwaran
072031a265
change the function names in RelocationHelper to adhere to convention
...
llvm-svn: 173908
2013-01-30 07:36:09 +00:00
Shankar Easwaran
396e4c0b13
change DefaultLayout to TargetLayout inside member variables
...
llvm-svn: 173906
2013-01-30 07:19:57 +00:00
Shankar Easwaran
a6f00fe083
add targethandler hooks from Writer and cleanup
...
llvm-svn: 173904
2013-01-30 07:11:43 +00:00
Michael J. Spencer
457a77739b
[ELF][x86-64] Add X86_64TargetRelocationHandler and friends.
...
llvm-svn: 173897
2013-01-30 05:26:03 +00:00
Michael J. Spencer
4e9d9cd23b
[ELF] Add ELFTargetRelocationHandler.
...
llvm-svn: 173896
2013-01-30 05:25:44 +00:00
Shankar Easwaran
a51870b143
add Relocation helper functions
...
llvm-svn: 173895
2013-01-30 04:49:54 +00:00
Michael J. Spencer
4260657fab
[ELF] Make AtomLayout more accessible.
...
This is needed to allow constant time access to the final layout of atoms.
llvm-svn: 173874
2013-01-30 01:25:06 +00:00
Michael J. Spencer
e68f90355c
[ELF] Chop the ELF prefix off of most things.
...
llvm-svn: 173838
2013-01-29 22:03:39 +00:00
Shankar Easwaran
185e8a076d
remove targetInfo and layout from ELFTargetLayout
...
llvm-svn: 173824
2013-01-29 20:13:16 +00:00
Michael J. Spencer
43ecac5a2c
[ELF] Fix header sort order.
...
llvm-svn: 173822
2013-01-29 19:53:41 +00:00
Michael J. Spencer
289dcedea5
[ELF] Add support for IFUNC.
...
This sadly doesn't have a test for the final
output because llvm-objdump can't dump relocations
that don't belong to a section :(
llvm-svn: 173808
2013-01-29 16:38:03 +00:00
Michael J. Spencer
bf77be3ba5
[ELF] Give Chunk a ELFTargetInfo.
...
llvm-svn: 173743
2013-01-29 01:07:47 +00:00
Michael J. Spencer
adfb7eb211
[ELF] Remove OwningPtr from the Chunk::write interface.
...
llvm-svn: 173741
2013-01-29 01:00:21 +00:00
Michael J. Spencer
bdf8bc8315
[ELF] Clean up doxygen comments.
...
llvm-svn: 173740
2013-01-29 01:00:04 +00:00
Shankar Easwaran
072fb1a403
add register section, remove contentType from sectionKey
...
llvm-svn: 173709
2013-01-28 19:21:04 +00:00
Michael J. Spencer
d269a3e281
[ELF] Use correct regex in test.
...
llvm-svn: 173665
2013-01-28 06:11:39 +00:00
Michael J. Spencer
990ec2b223
[ELF] Use entry point from LinkerOptions.
...
Patch by Ahmed Bougacha!
llvm-svn: 173655
2013-01-28 04:15:44 +00:00
Benjamin Kramer
ac49d37a63
lldX86_64ELFTarget depends on lldCore.
...
llvm-svn: 173573
2013-01-26 13:49:19 +00:00
Michael J. Spencer
20231f1275
Use proper delete.
...
llvm-svn: 173570
2013-01-26 12:26:56 +00:00
Michael J. Spencer
5ba1a96a10
[ELF][x86-64] Add relocation string<->kind.
...
llvm-svn: 173533
2013-01-25 23:48:58 +00:00
Michael J. Spencer
866e0f8a8c
[ELF][X86-64] Use the correct base address.
...
llvm-svn: 173527
2013-01-25 23:23:24 +00:00
Michael J. Spencer
385f312686
[CMake] Setup include dirs properly.
...
llvm-svn: 173488
2013-01-25 20:50:01 +00:00
Shankar Easwaran
4277c2d6bf
change all occurences of File to FileELF
...
llvm-svn: 173449
2013-01-25 15:19:02 +00:00
Shankar Easwaran
3256d4ff62
add elf targethandler
...
llvm-svn: 173430
2013-01-25 07:39:18 +00:00
Michael J. Spencer
88f4d24e4a
[Driver] Run the pass manager.
...
llvm-svn: 173381
2013-01-24 22:52:42 +00:00
Michael J. Spencer
19c4756ff2
Move SimpleAtoms.h to ReaderWriter.
...
llvm-svn: 173380
2013-01-24 22:52:25 +00:00
Nick Kledzik
36293f6512
Add SectionPosition and OrderPass
...
llvm-svn: 173300
2013-01-23 22:32:56 +00:00
Michael J. Spencer
563d33a6f1
[ELF] Read IFUNC symbols correctly as typeResolver.
...
llvm-svn: 173299
2013-01-23 22:08:46 +00:00
Michael J. Spencer
c0d3c4efe6
Add PassManager.
...
It owns and manages passes.
llvm-svn: 173287
2013-01-23 20:03:10 +00:00
Shankar Easwaran
c142874c9c
change from using 2 bits to 4 bits, as 2 bits arent enough to hold the enumeration OutputKind
...
llvm-svn: 173266
2013-01-23 15:11:22 +00:00
Michael J. Spencer
64afcb4c6b
Move everything over to TargetInfo.
...
I really would have liked to split this patch up, but it would greatly
complicate the lld-core and lld drivers having to deal with both
{Reader,Writer}Option and TargetInfo.
llvm-svn: 173217
2013-01-23 01:18:43 +00:00
Michael J. Spencer
4586fbcbad
[Core] Move Resolver and SymbolTable over to TargetInfo.
...
No functionality change.
llvm-svn: 173192
2013-01-22 20:49:42 +00:00
Shankar Easwaran
58ad41b563
change enum class to enum, as g++ doesnot support bitfields with enumerated classes with c++11 flag set
...
llvm-svn: 173166
2013-01-22 14:58:51 +00:00
Shankar Easwaran
c7176430dc
it looks like g++ 4.7.2 doesnot like bit fields when the type is a enumeration (Throws an error as bit-field with non integral type)
...
llvm-svn: 173125
2013-01-22 04:12:03 +00:00
Michael J. Spencer
d68d6196af
Add {,ELF,MachO}TargetInfo.
...
llvm-svn: 173117
2013-01-22 02:15:30 +00:00
Shankar Easwaran
6d9921fc53
no functionality changes(split WriterELF into multiple files)
...
llvm-svn: 173082
2013-01-21 20:09:55 +00:00
Michael J. Spencer
8af48f3864
[Core] Use LLVM's ErrorOr<T>.
...
llvm-svn: 172993
2013-01-20 21:27:05 +00:00
Michael J. Spencer
359e09d4f5
[docs] Document lld's usage of C++11 features.
...
llvm-svn: 172972
2013-01-20 10:39:17 +00:00
Chandler Carruth
b5f3bd956c
Replace the 'final' keyword with 'LLVM_FINAL' as GCC 4.6 doesn't support
...
the keyword.
If anyone cares deeply about the final optimizations with GCC, we might
want to add a version test to the LLVM definition, but I'm perfectly
happy with this just only firing under Clang and modern MSVC builds.
llvm-svn: 172898
2013-01-19 09:57:51 +00:00
Chandler Carruth
8b95c03fca
Allow the LLD CMake build to work with -std=gnu++0x and -std=gnu++11 as
...
well as c++0x and c++11. This can be especially useful when building
with GCC in C++11 mode.
llvm-svn: 172897
2013-01-19 09:41:42 +00:00
Chandler Carruth
058761266d
Fix the build with libstdc++ v4.6 on Linux by supplying an explicit move
...
assignment operator. There is an issue where classes with deleted copy
constructors and user defined move constructors end up with an
implicitly deleted copy constructor that is selected instead of the
implicit move constructor. This is a bit of a hack, but it allows me to
build LLD in a bootstrap with libstdc++ which is my primary goal.
llvm-svn: 172896
2013-01-19 09:38:14 +00:00
Michael J. Spencer
a17b72e7cf
[Core] Fix passing an rvalue reference of ErrorOr.
...
llvm-svn: 172850
2013-01-18 21:42:01 +00:00
Michael J. Spencer
71c00f42bd
[ELF] Use operator new(std::size_t, BumpPtrAllocator).
...
llvm-svn: 172675
2013-01-16 23:34:45 +00:00