Commit Graph

77 Commits

Author SHA1 Message Date
Rui Ueyama fb771c2dfc Remove unused #include.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@293144 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-26 03:02:30 +00:00
Rui Ueyama cfca03737d Rename lld::stringize -> lld::toString.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@291223 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 10:04:35 +00:00
Rui Ueyama fa5e4cf8f0 Make -color-diagnostics an alias to -color-diagnostics=always.
Previously, that was an alias to -color-diagnostics=auto. However,
Clang's -fcolor-diagnostics is an alias to -fcolor-diagnostics=always,
so that was confusing. This patch fixes that issue.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@290332 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-22 08:20:28 +00:00
Rui Ueyama 4cc2141f48 Set Config->ColorDiagnostics early so that all error messages are colored.
Previously, some errors that were checked before we set to
Config->ColorDiagnostics weren't colored. This patch moves the code
to set the variable so that such error messages are colored just like
other error messages.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@290157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 02:17:24 +00:00
Rui Ueyama 54b01a52e8 Remove lld/Support/Memory.h.
I thought for a while about how to remove it, but it looks like we
can just copy the file for now. Of course I'm not happy about that,
but it's just less than 50 lines of code, and we already have
duplicate code in Error.h and some other places. I want to solve
them all at once later.

Differential Revision: https://reviews.llvm.org/D27819

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@290062 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 14:06:06 +00:00
Rui Ueyama ca7af8d122 Move Memory.{h,cpp} to lld/Support so that we can use them from COFF.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@289084 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 18:31:13 +00:00
Rafael Espindola f2534ab7f2 Change the implementation of --dynamic-list to use linker script parsing.
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.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@289082 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 17:54:26 +00:00
Eugene Leviant 91d98a530b [ELF] Better error reporting for linker scripts
Differential revision: https://reviews.llvm.org/D26795


git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@287547 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 15:49:56 +00:00
Rui Ueyama 2dadc2247f Simplify. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@287510 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 23:15:56 +00:00
Rui Ueyama 9db69e9472 Remove a file that is too short to be an independent file.
We have a .cpp and a .h for parseDynamicList(). This patch
moves the function to DriverUtil.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@287468 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 23:26:41 +00:00
Rui Ueyama 2d57189879 Restore a comment that was accidentally changed.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@287457 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 19:26:52 +00:00
Rui Ueyama 14d0452441 Use Optional<std::string> instead of "" to represent a failure.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@287456 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 19:23:58 +00:00
Rui Ueyama b94e6b5346 Make buildSysrootedPath file-scoped.
This patch also changes its return type to simplify callers.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@287455 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 19:23:56 +00:00
Rui Ueyama 1b4599d6e9 Simplify "missing argument" error message.
We do not have an option taking more than one arguments,
so we can just say "missing argument" instead of "missing argument(s)".

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@287454 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 18:49:38 +00:00
George Rimar ff0e58ec40 [ELF] - format. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@286805 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14 10:14:18 +00:00
Rui Ueyama e891443c54 Consolidate BumpPtrAllocators.
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

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@285452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 20:57:25 +00:00
Rui Ueyama c0f3d27d3b Move getVersionString to Core and simplify Version.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@284641 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 20:53:07 +00:00
Peter Collingbourne 8018723e4d COFF: Implement /linkrepro flag.
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

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@276719 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 02:00:42 +00:00
Rui Ueyama 44fb4e11a1 Attempt to unbreak Windows bot.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275695 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 19:16:15 +00:00
Rui Ueyama b95bc62d89 Remove redundant namespace specifiers.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275694 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 18:55:47 +00:00
Rui Ueyama 16e18b3162 Do not call warning() from ELFOptTable::parse().
warning() depends on Config->FatalWarnings, so we don't want to call
that function before we initialize that member.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@274723 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-07 01:58:04 +00:00
Rui Ueyama 9f1fc2494b Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@274719 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-07 01:21:14 +00:00
Davide Italiano 75923baaea [ELF] Introduce a flag to parse response files according to windows rules.
Differential Revision:  http://reviews.llvm/org/D22015

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@274684 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-06 21:24:34 +00:00
Rafael Espindola d50adaf7d1 Use / instead of \ on windows created cpio files
Otherwise when extracting these files on a unix system one
ends up with files named like "repro\bar\foo.o".

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@274622 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-06 12:09:51 +00:00
Rui Ueyama 918a54e2b2 Create Strings.cpp and move string manipulation functions to that file.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@274109 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 08:01:32 +00:00