Commit Graph

7912 Commits

Author SHA1 Message Date
Rui Ueyama 9a651672d0 Clarify benchmark conditions.
llvm-svn: 296383
2017-02-27 21:07:50 +00:00
Rui Ueyama 1720ef1343 Add terminator to .eh_frame sections
Patch by Mark Kettenis.

Currenlty ld.lld does not add a terminator (a CIE with its length field
set to zero) to the .eh_frame sections it generates.  While the relevant
standards (the AMD64 SysV ABI and the Linux LSB) are not explicit about
this, such a terminator is expected by some unwinder implementations and
seems to be always emitted by ld.bfd. In addition to that, the Linux LSB

  https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html#EHFRAME

explicitly says that

  The .eh_frame section shall contain 1 or more Call Frame Information
  (CFI) records.

Currently, if the .eh_frame sections of the input files only contain
terminators, ld.lld emits a zero=sized .eh_frame section
which clearly doesn't meet that requirement.

The diff makes sure a terminator gets added to each .eh_frame section
and adjusts all the relevant tests to account for that.  An additional
test isn't needed as these adjustments mean that the existence of the
terminator is tested for by several tests already.

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

llvm-svn: 296378
2017-02-27 20:44:59 +00:00
Rui Ueyama 3ead2e73ee De-template ResolvedReloc as it doesn't actually depends on ELFT.
Pointed out by Bob Haarman.

llvm-svn: 296377
2017-02-27 20:32:34 +00:00
Rafael Espindola cf8396e4aa Add a test we already get right.
It would have found a problem in a patch I am writing.

llvm-svn: 296339
2017-02-27 13:21:18 +00:00
Rui Ueyama aa5c52744b Simplify sortMipsSymbols function a bit.
llvm-svn: 296319
2017-02-27 03:31:38 +00:00
Rui Ueyama bb07d10601 Add comments to SymbolTableSection.
llvm-svn: 296318
2017-02-27 03:31:19 +00:00
Rui Ueyama 0c001d9407 Remove dead function.
llvm-svn: 296316
2017-02-27 03:13:36 +00:00
Rui Ueyama 0fb284aa35 Remove unnecessary "this->".
llvm-svn: 296315
2017-02-27 03:10:06 +00:00
Rui Ueyama 945055aabf Rename SyntheticSection::finalize -> finalizeContents.
In LLD source code, too many functions are called "finalize", although
what they do are different. This patch gives it a better name.

llvm-svn: 296314
2017-02-27 03:07:41 +00:00
Rui Ueyama 9320cb0719 De-template SyntheticSection.
This class didn't use ELFT.

llvm-svn: 296313
2017-02-27 02:56:02 +00:00
Rui Ueyama 3255a52200 De-template InterpSection because it doesn't use ELFT.
llvm-svn: 296311
2017-02-27 02:32:49 +00:00
Rui Ueyama f8d47fda43 Update comments. Now thunks are synthetic sections.
llvm-svn: 296310
2017-02-27 02:32:29 +00:00
Rui Ueyama 536a26706f Move SymbolTable<ELFT>::Sections out of the class.
The list of all input sections was defined in SymbolTable class for a
historical reason. The list itself is not a template. However, because
SymbolTable class is a template, we needed to pass around ELFT to access
the list. This patch moves the list out of the class so that it doesn't
need ELFT.

llvm-svn: 296309
2017-02-27 02:32:08 +00:00
Rui Ueyama 02a036f2e6 De-template OutputSectionFactory.
Since OutputSection is no longer a template, it doesn't make much
sense to tempalte its factory class.

llvm-svn: 296308
2017-02-27 02:31:48 +00:00
Rui Ueyama 9d1bacb1b4 Remove useless template so that Out<ELFT> becomes just Out.
llvm-svn: 296307
2017-02-27 02:31:26 +00:00
Rui Ueyama 33d9d5d5b4 Remove an obsolete/duplicate part of a document.
llvm-svn: 296304
2017-02-27 00:11:25 +00:00
Rui Ueyama 4076fa1e21 De-template SharedSymbol.
Differential Revision: https://reviews.llvm.org/D30351

llvm-svn: 296303
2017-02-26 23:35:34 +00:00
Rui Ueyama 4d5f70ddea Fix rst markup.
llvm-svn: 296302
2017-02-26 22:17:46 +00:00
Rui Ueyama 81762abb6b Fix typo.
Pointed out by Piotr Padlewski.

llvm-svn: 296297
2017-02-26 18:32:31 +00:00
Rui Ueyama 19ce92e20c Add a section about how to use ld.lld.
llvm-svn: 296278
2017-02-26 00:20:42 +00:00
NAKAMURA Takumi 05a75e40da Revert r296215, "[PDB] General improvements to Stream library." and followings.
r296215, "[PDB] General improvements to Stream library."
r296217, "Disable BinaryStreamTest.StreamReaderObject temporarily."
r296220, "Re-enable BinaryStreamTest.StreamReaderObject."
r296244, "[PDB] Disable some tests that are breaking bots."
r296249, "Add static_cast to silence -Wc++11-narrowing."

std::errc::no_buffer_space should be used for OS-oriented errors for socket transmission.
(Seek discussions around llvm/xray.)

I could substitute s/no_buffer_space/others/g, but I revert whole them ATM.

Could we define and use LLVM errors there?

llvm-svn: 296258
2017-02-25 17:04:23 +00:00
Rui Ueyama db895d839f Add how long it takes to link chromium using ld.bfd.
llvm-svn: 296236
2017-02-25 03:27:39 +00:00
Rui Ueyama 7c9f00e634 Fix rst document format error.
llvm-svn: 296235
2017-02-25 03:01:18 +00:00
Rui Ueyama 28eada105f Factor out more code. NFC.
llvm-svn: 296232
2017-02-25 02:43:01 +00:00
Rui Ueyama 47926abfa6 Remove a default value that is always overwritten.
llvm-svn: 296230
2017-02-25 02:27:58 +00:00
Rui Ueyama 10571cd306 Make function names consistent.
Now a function to parse -foo-bar is always named getFooBar.

llvm-svn: 296229
2017-02-25 02:23:28 +00:00
Rui Ueyama 524d44c6fa Do not handle -strip in a special way. NFC.
llvm-svn: 296227
2017-02-25 02:12:37 +00:00
Rui Ueyama dfa3ad1313 Factor out code to parse -hash-style.
llvm-svn: 296226
2017-02-25 02:07:27 +00:00
Rui Ueyama a37ace8d89 Rename OMagic -> Omagic for consistency.
llvm-svn: 296225
2017-02-25 01:52:03 +00:00
Rui Ueyama 7edde294aa Factor out code to parse -L and -rpath.
llvm-svn: 296224
2017-02-25 01:51:44 +00:00
Rui Ueyama a4a643c6b9 Sort options. NFC.
llvm-svn: 296223
2017-02-25 01:51:25 +00:00
Zachary Turner af299ea5d4 [PDB] General improvements to Stream library.
This adds various new functionality and cleanup surrounding the
use of the Stream library.  Major changes include:

* Renaming of all classes for more consistency / meaningfulness
* Addition of some new methods for reading multiple values at once.
* Full suite of unit tests for reader / writer functionality.
* Full set of doxygen comments for all classes.
* Streams now store their own endianness.
* Fixed some bugs in a few of the classes that were discovered
  by the unit tests.

llvm-svn: 296215
2017-02-25 00:44:30 +00:00
Zachary Turner d2684b7969 [PDB] Rename Stream related source files.
This is part of a larger effort to get the Stream code moved
up to Support.  I don't want to do it in one large patch, in
part because the changes are so big that it will treat everything
as file deletions and add, losing history in the process.
Aside from that though, it's just a good idea in general to
make small changes.

So this change only changes the names of the Stream related
source files, and applies necessary source fix ups.

llvm-svn: 296211
2017-02-25 00:33:34 +00:00
Rui Ueyama 9cc84384ad Use uint64_t instead of uintX_t where the larger type just works.
llvm-svn: 296162
2017-02-24 19:52:52 +00:00
Rui Ueyama bb361fcba1 Mention FreeBSD ports status and wordsmithing.
Differential Revision: https://reviews.llvm.org/D30321

llvm-svn: 296157
2017-02-24 18:54:47 +00:00
Rui Ueyama 0122142c57 Fix errors in the benchmark result.
I was mixing 1000 and 1024 when calculating file sizes in MiB or
in GiB.

llvm-svn: 296155
2017-02-24 18:50:58 +00:00
Rafael Espindola 24e6f363c5 Merge OutputSectionBase and OutputSection. NFC.
Now that all special sections are SyntheticSections, we only need one
OutputSection class.

llvm-svn: 296127
2017-02-24 15:07:30 +00:00
Rafael Espindola 29c1afb880 Delete trivial setter.
llvm-svn: 296124
2017-02-24 14:34:12 +00:00
Rafael Espindola 40849419e2 Delete trivial getter.
llvm-svn: 296123
2017-02-24 14:28:00 +00:00
Rafael Espindola d224c08efc Delete unused enum values.
llvm-svn: 296118
2017-02-24 13:26:52 +00:00
Rafael Espindola a2e3fee072 Remove unnecessary template. NFC.
llvm-svn: 296117
2017-02-24 13:19:33 +00:00
Rafael Espindola 798ad9a1e8 Expand a comment. NFC.
llvm-svn: 296114
2017-02-24 13:06:59 +00:00
George Rimar 87b0d68633 [ELF] - Implemented --no-dynamic-linker option
Feature is used for producing static-linked PIE executables
(https://gcc.gnu.org/ml/gcc/2015-06/msg00008.html)
And was implemented in GNU ld https://gcc.gnu.org/ml/gcc/2015-08/msg00099.html

I also found it in linux kernel build system,
though I think that x86/x64 bootloader does not really rely on it.
Seems it used for PPC though.

Differential revision: https://reviews.llvm.org/D30258

llvm-svn: 296097
2017-02-24 08:26:18 +00:00
Rui Ueyama 28f46ba46f Add notes about the scope of the documents.
llvm-svn: 296088
2017-02-24 04:31:08 +00:00
Rui Ueyama 8b1c940c0b Re-add ReleaseNotes to the doc tree.
Looks like it is not allowed to have an .rst file in this directory
that does not belong to a document tree. I don't know why. This patch
adds a file back to fix a bot.

llvm-svn: 296087
2017-02-24 04:23:39 +00:00
Rui Ueyama 1582e76abd Reorganize the document structure a bit.
C++11.rst is removed because LLD now follows the usual coding style
of the LLVM project.

llvm-svn: 296086
2017-02-24 04:13:08 +00:00
Petr Hosek f087e312b6 [ELF] Make __ehdr_start point to ELF file headers
__ehdr_start should be pointing to ELF file headers, not program
headers.

This is a reland of D30319.

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

llvm-svn: 296085
2017-02-24 04:11:02 +00:00
Petr Hosek 9a2bba7251 Revert "[ELF] Make __ehdr_start point to ELF file headers"
This reverts commit r296079.

llvm-svn: 296083
2017-02-24 03:18:59 +00:00
Petr Hosek 701ad3fbf9 [ELF] Make __ehdr_start point to ELF file headers
__ehdr_start should be pointing to ELF file headers, not program
headers.

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

llvm-svn: 296079
2017-02-24 03:00:52 +00:00
Rui Ueyama 741cc4be7e Add documents to a doctree.
Looks like all documents must be in a doctree.

llvm-svn: 296075
2017-02-24 02:46:03 +00:00