summaryrefslogtreecommitdiffstats
path: root/lld/test/ELF/copy-errors.s
Commit message (Collapse)AuthorAgeFilesLines
* [ELF] Move (copy relocation/canonical PLT) before error checkingFangrui Song2019-08-191-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | In processRelocAux(), we handle errors before copy relocation/canonical PLT. This makes error checking a bit complex because we have to check for conditions that will be allowed by copy relocation/canonical PLT. Instead, move copy relocation/canonical PLT before error checking. This simplifies the previous clumsy error checking code `config->shared || (config->pie && expr == R_ABS && type != target->symbolicRel)` to the simple `config->isPic`. Some diagnostics can be reported in different ways. The code motion changes diagnostics for some contrived test cases: * copy-rel-pie-error.s -> copy-rel-pie2.s: It was rejected before but accepted now. ld.bfd also accepts the case. * copy-errors.s: "cannot preempt symbol" changes to "symbol 'bar' has no type" * got32{,x}-i386.s: the suggestion changes from "-fPIC or -Wl,-z,notext" to "-fPIE" * x86-64-dyn-rel-error5.s: one diagnostic changes for -pie case Reviewed By: peter.smith Differential Revision: https://reviews.llvm.org/D66007 llvm-svn: 369262
* Don't depend on "call foo" producing a X86_64_PC32.Rafael Espindola2018-02-161-2/+4
| | | | | | | | | | Newer versions of the gnu assembler produce a X86_64_PLT32 for calls. There is a change under review in llvm to do the same, so update the tests to not depend on it. We can still produce a R_X86_64_PC32 with ".long foo - .". llvm-svn: 325379
* Use getLocation to improve error message.Rafael Espindola2018-01-031-2/+7
| | | | llvm-svn: 321768
* [ELF] - Change way how we handle --noinhibit-execGeorge Rimar2017-07-261-0/+3
| | | | | | | | | | | | | Previously we handled this option implicitly, only for infering unresolved symbols handling policy. ld man says: "--noinhibit-exec Retain the executable output file whenever it is still usable", and we may want to handle other cases too. Differential revision: https://reviews.llvm.org/D35793 llvm-svn: 309091
* Change the error message format for an incompatible relocation.Rui Ueyama2017-04-031-5/+5
| | | | | | | | | | | | | | | Previous error message style: error: /home/alice/src/bar.c:12: relocation R_X86_64_PLT32 cannot refer to absolute symbol 'answer' defined in /home/alice/src/foo.o New error message style: error: relocation R_X86_64_PLT32 cannot refer to absolute symbol: foo >>> defined in /home/alice/src/foo.o >>> referenced by bar.c:12 (/home/alice/src/bar.c:12) >>> /home/alice/src/bar.o:(.text+0x1) llvm-svn: 299390
* Change the way how we print out line numbers.Rui Ueyama2016-11-211-1/+1
| | | | | | | | | | | | | | | | | | | LLD's error messages contain line numbers, function names or section names. Currently they are formatter as follows. foo.c (32): symbol 'foo' not found foo.c (function bar): symbol 'foo' not found foo.c (.text+0x1234): symbol 'foo' not found This patch changes them so that they are consistent with Clang's output. foo.c:32: symbol 'foo' not found foo.c:(function bar): symbol 'foo' not found foo.c:(.text+0x1234): symbol 'foo' not found Differential Revision: https://reviews.llvm.org/D26901 llvm-svn: 287537
* [ELF] - Change error message according to review comment. NFC.George Rimar2016-11-161-1/+1
| | | | | | Forgot about that, I am sorry. llvm-svn: 287123
* [ELF] - Improve diagnostic messages.George Rimar2016-11-161-2/+2
| | | | | | | | | Particulaty "cannot preempt symbol" message is extended with locations now. Differential revision: https://reviews.llvm.org/D26738 llvm-svn: 287120
* [ELF] Improve error reporting for relocationsPetr Hosek2016-08-181-2/+2
| | | | | | | | | | | | We should always include symbol name when reporting relocations error to simplify debugging of these issues. Without symbol names users have to manually investigate which of the libraries contain invalid relocations which can be cumbersome when linking multiple libraries. Differential Revision: https://reviews.llvm.org/D23690 llvm-svn: 279162
* [ELF] - Lowercase the error messages text. NFC.George Rimar2016-06-201-2/+2
| | | | llvm-svn: 273156
* Don't create dynamic relocations to ro segments.Rafael Espindola2016-04-301-0/+15
These would just crash at runtime. If we ever decide to support rw text segments this should make it easier to implement as there is now a single point where we notice the problem. I have tested this with a freebsd buildworld. It found a non pic assembly file being linked into a .so,. With that fixed, buildworld finished. llvm-svn: 268149
OpenPOWER on IntegriCloud