summaryrefslogtreecommitdiffstats
path: root/lld
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename Indent{1,2} -> Indent{8,16}.Rui Ueyama2018-03-072-8/+8
| | | | llvm-svn: 326912
* Improve --warn-symbol-ordering.Rui Ueyama2018-03-073-24/+30
| | | | | | | | | | | | | | | | Summary: I originally tried to simplify code and then noticed that lld doesn't do what it tells to the user by warn(). It says "unable to order discarded symbol" but it actually can for sections eliminated by ICF. With this patch, lld doesn't sort such sections. Reviewers: jhenderson, rafael Subscribers: emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D44180 llvm-svn: 326911
* [ELF] Prevent crash when reporting errors if debug line cannot be parsedJames Henderson2018-03-073-2/+52
| | | | | | | | | | | | | LLD uses the debug info and debug line sections to determine the location of e.g. references to undefined symbols, when producing error messages. In the event that debug info was present, but debug line parsing failed for some reason, then a nullptr would end up being dereferenced by the location-lookup code. Differential Revision: https://reviews.llvm.org/D44205 Reviewers: grimar llvm-svn: 326899
* [WebAssembly] Run clang-format. NFCNicholas Wilson2018-03-079-23/+25
| | | | llvm-svn: 326896
* [ELF] - Recommit r326892,r326893 "[ELF] - Report LMA region overflows."George Rimar2018-03-072-2/+18
| | | | | | | | | | | | With fix: add missing "RUN:" prefix to test case. Original commit message: We do not report LMA region overflows currently. Both GNU linkers do that. The patch implements it. Differential revision: https://reviews.llvm.org/D44094 llvm-svn: 326895
* [ELF] - Revert r326892, r326893.George Rimar2018-03-072-18/+2
| | | | | | | Bots are still unhappy: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/26259 llvm-svn: 326894
* [ELF] - Fix build bot after r326892 "[ELF] - Report LMA region overflows."George Rimar2018-03-071-1/+0
| | | | | | Removed excessive line from testcase. llvm-svn: 326893
* [ELF] - Report LMA region overflows.George Rimar2018-03-072-2/+19
| | | | | | | | | We do not report LMA region overflows currently. Both GNU linkers do that. The patch implements it. Differential revision: https://reviews.llvm.org/D44094 llvm-svn: 326892
* [ELF] - Allow discarding .hash and .gnu.hash from linker script.George Rimar2018-03-072-0/+31
| | | | | | | | | Currently, LLD segfaults when linker script attempts to discard one of the hash sections. This patch fixes that. Differential revision: https://reviews.llvm.org/D44012 llvm-svn: 326891
* [WebAssembly] Remove duplicated line of code and unreachable check. NFCNicholas Wilson2018-03-071-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D44146 llvm-svn: 326888
* [WebAssembly] Use StringSaver to retain ownership of ctor function body. NFCNicholas Wilson2018-03-072-6/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D44149 llvm-svn: 326885
* Split long lines in a test file.Rui Ueyama2018-03-071-30/+32
| | | | llvm-svn: 326850
* Do not create temporary strings just to print out spaces. NFC.Rui Ueyama2018-03-062-8/+10
| | | | llvm-svn: 326841
* Implement --just-symbols.Rui Ueyama2018-03-066-0/+78
| | | | | | Differential Revision: https://reviews.llvm.org/D39348 llvm-svn: 326835
* Improve duplicated version handling.Rafael Espindola2018-03-062-5/+9
| | | | | | | | | | | | It looks like the problem that caused us to originally warn instead of error was that of a symbol being assigned to the same version twice. Now we don't warn if a symbol is assigned to the same version twice, but error if it is assigned to multiple. This fixes pr28342. llvm-svn: 326813
* Remove redundant casts.Rui Ueyama2018-03-051-2/+2
| | | | llvm-svn: 326753
* [WebAssembly] Reorder reloc sections to come after symtabNicholas Wilson2018-03-051-1/+1
| | | | | | | | This matches LLVM change D43940. Differential Revision: https://reviews.llvm.org/D43946 llvm-svn: 326693
* [ELF] - Support moving location counter when MEMORY is used.George Rimar2018-03-053-29/+62
| | | | | | | | | | | | | | | | We do not expand memory region correctly for following scripts: .foo.1 : { *(.foo.1) . += 0x1000; } > ram Patch generalizes expanding of output sections and memory regions in one place and fixes the issue. Differential revision: https://reviews.llvm.org/D43999 llvm-svn: 326688
* [ELF] - Report location for div/mod by zero.George Rimar2018-03-052-20/+27
| | | | | | | | | | | "division by zero" or "modulo by zero" are not very informative errors and even probably confusing as does not let to know that error is coming from linker script. Patch adds location reporting. Differential revision: https://reviews.llvm.org/D43934 llvm-svn: 326686
* Simplify. NFC.Rafael Espindola2018-03-032-7/+1
| | | | | | | Since r321982 we don't set VersionId in scanShlibUndefined, which makes InVersionScript redundant. llvm-svn: 326641
* [WebAssembly] Simplify createDefined. NFC.Rui Ueyama2018-03-021-10/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D43849 llvm-svn: 326615
* [WebAssembly] Rename global types to match the notation in the specNicholas Wilson2018-03-021-4/+2
| | | | llvm-svn: 326583
* [WebAssembly] Export non-hidden defined data symbols via wasm globalsNicholas Wilson2018-03-026-8/+56
| | | | | | | | This fixes a TODO introduced in rLLD325861. Differential Revision: https://reviews.llvm.org/D43930 llvm-svn: 326581
* [WebAssembly] Pass ownership of body to SyntheticFunction. NFCNicholas Wilson2018-03-022-15/+15
| | | | | | | | | This avoids the Writer unnecessarily having a member to retain ownership of the function body. Differential Revision: https://reviews.llvm.org/D43933 llvm-svn: 326580
* [WebAssembly] Add validation for init function signatureNicholas Wilson2018-03-021-3/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D43947 llvm-svn: 326579
* [ELF] - Report error when memory region is overflowed by data commands.George Rimar2018-03-022-12/+37
| | | | | | | | | | | | | | | | | | LLD can not catch a memory area overflow when using a data command. If we have the script below: .foo : { *(.foo) BYTE(0x1) } > ram where BYTE overflows the ram region, we do not report it currently. Patch fixes that. Differential revision: https://reviews.llvm.org/D43948 llvm-svn: 326545
* Update man page for long opts that accept = after r326506Ed Maste2018-03-021-7/+7
| | | | | | | | | | | Also remove the space between --lto-O and value, as the option with a space is not accepted at present. Leave --opt-remarks-filename as it does not currently accept the = form. llvm.org/pr36563 llvm-svn: 326536
* [WebAssembly] Simplify COMDAT handling.Rui Ueyama2018-03-013-22/+10
| | | | | | Differential Revision: https://reviews.llvm.org/D43966 llvm-svn: 326509
* Report an error if you try to link against .dll instead of .lib.Rui Ueyama2018-03-012-11/+23
| | | | | | | | | | | | It is a usage error to feed a .dll file instead of a .dll to COFF linker. Previously, lld failed with a mysterious error message. Now we reject it at the driver. Fixes https://bugs.llvm.org/show_bug.cgi?id=36440 Differential Revision: https://reviews.llvm.org/D43964 llvm-svn: 326507
* Accept both `--foo bar` and `--foo=bar` styles options.Rui Ueyama2018-03-016-18/+20
| | | | | | | | | GNU linkers by convention supports both `--foo bar` and `--foo=bar` styles for all long options that take arguments. Differential Revision: https://reviews.llvm.org/D43972 llvm-svn: 326506
* Rename a test file and fix indentation.Rui Ueyama2018-03-012-12/+12
| | | | llvm-svn: 326504
* Set DF_TEXTREL to executables that need text relocations.Rui Ueyama2018-03-012-2/+8
| | | | | | | | | | | | | | | | | | | | | | Summary: If an executable needs text relocations, it should be marked as such so that the loader can prepare for text relocations. We currently create a dummy segment with DT_TEXTREL for that purpose. Generic ABI as of 2000 [1] mentioned that "Its [DT_TEXTREL's] use has been superseded by the DF_TEXTREL flag". However, it's actually not superseded even after 18 years. OpenBSD and musl recognize only DT_TEXTREL. So we still need to set both. [1] http://www.sco.com/developers/gabi/2000-07-17/ch5.dynamic.html Reviewers: rafael Subscribers: emaste, llvm-commits, arichardson Differential Revision: https://reviews.llvm.org/D43920 llvm-svn: 326503
* Don't ingoned --enable-new-dtags.Rafael Espindola2018-03-012-2/+7
| | | | llvm-svn: 326498
* [MinGW] Fix --{start,end}-group.Rui Ueyama2018-03-012-2/+4
| | | | | | | | Currently --start-group=foo is accidentally accepted by the MinGW driver. Differential Revision: https://reviews.llvm.org/D43836 llvm-svn: 326478
* Correct man page description for --section-startEd Maste2018-03-011-1/+1
| | | | | | | | | The argument is section=address, not just address. (For compatibility with GNU linkers we need to, but do not yet, accept --section-start=section=address.) llvm-svn: 326463
* Where possible use --long-opt=value in lld man pageEd Maste2018-03-011-20/+20
| | | | | | | | | | | | | | We intend to maintain compatibility with GNU ld, and in the GNU world long options are conventionally specified as --long-option=value. For whatever reason GNU ld.bfd accepts both --long-option value and --long-option=value, but documents the former. Follow suit. Some lld long options do not accept the = form; this is probably a bug to be fixed (along with a man page update). Reported by Ingo Schwarze, for --entry. llvm-svn: 326459
* [WebAssembly] Use uint8_t for single byte values to match the specSam Clegg2018-03-013-12/+11
| | | | | | Differential Revision: https://reviews.llvm.org/D43922 llvm-svn: 326455
* [PDB] Defer writing the build id until the rest of the PDB is written.Zachary Turner2018-03-011-3/+1
| | | | | | | | | | For now this is NFC, but this small refactor opens the door to letting us embed a hash of the PDB in the build id field of the PDB. Differential Revision: https://reviews.llvm.org/D43913 llvm-svn: 326453
* Correct markup and nits in ld.lld man pageEd Maste2018-03-011-38/+40
| | | | | | Patch by Ingo Schwarze llvm-svn: 326446
* Don't allocate a header bellow address 0.Rafael Espindola2018-03-012-4/+29
| | | | | | | | | | | | With the current code if the script has a PHDRS we always obey and try to allocate a header. This can cause Min - HeaderSize to underflow. It looks like bfd actually prints an error for this case. With this patch we do the same. Found while looking at pr36515. llvm-svn: 326441
* [ELF] - Don't crash on broken MEMORY declaration.George Rimar2018-03-012-3/+20
| | | | | | | | | | | LLD crashes with broken scripts shown in testcase, because fails to read memory regon name and accesses MemoryRegions's element which is nullptr. Patch fixes it. Differential revision: https://reviews.llvm.org/D43866 llvm-svn: 326431
* [ELF] - Do not remove empty sections that use symbols in expressions.George Rimar2018-03-014-5/+27
| | | | | | | | | | | | | | | This is PR36515. Currenly if we have a script like .debug_info 0 : { *(.debug_info) }, we would not remove this section and keep it in the output. That does not work, because it is common case for debug sections to have a zero address expression. Patch changes behavior so that we remove only sections that do not use symbols in its expressions. Differential revision: https://reviews.llvm.org/D43863 llvm-svn: 326430
* [ELF] - Fix eh-frame-reloc-out-of-range.test.George Rimar2018-03-011-1/+1
| | | | | | Was broken after recent testcases changes. llvm-svn: 326427
* [WebAssembly] Reorder exports to match symbol table orderNicholas Wilson2018-03-0114-105/+103
| | | | | | | | This fixes a TODO introduced in rLLD325861. Differential Revision: https://reviews.llvm.org/D43877 llvm-svn: 326424
* Convert more tests as linker scripts instead of assembly.Rui Ueyama2018-03-0136-491/+445
| | | | llvm-svn: 326415
* [WebAssembly] Remove unused forward declaration.Rui Ueyama2018-03-011-2/+0
| | | | llvm-svn: 326411
* Do not create multiple NOTE segments.Rui Ueyama2018-03-012-12/+22
| | | | | | | | | | | Previously, we didn't try to make effort to put .note sections next to each other in the output file, so two .note sections were likely to be stored to two separate NOTE segments. That's undesirable because we should create as few segments as possible in general. Differential Revision: https://reviews.llvm.org/D43858 llvm-svn: 326410
* Expand test a bit.Rafael Espindola2018-03-011-11/+27
| | | | | | | | | It now includes both linkerscript and non linkerscript variants. Extracted from a patch by Rui while I was trying to figure out what exactly was changing. llvm-svn: 326409
* Convert more .s files to linker script files.Rui Ueyama2018-03-0136-468/+506
| | | | | | | | | | | | | | Summary: This change removes large "echo" commands from the test by writing tests themselves as linker scripts. Reviewers: rafael Subscribers: emaste, javed.absar, llvm-commits, arichardson Differential Revision: https://reviews.llvm.org/D43900 llvm-svn: 326403
* Simplify removing empty output sections.Rafael Espindola2018-03-014-32/+30
| | | | | | | With this the meaning of the Live bit in output sections is clear: we have at some point added a input section into it. llvm-svn: 326401
OpenPOWER on IntegriCloud