Commit Graph

1636 Commits

Author SHA1 Message Date
Simon Atanasyan dca4162aa5 [Mips] Factor out MIPS relocation addend reading to the separate
function.

No functional changes.

llvm-svn: 206023
2014-04-11 07:25:35 +00:00
Simon Atanasyan e5b156810a [ELF] Remove redundant conversion of section content from ArrayRef to
StringRef before calling the createSectionAtom() method and reverse
conversion inside the method.

No functional changes.

llvm-svn: 206022
2014-04-11 07:25:29 +00:00
Simon Atanasyan 5eb139fc7c [Mips] Rewrite R_MIPS_26 handling test using the yaml2obj tool.
llvm-svn: 206020
2014-04-11 04:44:05 +00:00
Simon Atanasyan b65826124c [Mips] Rewrite R_MIPS_32 handling test using the yaml2obj tool.
llvm-svn: 206019
2014-04-11 04:43:59 +00:00
Simon Atanasyan 62377c6875 [Mips] R_MIPS_PC32 relocation support.
llvm-svn: 206018
2014-04-11 04:33:21 +00:00
David Majnemer 678088148c Update to match changes made in r205955
llvm-svn: 205956
2014-04-10 07:49:18 +00:00
Rui Ueyama 20b075e526 [PECOFF] Fix common symbol alignment.
Differential Revision: http://reviews.llvm.org/D3322

llvm-svn: 205826
2014-04-09 01:01:51 +00:00
Rui Ueyama e6c499acd7 Early continue to reduce nesting.
llvm-svn: 205737
2014-04-07 21:13:33 +00:00
Rui Ueyama 5de951d8c1 No else after return.
llvm-svn: 205736
2014-04-07 21:01:11 +00:00
Rui Ueyama feab78785b [ELF] Unit tests for -o and --noinhibit-exec.
llvm-svn: 205735
2014-04-07 20:52:48 +00:00
Rui Ueyama 3017efb710 Update Phabricator server.
llvm-svn: 205698
2014-04-07 04:52:24 +00:00
Rui Ueyama 595026e071 [ELF] Accept "-rpath=<foo>" as well as "-rpath <foo>".
llvm-svn: 205694
2014-04-06 21:23:24 +00:00
Rui Ueyama c141c8c59a [ELF] Fix driver bug.
GNU LD-comptaible driver wrongly requires a space after '=' for a few
options such as "-init=<symbol>" or "-entry=<symbol>". This patch is
to fix that bug and add a few tests for it.

llvm-svn: 205693
2014-04-06 21:15:05 +00:00
Simon Atanasyan 2f5d6ae73f [ELF] Use typedefs to make class field declarations shorter.
No functional changes.

llvm-svn: 205692
2014-04-06 19:44:50 +00:00
Rui Ueyama 7088e3470c [ELF] Add a test for -rpath.
llvm-svn: 205663
2014-04-05 02:15:23 +00:00
Rui Ueyama ac0f7ca3a8 [ELF] Fix --soname option.
Currently LLD accepts only "-soname <string>", but all the following
options are actually valid.

  --soname=foo
  --soname foo
  -soname=foo
  -soname foo
  -h foo

This patch fixes that issue.

llvm-svn: 205662
2014-04-05 02:07:04 +00:00
Rui Ueyama e36fbea175 [ELF] Diagnose malformed --dynsym option.
llvm-svn: 205654
2014-04-04 22:36:30 +00:00
Michael J. Spencer ead3b1a544 [X86-64] Add missing relocation.
llvm-svn: 205645
2014-04-04 19:22:14 +00:00
Rui Ueyama 60ea496448 This is yet another case clang-modernize failed to add "override".
llvm-svn: 205644
2014-04-04 19:17:59 +00:00
Rui Ueyama 331f482cf6 Split a utility function not to use goto statement.
llvm-svn: 205643
2014-04-04 18:34:40 +00:00
Rui Ueyama e8af3e48fd useNew is set to false in all branches, so set it to false outside the if-else.
llvm-svn: 205642
2014-04-04 18:21:53 +00:00
Rui Ueyama 01cc718375 Replace dyn_cast<T>s immediately followed by asserts with cast<T>s.
llvm-svn: 205641
2014-04-04 18:21:51 +00:00
Rui Ueyama fb7936d07c Fix indentation.
llvm-svn: 205639
2014-04-04 18:12:27 +00:00
Rui Ueyama fbd6c44e6a Revert "temporary commit."
This reverts commit r205635 that was submitted by mistake.

llvm-svn: 205637
2014-04-04 18:06:56 +00:00
Rui Ueyama 770305804f temporary commit.
llvm-svn: 205635
2014-04-04 18:01:52 +00:00
Rui Ueyama 992fdc0785 SymbolTable::size() returns an unsigned int.
It's better to use the same type rather than a fixed width integer type
that may be different from the return type.

llvm-svn: 205597
2014-04-04 01:22:51 +00:00
Rui Ueyama 7cac0f784c Use range-based for loop. No functionality change.
llvm-svn: 205594
2014-04-04 00:59:50 +00:00
Rui Ueyama 0b8e053ebd Do not use temporary variables to pass them to forEachUndefines.
So that it's obvious that we pass these callbacks only to forEachUndefines.

llvm-svn: 205593
2014-04-04 00:39:37 +00:00
Rui Ueyama 8dc9f0a371 Return a vector rather than mutating a given one.
This is cleaner and as efficient as before.

Differential Revision: http://llvm-reviews.chandlerc.com/D3284

llvm-svn: 205590
2014-04-04 00:15:52 +00:00
Rui Ueyama 8bd093b1e5 Rename getInputGraph() and getNextFile().
Seems getSomething() is more common naming scheme than just a noun
to get something, so renaming these members.

Differential Revision: http://llvm-reviews.chandlerc.com/D3285

llvm-svn: 205589
2014-04-04 00:14:04 +00:00
Rui Ueyama 1c3486a312 Update comment.
llvm-svn: 205579
2014-04-03 22:58:41 +00:00
Rui Ueyama 71c0202dd0 Minor cleanups.
llvm-svn: 205578
2014-04-03 22:43:42 +00:00
Rui Ueyama 4f010d2f66 Replace a recursion with a loop for speed.
llvm-svn: 205576
2014-04-03 22:36:55 +00:00
Rui Ueyama 450d987e3a Do not check deadStripNever twice.
Atoms with deadStripNever attribute has already been added to the
dead strip root set at end of Resolver::doDefinedAtom, so no need
to check it for each atom again.

Differential Revision: http://llvm-reviews.chandlerc.com/D3282

llvm-svn: 205575
2014-04-03 22:24:40 +00:00
Rui Ueyama 70625fb163 Move code into a helper function.
Move code that always runs after doUndefinedAtom into doUndefinedAtom
for readability.

llvm-svn: 205574
2014-04-03 22:21:59 +00:00
Rui Ueyama 517f0d9b5f Minor cleanup.
llvm-svn: 205570
2014-04-03 21:16:37 +00:00
Rui Ueyama 83e6acc7f2 Simplify two if's.
llvm-svn: 205569
2014-04-03 21:11:22 +00:00
Rui Ueyama fb44f5e278 Fix comments.
llvm-svn: 205568
2014-04-03 21:06:23 +00:00
Rui Ueyama 6aa91cf13d Early return.
llvm-svn: 205567
2014-04-03 21:00:03 +00:00
Rui Ueyama 9457510abf Fix ELFFileNode::resetNextIndex().
ELFLinkingContext has a method addUndefinedAtomsFromSharedLibrary().
The method is being used to skip a shared library within --start-group
and --end-group if it's not the first iteration of the group.

We have the same, incomplete mechanism to skip a shared library within
a group too. That's implemented in ELFFileNode. It's intended to not
return a shared library on the second or further iterations in the
first place. This mechanism is preferred over
addUndefinedAtomsFromSharedLibrary because the policy is implemented
in Input Graph -- that's what Input Graph is for.

This patch removes the dupluicate feature and fixes ELFFileNode.

Differential Revision: http://llvm-reviews.chandlerc.com/D3280

llvm-svn: 205566
2014-04-03 20:54:47 +00:00
Rui Ueyama 69fcde8b0a Expand 'auto' that's hard for human to deduce its real type.
llvm-svn: 205564
2014-04-03 20:47:50 +00:00
Rui Ueyama 4469ce6c7b Add empty() to atom_collection.
"x.empty()" is more idiomatic than "x.size() == 0". This patch is to
add such method and use it in LLD.

Differential Revision: http://llvm-reviews.chandlerc.com/D3279

llvm-svn: 205558
2014-04-03 19:51:14 +00:00
Rui Ueyama e8fa7c079e Remove "virtual" and add "override".
Seems clang-modernize couldn't add "override" to nested classes, so
doing it by hand. Also removed unused virtual member function that
is not overriding anything, that seems to have been added by mistake.

llvm-svn: 205552
2014-04-03 18:25:36 +00:00
Rui Ueyama 2b2ac91fab Remove "this->".
For most member function calls we do not use "this->" in this file.
Remove the rest for consistency.

llvm-svn: 205550
2014-04-03 18:13:14 +00:00
Rui Ueyama 27754f10f5 Add comment for Linker Script node.
llvm-svn: 205510
2014-04-03 04:10:52 +00:00
Rui Ueyama b0e3b66fa5 Remove ordinals from Input Graph elements.
An ordinal is set to each child of Input Graph, but no one actually
uses it. The only piece of code that gets ordinaly values is
sortInputElements in InputGraph.cpp, but it does not actually do
anything -- we assign ordinals in increasing order just before
calling sort, so when sort is called it's already sorted. It's no-op.
We can simply remove it. No functionality change.

Differential Revision: http://llvm-reviews.chandlerc.com/D3270

llvm-svn: 205501
2014-04-03 02:21:44 +00:00
Rui Ueyama f819851b65 Fix style.
llvm-svn: 205490
2014-04-03 00:01:57 +00:00
Rui Ueyama 519a45ce36 Minor style fix.
llvm-svn: 205486
2014-04-02 23:17:39 +00:00
Rui Ueyama 63d3a54980 Concatenate strings that are unnecessarily separated.
llvm-svn: 205475
2014-04-02 22:32:51 +00:00
Rui Ueyama 7c62b1e2df Minor cleanup.
llvm-svn: 205470
2014-04-02 21:57:29 +00:00