summaryrefslogtreecommitdiffstats
path: root/lld/test/ELF/Inputs
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF] - Show .plt symbols in -Map output.George Rimar2017-12-061-0/+11
| | | | | | | | | | As mentioned in PR35471, shared functions for which .plt entry address is used shows up in bfd's map files. Patch teaches LLD to do the same. Differential revision: https://reviews.llvm.org/D40839 llvm-svn: 319879
* Make this test a bit less confusing.Rafael Espindola2017-12-061-0/+1
| | | | | | Before this patch foo and bar have the same address as .text is empty. llvm-svn: 319877
* Recommit r319747 "[ELF] - Show copy relocated symbols in a --Map file output."George Rimar2017-12-051-0/+12
| | | | | | | | | | | | | | | With fix: Specify -soname for input dso to fix up the .dynstr section size in different environments. Original commit message: As mentioned in PR35471, copied symbols did not show in --Map output. Patch fixes that. Differential revision: https://reviews.llvm.org/D40785 llvm-svn: 319769
* [ELF] - Revert r319747 "[ELF] - Show copy relocated symbols in a --Map file ↵George Rimar2017-12-051-12/+0
| | | | | | | | | | | | | | output.". It broke bots: http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/15570/steps/test_lld/logs/stdio http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/10930/steps/check-lld%20asan/logs/stdio http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/16336/steps/test%20lld/logs/stdio According to outputs, .dynstr section has different sizes for some reason. llvm-svn: 319749
* [ELF] - Show copy relocated symbols in a --Map file output.George Rimar2017-12-051-0/+12
| | | | | | | | | As mentioned in PR35471, copied symbols did not show in --Map output. Patch fixes that. Differential revision: https://reviews.llvm.org/D40785 llvm-svn: 319747
* Copy the visibility in copyFrom.Rafael Espindola2017-11-281-0/+1
| | | | | | This is simpler and matches bfd's behavior on the changed test. llvm-svn: 319248
* Bring back r319008.Rafael Espindola2017-11-281-0/+3
| | | | | | | | | | | | | | This includes a fix to mark copy reloc aliases as used. Original message: [ELF] Do not keep symbols if they referenced only from discarded sections. This patch also ensures that in case of "--as-needed" is used, DT_NEEDED entries are not created if they are required only by these eliminated symbols. llvm-svn: 319215
* Handle binding in --wrap.Rafael Espindola2017-11-281-1/+3
| | | | | | Copying the binding seems reasonable and matches the bfd behavior. llvm-svn: 319196
* Revert r319008, "[ELF] Do not keep symbols if they referenced only from ↵Igor Kudrin2017-11-281-3/+0
| | | | | | | | | | | discarded sections." and r319051, "Add a missing test." r319008 broke the LTO bots; r319051 depends on changes in r319008. llvm-svn: 319154
* [ELF] Do not keep symbols if they referenced only from discarded sections.Igor Kudrin2017-11-271-0/+3
| | | | | | | | | | This patch also ensures that in case of "--as-needed" is used, DT_NEEDED entries are not created if they are required only by these eliminated symbols. Differential Revision: https://reviews.llvm.org/D38790 llvm-svn: 319008
* [ELF] Make tests with undefined symbols more explicit.Igor Kudrin2017-11-241-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D40253 llvm-svn: 318939
* Make a test stricter.Rafael Espindola2017-11-231-0/+3
| | | | | | | | It now has a DT_NEEDED that could be removed by --gc-sections and one that cannot. Without this all tests would pass if --gc-sections just removed all DT_NEEDED. llvm-svn: 318937
* Use 64 bits for the shared symbol size again.Rafael Espindola2017-10-301-0/+4
| | | | | | | We might want to drop support for such large symbols, but that should be an explicit decision with a testcase. llvm-svn: 316931
* Skip abs symbols when handling copy reloc aliases.Rafael Espindola2017-10-301-0/+13
| | | | | | | Since we now only check st_value, we have to consider the case where the section index is special. llvm-svn: 316928
* LLD/ELF/AMDGPU: Process AMDGPU-specific e_flagsKonstantin Zhuravlyov2017-10-243-0/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D39140 llvm-svn: 316483
* Correctly handle shared and lazy symbols.Rafael Espindola2017-10-131-0/+2
| | | | | | | I will try to make this API a bit less error prone, but for now just get another test passing. llvm-svn: 315645
* [ELF] Try to not emit weird diagnostics on undefined symbols.Davide Italiano2017-10-111-0/+1
| | | | | | | | Fixes PR34872. Differential Revision: https://reviews.llvm.org/D38712 llvm-svn: 315487
* Refine our --wrap implementation.Rafael Espindola2017-10-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Before this patch we would copy foo into real_foo and wrap_foo into foo. The net result is that __wrap_foo shows up twice in the symbol table. With this patch we: * save a copy of __real_foo before copying foo. * drop one of the __wrap_foo from the symbol table. * if __real_foo was not undefined, add a *new* symbol with that content to the symbol table. The net result is that Anything using foo now uses __wrap_foo Anything using __real_foo now uses foo. Anything using __wrap_foo still does. And the symbol table has foo, __wrap_foo and __real_foo (if defined). Which I think is the desired behavior. llvm-svn: 315097
* [ELF] Don't crash when parsing a file with external version definition ↵Alexander Richardson2017-10-051-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | references Summary: We were crashing when linking telnetd in FreeBSD because lld was emitting corrupted output files for --norosegment. In this file the version index of some symbols was set to 9 but lld only found 8 version definitions. I am not sure how to create a minimal .so file that also exposes this behaviour so I just added the one that initially caused the error to Inputs/ This partially addresses https://bugs.llvm.org/show_bug.cgi?id=34705 Reviewers: ruiu, rafael, pcc, grimar Reviewed By: ruiu Subscribers: emaste, krytarowski Tags: #lld Differential Revision: https://reviews.llvm.org/D38397 llvm-svn: 315035
* [ELF] - Get rid of precompiled input objects from testcases.George Rimar2017-10-045-58/+37
| | | | | | | | | | | | | | We have verneed1.so, verneed2.so files and verneed.so.sh script to produce them. They were committed long time ago when LLD was not yet able to produce some sections for versioning (".gnu.version_r" I think). There is no point to have them as binaries anymore. Patch creates asm inputs instead based on verneed.so.sh content. Differential revision: https://reviews.llvm.org/D38505 llvm-svn: 314889
* Add a test.Rafael Espindola2017-09-281-0/+3
| | | | | | | | | | This would have found the issues with r313697. The problem was that that commit mixed the content of different .eh_frame sections. Unfortunately we had no tests looking inside the fdes. llvm-svn: 314433
* Handle lazy symbols is Symbol::includeInDynsym.Rafael Espindola2017-09-131-0/+3
| | | | | | | | | | This should fix the lto bootstrap. It is somewhat hard to remember about lazy symbols deep down in the link. It might be worth it replacing them with undefined symbols once we are done adding files. llvm-svn: 313103
* [MIPS] Initial support of microMIPS code linkingSimon Atanasyan2017-09-121-0/+12
| | | | | | | | | | | | | | | | The patch implements initial support of microMIPS code linking: - Handle microMIPS specific relocations. - Emit both R1-R5 and R6 microMIPS PLT records. For now linking mixed set of regular and microMIPS object files is not supported. Also the patch does not handle (setup and clear) the least-significant bit of an address which is utilized as the ISA mode bit and allows to make jump between regular and microMIPS code without any thunks. Differential revision: https://reviews.llvm.org/D37335 llvm-svn: 313028
* Handle lazy symbols is computeIsPreemptible.Rafael Espindola2017-09-081-0/+2
| | | | llvm-svn: 312812
* Don't depend on these symbols being implicitly global.Rafael Espindola2017-07-191-0/+3
| | | | | | This might change in llvm-mc and it is nice to be explicit in a test. llvm-svn: 308506
* Bring back r307364.Rafael Espindola2017-07-192-0/+7
| | | | | | | | | | | | | | | | | | | | | | | In addition this includes a change to prefer symbols with a default version @@ over unversioned symbols. Original commit message: [ELF] - Handle symbols with default version early. This fixes last testcase provided in PR28414. In short issue is next: when we had X@@Version symbol in object A, we did not resolve it to X early. Then when in another object B we had reference to undefined X, symbol X from archive was fetched. Since both archive and object A contains another symbol Z, duplicate symbol definition was triggered as a result. Correct behavior is to use X@@Version from object A instead and do not fetch any symbols from archive. Differential revision: https://reviews.llvm.org/D35059 llvm-svn: 308492
* Revert r307364: [ELF] - Handle symbols with default version early.Rui Ueyama2017-07-182-7/+0
| | | | | | | This reverts commit r307364 because that change is likely to have caused https://bugs.llvm.org/show_bug.cgi?id=33820. llvm-svn: 308239
* Fix tests for .ctors/.dtors.Rui Ueyama2017-07-173-6/+6
| | | | | | They are supposed to contain pointers, so .byte wasn't quite right. llvm-svn: 308214
* [ELF] - Remove dependency on precompiled inputs from -gdb-index testcases.George Rimar2017-07-143-0/+73
| | | | | | | | | Previously we used precompiled objects in gdb-index.s and debug-gnu-pubnames.s testcases. We can avoid that. Differential revision: https://reviews.llvm.org/D35360 llvm-svn: 308005
* Bring back InVersionScript.Rafael Espindola2017-07-121-0/+1
| | | | | | We were producing bogus warnings without it. llvm-svn: 307820
* [ELF] - Fix handling of weak symbols from static library when using version ↵George Rimar2017-07-121-0/+4
| | | | | | | | | | | | | | script. When version script was used, binding opf undefined weak symbols sometimes was calculated as STB_LOCAL, making them non-preemtible what broke correct relocations handling logic for them. Fixes PR33738. Differential revision: https://reviews.llvm.org/D35263 llvm-svn: 307767
* [ELF] - Fix functionality treating IFunc definitions in DSOs as functions.George Rimar2017-07-111-0/+3
| | | | | | | | | It was intially implemented in D19517 but then broken. Patch fixes PR33707, testcase is based on PR's case. Differential revision: https://reviews.llvm.org/D35119 llvm-svn: 307652
* [ELF] - Handle symbols with default version early.George Rimar2017-07-072-0/+7
| | | | | | | | | | | | | | | | This fixes last testcase provided in PR28414. In short issue is next: when we had X@@Version symbol in object A, we did not resolve it to X early. Then when in another object B we had reference to undefined X, symbol X from archive was fetched. Since both archive and object A contains another symbol Z, duplicate symbol definition was triggered as a result. Correct behavior is to use X@@Version from object A instead and do not fetch any symbols from archive. Differential revision: https://reviews.llvm.org/D35059 llvm-svn: 307364
* Fix PR33635.Rafael Espindola2017-07-051-0/+2
| | | | | | | | | This is a semantic revert of r306036. We have to change the names, otherwise dynamic relocations will point to the wrong name. llvm-svn: 307110
* [ELF] - Do not set st_size field of SHT_UNDEF symbols.George Rimar2017-06-281-0/+4
| | | | | | | | | | | | | | | | | This fixes PR33598. Size field for undefined symbols is not significant. Setting it to fixed value, like zero, may be useful though. For example when we have 2 DSO's, like in this PR, if lower level DSO may change slightly (in part of some symbol's st_size) and higher-level DSO is rebuilt, then tools that monitoring checksum of high level DSO file can notice it and trigger cascade of some other unnecessary actions. If we set st_size to zero, that can be avoided. Differential revision: https://reviews.llvm.org/D34673 llvm-svn: 306526
* Implement the --exclude-libs option.Rui Ueyama2017-06-211-0/+3
| | | | | | | | | The --exclude-libs option is not a popular option, but at least some programs in Android depend on it, so it's worth to support it. Differential Revision: https://reviews.llvm.org/D34422 llvm-svn: 305920
* Allow the GNU gold-style nonstandard SHT_GROUP section.Rui Ueyama2017-06-122-0/+14
| | | | | | | | | | | | | | | | | | | | | The ELF standard defines that the SHT_GROUP section as follows: - its sh_link has the symbol index, and - the symbol name is used to uniquify section groups. Object files created by GNU gold does not seem to comply with the standard. They have this additional rule: - if the symbol has no name and a STT_SECTION symbol, a section name is used instead of a symbol name. If we don't do anything for this, the linker fails with a mysterious error message if input files are generated by gas. It is unfortunate but I think we need to support it. Differential Revision: https://reviews.llvm.org/D34064 llvm-svn: 305218
* ELF: Teach ICF about relocations referring to merge input sections.Peter Collingbourne2017-06-124-0/+39
| | | | | | | | | Relocations referring to merge sections are considered equal if they resolve to the same offset in the same output section. Differential Revision: https://reviews.llvm.org/D34094 llvm-svn: 305177
* [ELF] - Allow multiple comdats when producing relocatable output.George Rimar2017-06-061-0/+2
| | | | | | | | | | | | Previously LLD would fail for case when there are multiple comdats and -r. That happened because it merged all ".group" (SHT_GROUP) sections into single output, producing broken result. Such sections may have similar name, alignment and flags and other properties. We need to produce separate output section for each such input one. Differential revision: https://reviews.llvm.org/D33643 llvm-svn: 304769
* [lld][ELF]Add option to make .dynamic read onlyPetr Hosek2017-05-261-0/+4
| | | | | | | | | | | | | | The .dynamic section of an ELF almost doesn't need to be written to with the exception of the DT_DEBUG entry. For several reasons having a read only .dynamic section would be useful. This change adds the -z keyword "rodynamic" which forces .dynamic to be read-only. In this case DT_DEBUG will not be emited. Patch by Jake Ehrlich Differential Revision: https://reviews.llvm.org/D33251 llvm-svn: 304024
* [ELF] - Stop support of DF_STATIC_TLS flag.George Rimar2017-05-124-37/+0
| | | | | | | | This reverts changes introduced in r302414 "[ELF] - Set DF_STATIC_TLS flag for i386 target." Because DF_STATIC_TLS does not look to be used by glibc or anything else. llvm-svn: 302884
* [ELF] - Set DF_STATIC_TLS flag for i386 target.George Rimar2017-05-084-0/+37
| | | | | | | | | | | | | | | | | | This is PR32437. DF_STATIC_TLS If set in a shared object or executable, this flag instructs the dynamic linker to reject attempts to load this file dynamically. It indicates that the shared object or executable contains code using a static thread-local storage scheme. Implementations need not support any form of thread-local storage. Patch checks if IE/LE relocations were used to check if code uses static model. If so it sets the DF_STATIC_TLS flag. Differential revision: https://reviews.llvm.org/D32354 llvm-svn: 302414
* Handle mixed strong and weak undefined symbols.Rafael Espindola2017-05-031-0/+1
| | | | | | | | We were ignoring strong undefined symbols if they followed weak ones. Fixes pr32899. llvm-svn: 302065
* Avoid empty .eh_frame sections.Rafael Espindola2017-05-021-0/+2
| | | | | | | | | | | | | | | | | | | | Strip on OpenBSD does not correctly handle an empty .eh_frame section and produces broken binaries in that case. Currently lld creates such an empty .eh_frame section, despite the fact that the OpenBSD crtend.o explicitly inserts a terminator. The Linux LSB "standard": 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. This diff includes a test that specifically tests the issue I'm seeing on OpenBSD. Patch by Mark Kettenis! llvm-svn: 301931
* Replace a binary .so with a text .s.Rui Ueyama2017-04-242-0/+3
| | | | | | | Since LLD is now able to take version scripts, we no longer have to keep a pre-generated binary file for a test. llvm-svn: 301279
* [ELF] - Stop producing broken output for R_386_GOT32[X] relocations.George Rimar2017-04-081-0/+0
| | | | | | | | | | | | | | | | | | Previously we silently produced broken output for R_386_GOT32X/R_386_GOT32 relocations if they were used to compute the address of the symbol’s global offset table entry without base register when position-independent code is disabled. Situation happened because of recent ABI changes. Released ABI mentions that R_386_GOT32X can be calculated in a two different ways (so we did not follow ABI here before this patch), but draft ABI also mentions R_386_GOT32 relocation here. We should use the same calculations for both relocations. Problem is that we always calculated them as G + A - GOT (offset from end of GOT), but for case when PIC is disabled, according to i386 ABI calculation should be G + A, what should produce just an address in GOT finally. ABI: https://github.com/hjl-tools/x86-psABI/wiki/intel386-psABI-draft.pdf (p36, p60). llvm-svn: 299812
* [ELF] - Recommit "[ELF] - Make Bss and BssRelRo sections to be synthetic (#3)."George Rimar2017-03-171-0/+7
| | | | | | | | | | | | | | | | | | Was fixed, details on review page. Original commit message: That removes CopyRelSection class completely, making Bss/BssRelRo to be just regular synthetics. This is splitted from D30541 and polished. Difference from D30541 that all logic of SharedSymbol converting to DefinedRegular was removed for now and probably will be posted as separate patch. Differential revision: https://reviews.llvm.org/D30892 llvm-svn: 298062
* Don't create copy relocs or dummy plt's if given -z notext.Rafael Espindola2017-03-141-0/+10
| | | | | | | | | Being passed -z notext is a pretty strong indication that the user is OK with text relocations. This is not the same behavior as bfd, but bfd defaults to -z notext, so it has to try to avoid text relocations and use them as a last resort. llvm-svn: 297789
* [ELF] Ignore R_*_NONE relocs when relocating non-alloc sectionsPetr Hosek2017-02-231-0/+6
| | | | | | | | | We shouldn't report an error for R_*_NONE relocs since we're emitting them when writing relocations to discarded sections. Differential Revision: https://reviews.llvm.org/D30279 llvm-svn: 295936
* Fix checks for R_386_8 and R_386_16.Rafael Espindola2017-02-134-0/+12
| | | | | | | Results created by these relocations are expected to be zero extended at runtime. llvm-svn: 294988
OpenPOWER on IntegriCloud