summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [MCA] Remove unused fields from BottleneckAnalysis. NFCAndrea Di Biagio2019-05-313-15/+12
| | | | | | This should appease the buildbots. llvm-svn: 362251
* [MCA] Refactor class BottleneckAnalysis. NFCIAndrea Di Biagio2019-05-313-80/+406
| | | | | | | | | | | | | | | | | | | | The resource pressure distribution computation is now delegated by class BottleneckAnalysis to an instance of class PressureTracker. Class PressureTracker is also responsible for: - tracking users of processor resource units. - tracking the number of delay cycles caused by increases in backpressure. BottleneckAnalysis internally initializes a dependency graph. Each nodes represents an instruction in the input code sequence. Edges of the dependency graph are critical register/memory/resource dependencies. Dependencies are only added to the graph if they are seen as critical by backend pressure events. The DependencyGraph is currently unused. It is possible to print the dependency graph (see method DependencyGraph::dump()) for debugging purposes. The long term goal is to use the information stored by the dependency graph in order to do critical path computation. llvm-svn: 362246
* Fix -DBUILD_SHARED_LIBS=ON build after rL362160Sam Clegg2019-05-312-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D62709 llvm-svn: 362180
* [Remarks][NFC] Move the serialization to lib/RemarksFrancis Visoiu Mistrih2019-05-302-3/+5
| | | | | | | | | | | | Separate the remark serialization to YAML from the LLVM Diagnostics. This adds a new serialization abstraction: remarks::Serializer. It's completely independent from lib/IR and it provides an easy way to replace YAML by providing a new remarks::Serializer. Differential Revision: https://reviews.llvm.org/D62632 llvm-svn: 362160
* Write new tests for r362121Michael Trent2019-05-301-6/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The tests for r362121 ran dsymutil against a test binary every time. This caused problems on lld-x86_64-ubuntu-fast as dsymutil required a lipo tool be available to process those binaries. This change rewrites the new test cases in macho-disassemble-g-dsym to use bespoke test binaries (exe and dwarf) simplifying the test's runtime dependencies. The changes to tools/llvm-objdump/MachODump.cpp are unchanged from r362121 Reviewers: pete, lhames, JDevlieghere Reviewed By: pete Subscribers: smeenai, aprantl, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62694 llvm-svn: 362141
* Reverting change r362121 due to lld-x86_64-ubuntu-fast test failuresMichael Trent2019-05-301-57/+6
| | | | llvm-svn: 362123
* Support Universal dSYM files in llvm-objdumpMichael Trent2019-05-301-6/+57
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Commonly programmers use llvm-objdump to disassemble Mach-O target binaries with Mach-O dSYMS. While llvm-objdump allows programmers to disassemble Universal binaries, it previously did not recognize Universal dSYM files. This change updates llvm-objdump to support passing in Universal files via the -dsym option. Now, when disassembling a Mach-O file either as a stand alone file or as an entry in a Universal binariy, llvm-objdump will search through a Universal dSYM for a Mach-O matching the architecture flag of the file being disassembled. Reviewers: pete, lhames Reviewed By: pete Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62642 llvm-svn: 362121
* [llvm-readobj] - An attemp to fix BB.George Rimar2019-05-301-2/+2
| | | | | | | | | | | | | BB failed: http://lab.llvm.org:8011/builders/clang-armv7-linux-build-cache/builds/15062/steps/build%20stage%201/logs/stdio Error was: /home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/tools/llvm-readobj/ELFDumper.cpp:3540:7: error: non-constant-expression cannot be narrowed from type 'llvm::support::detail::packed_endian_specific_integral<unsigned long long, llvm::support::endianness::little, 1>::value_type' (aka 'unsigned long long') to 'size_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing] StrTabSec->sh_size}; llvm-svn: 362084
* [llvm-readobj/llvm-readelf] - Implement GNU style dumper of the ↵George Rimar2019-05-301-13/+44
| | | | | | | | | | | SHT_GNU_verdef section. It was not implemented yet, we had only LLVM style dumper implemented. Section description is here: https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/symversion.html Differential revision: https://reviews.llvm.org/D62520 llvm-svn: 362082
* [llvm-readobj/llvm-readelf] - Implement GNU style dumper of the ↵George Rimar2019-05-301-12/+76
| | | | | | | | | | | SHT_GNU_verneed section. It was not implemented yet, we had only LLVM style dumper implemented. Section description is here: https://refspecs.linuxfoundation.org/LSB_2.0.1/LSB-Core/LSB-Core/symverrqmts.html Differential revision: https://reviews.llvm.org/D62516 llvm-svn: 362080
* [llvm-objcopy] Remove %p format specifiersEugene Leviant2019-05-301-2/+2
| | | | | | | On 32-bit machines %p expects 32 bit values, however addresses in llvm-objcopy are always 64 bits. llvm-svn: 362074
* [llvm-objcopy][MachO] Print an error message on use of unsupported optionsSeiya Nuta2019-05-291-1/+37
| | | | | | | | | | | | | | | | | | | Summary: It is better to print an error message instead of silently ignoring unsupported options. As mentioned in https://reviews.llvm.org/D57045, this is not the best solution and we should print which flag is not supported at some time. Reviewers: alexshap, rupprecht, jhenderson, jakehehrlich Reviewed By: alexshap, rupprecht, jakehehrlich Subscribers: jakehehrlich, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62578 llvm-svn: 362040
* [llvm-pdbutil] Dump inline call site line table annotationsReid Kleckner2019-05-291-5/+77
| | | | | | | | | This ports and improves on some existing llvm-readobj -codeview dumping functionality that llvm-pdbutil lacked. Helpful for comparing inline line tables between MSVC and clang. llvm-svn: 362037
* Attempt to fix buildbot after r361949Eugene Leviant2019-05-291-1/+1
| | | | llvm-svn: 361954
* [llvm-objcopy] Implement IHEX writerEugene Leviant2019-05-294-20/+432
| | | | | | Differential revision: https://reviews.llvm.org/D60270 llvm-svn: 361949
* [llvm-readelf] - Allow dumping of the .dynamic section even if there is no ↵George Rimar2019-05-291-78/+83
| | | | | | | | | | | | | PT_DYNAMIC header. It is now possible after D61937 was landed and was discussed in it's review comments. It is not consistent with GNU, which does not output .dynamic section content in this case for no visible reason. Differential revision: https://reviews.llvm.org/D62179 llvm-svn: 361943
* [llvm-readobj] -u: don't crash when dumping SHT_ARM_EXIDX if .symtab doesn't ↵Fangrui Song2019-05-291-3/+7
| | | | | | | | | | exist Reviewed By: kongyi Differential Revision: https://reviews.llvm.org/D62567 llvm-svn: 361929
* [tools] Introduce llvm-lipoAlexander Shaposhnikov2019-05-284-0/+231
| | | | | | | | | | | This diff starts the implementation of llvm-lipo which is supposed to be a drop-in replacement for the well-known tool lipo. Test plan: make check-all Differential revision: https://reviews.llvm.org/D61927 llvm-svn: 361896
* Change ELF tools to allow multiple sections per file.Peter Collingbourne2019-05-281-24/+19
| | | | | | | | | This is how multi-partition combined output files are going to look. If we see multiple sections, the tools will just read the first one. Differential Revision: https://reviews.llvm.org/D62349 llvm-svn: 361869
* [XCOFF] Implement parsing symbol table for xcoffobjfile and output as yaml ↵Jason Liu2019-05-282-3/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | format Summary: This patch implement parsing symbol table for xcoffobjfile and output as yaml format. Parsing auxiliary entries of a symbol will be in a separate patch. The XCOFF object file (aix_xcoff.o) used in the test comes from -bash-4.2$ cat test.c extern int i; extern int TestforXcoff; int main() { i++; TestforXcoff--; } Patch by DiggerLin Reviewers: sfertile, hubert.reinterpretcast, MaskRay, daltenty Differential Revision: https://reviews.llvm.org/D61532 llvm-svn: 361832
* Cleanups for r361807 that I somehow failed to commitHans Wennborg2019-05-281-4/+5
| | | | llvm-svn: 361812
* Fix some llvm-readelf tests after r361633Hans Wennborg2019-05-281-6/+7
| | | | | | | | They were failing on 32-bit Windows. In the cases where I've changed test expectations, I've checked that they match the output of GNU readelf. llvm-svn: 361807
* Make llvm-as --help great againSerge Guelton2019-05-271-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to https://reviews.llvm.org/D60411, but for llvm-as. New output: OVERVIEW: llvm .ll -> .bc assembler USAGE: llvm-as [options] <input .llvm file> OPTIONS: Generic Options: -help - Display available options (-help-hidden for more) -help-list - Display list of available options (-help-list-hidden for more) -version - Display the version of this program llvm-as Options: -data-layout=<layout-string> - data layout string to use -disable-output - Disable output -f - Enable binary output on terminals -module-hash - Emit module hash -o=<filename> - Override output filename Differential Revision: https://reviews.llvm.org/D60603 llvm-svn: 361750
* [dwarfdump] Add flag to limit the number of parents DIEsJonas Devlieghere2019-05-242-17/+25
| | | | | | | | | This adds `-parent-recurse-depth` which limits the number of parent DIEs being dumped. Differential revision: https://reviews.llvm.org/D62359 llvm-svn: 361671
* [llvm-objcopy] - Strip undefined symbols if they are no longer referenced ↵George Rimar2019-05-241-1/+7
| | | | | | | | | | | | | following --only-section This is https://bugs.llvm.org/show_bug.cgi?id=40004. In this patch I teach llvm-objcopy to remove undefined symbols if them are not used anymore after applying -j/--only-section option. Differential revision: https://reviews.llvm.org/D62317 llvm-svn: 361642
* [MCA] Zero-initialize field CRD in InstructionBase. Also run clang-format on ↵Andrea Di Biagio2019-05-241-6/+7
| | | | | | a couple of files. NFC llvm-svn: 361637
* [llvm-readobj] Implement GNU-style output for dynamic tableSimon Atanasyan2019-05-241-40/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | GNU readelf tool prints slightly different dynamic table "header" and surrounds dynamic tag names by brackets. This patch implements the same formatting for GNU-style output of the `llvm-readobj`. LLVM ``` DynamicSection [ (13 entries) Tag Type Name/Value 0x00000006 SYMTAB 0x168 ... ] ``` GNU ``` Dynamic section at offset 0x1d0 contains 13 entries: Tag Type Name/Value 0x00000006 (SYMTAB) 0x168 ... ``` Differential Revision: https://reviews.llvm.org/D62256 llvm-svn: 361633
* Revert r361630 "[llvm-readelf] - Allow dumping of the .dynamic section even ↵George Rimar2019-05-241-9/+9
| | | | | | | | | if there is no PT_DYNAMIC header." It broke BB: http://lab.llvm.org:8011/builders/ppc64le-lld-multistage-test/builds/3748 llvm-svn: 361631
* [llvm-readelf] - Allow dumping of the .dynamic section even if there is no ↵George Rimar2019-05-241-9/+9
| | | | | | | | | | | | | PT_DYNAMIC header. It is now possible after D61937 was landed and was discussed in it's review comments. It is not consistent with GNU, which does not output .dynamic section content in this case for no visible reason. Differential revision: https://reviews.llvm.org/D62179 llvm-svn: 361630
* [llvm-readobj][mips] Align GOT columns headers properly in 64-bit caseSimon Atanasyan2019-05-241-3/+13
| | | | llvm-svn: 361626
* [llvm-nm] Fix Bug 41353 - unique symbols printed as D instead of uJordan Rupprecht2019-05-241-3/+9
| | | | | | | | | | | | | | | | | | | | | Summary: https://bugs.llvm.org/show_bug.cgi?id=41353 I'm new to LLVM and C++ so please do not hesitate to iterate with me on this fix. Patch by Mike Pozulp! Reviewers: rupprecht, zbrid, grimar, jhenderson Reviewed By: rupprecht, jhenderson Subscribers: jhenderson, chrisjackson, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61117 llvm-svn: 361595
* Fix BUILD_SHARED_LIBS builds after r361567Daniel Sanders2019-05-247-0/+12
| | | | | | Also fixed a comment I noticed while debugging this build llvm-svn: 361591
* llvm-objcopy: Change sectionWithinSegment() to use virtual addresses instead ↵Peter Collingbourne2019-05-241-0/+14
| | | | | | | | | | | | of file offsets for SHT_NOBITS sections. Without this, sectionWithinSegment() will return the wrong answer for bss sections. This doesn't seem to matter now (for non-broken ELF files), but it will matter with a change that I'm working on. Differential Revision: https://reviews.llvm.org/D58426 llvm-svn: 361578
* Break false dependencies on target librariesDaniel Sanders2019-05-2313-13/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For the most part this consists of replacing ${LLVM_TARGETS_TO_BUILD} with some combination of AllTargets* so that they depend on specific components of a target backend rather than all of it. The overall effect of this is that, for example, tools like opt no longer falsely depend on the disassembler, while tools like llvm-ar no longer depend on the code generator. There's a couple quirks to point out here: * AllTargetsCodeGens is a bit more prevalent than expected. Tools like dsymutil seem to need it which I was surprised by. * llvm-xray linked to all the backends but doesn't seem to need any of them. It builds and passes the tests so that seems to be correct. * I left gold out as it's not built when binutils is not available so I'm unable to test it Reviewers: bogner, JDevlieghere Reviewed By: bogner Subscribers: mehdi_amini, mgorny, steven_wu, dexonsmith, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62331 llvm-svn: 361567
* [Object] object::ELFObjectFile::symbol_begin(): skip symbol index 0Fangrui Song2019-05-231-5/+0
| | | | | | | | | | | | | For clients iterating the symbol table, none expects to handle index 0 (STN_UNDEF). Skip it to improve consistency with other binary formats. Clients that need STN_UNDEF (e.g. lld) can use getSectionContentsAsArray(). A test will be added in D62148. Reviewed By: mtrent Differential Revision: https://reviews.llvm.org/D62296 llvm-svn: 361506
* [llvm-objcopy] - Many minor NFC changes to cleanup/improve the code in ↵George Rimar2019-05-231-106/+85
| | | | | | | | | | | | | | | | ELF/Object.cpp. The code in ELF/Object.cpp is sometimes a bit hard to read because of lots of auto used everywhere. The main intention of this patch is to replace them with the real type for places where it is not obvious. Also it cleanups few places. It is NFC change, but I want to be sure that there is no objections to do that since it is massive. DIfferential revision: https://reviews.llvm.org/D62260 llvm-svn: 361466
* [llvm-objcopy] Add file names to error messagesSeiya Nuta2019-05-231-15/+27
| | | | | | | | | | | | | | | | | | | Summary: This patch adds the file names to llvm-objcopy error messages. It makes easy to identify which file causes an error. Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=41798 Reviewers: espindola, alexshap, rupprecht, jhenderson, jakehehrlich Reviewed By: rupprecht, jhenderson, jakehehrlich Subscribers: emaste, arichardson, jakehehrlich, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61993 llvm-svn: 361450
* [llvm-objdump] Dump inline relocations if the relocated section is specified ↵Fangrui Song2019-05-221-17/+17
| | | | | | | | | | | | | | with --section This fixes PR41886: llvm-objdump -d -r -j .text doesn't show inline relocations of .text While here, switch to stable_sort() because we don't want to change the order of relocations applied to the same location. gABI says consecutive relocation records are composed together and their order matters. In practise it is difficult to see relocations applied to the same location not consecutive, we just have to keep the relative order of relocations with the same offset. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D62253 llvm-svn: 361395
* [llvm-exegesis] Move native target initialization code to a separate file.Clement Courbet2019-05-222-7/+42
| | | | | | | | | | | | | | Summary: This helps building internal tools on top of the library. Reviewers: gchatelet Subscribers: tschuett, llvm-commits, bdb, ondrasej Tags: #llvm Differential Revision: https://reviews.llvm.org/D62239 llvm-svn: 361385
* [llvm-objcopy] Tidy up error messagesJames Henderson2019-05-226-107/+107
| | | | | | | | | | | | | | This patch brings various error messages into line with each other, by removing trailing full stops, and making the first letter lower-case. This addresses https://bugs.llvm.org/show_bug.cgi?id=40859. Reviewed by: jhenderson, rupprecht, jakehehrlich Differential Revision: https://reviews.llvm.org/D62072 Patch by Alex Brachet llvm-svn: 361384
* Properly categorize llvm-objdump optionsSerge Guelton2019-05-222-71/+127
| | | | | | | | Filters out noise, and distinguish Mach-O related options from others. Differential Revision: https://reviews.llvm.org/D62195 llvm-svn: 361351
* [ORC] Guarantee unique JITDylib names in lli, add usage notes to createJITDylib.Lang Hames2019-05-211-2/+4
| | | | | | | | | | | JITDylibs should have unique names. This patch adds code to lli to respect this invariant (by refering to the exist JITDylib if a -jd <name> option is specified more than once). It also adds usage notes to the doxygen comment for createJITDylib method in ExecutionSession and LLJIT. http://llvm.org/PR41937 llvm-svn: 361322
* [Bugpoint] fix use-after-move. NFCNick Desaulniers2019-05-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No. 6". Note that author also states: "Note that the loop doesn't actually execute at all." This is not true, but the author can be forgiven; there's two distinct variables with very similar identifiers: MiscompiledFunctions MisCompFunctions Reviewers: echristo, srhines, RKSimon Reviewed By: RKSimon Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62113 llvm-svn: 361279
* [Dsymutil] Remove redundant argument (NFC)Jonas Devlieghere2019-05-213-7/+5
| | | | | | | The dwarf streamer already holds a copy of the link options, so there's no need to pass them as an argument. llvm-svn: 361276
* [llvm-objdump] Make --disassemble-functions imply -dGeorge Rimar2019-05-211-1/+2
| | | | | | | | | | Fixes https://bugs.llvm.org/show_bug.cgi?id=41903 Patch by Mike Pozulp! Differential revision: https://reviews.llvm.org/D62054 llvm-svn: 361240
* [llvm-objcopy] Strip file symbols with --strip-unneededEugene Leviant2019-05-211-1/+1
| | | | | | Differential revision: https://reviews.llvm.org/D61641 llvm-svn: 361231
* [Support] Renamed member 'Size' to 'AllocatedSize' in MemoryBlock and ↵Lang Hames2019-05-201-3/+4
| | | | | | | | | | | | | | | OwningMemoryBlock. Rename member 'Size' to 'AllocatedSize' in order to provide a hint that the allocated size may be different than the requested size. Comments are added to clarify this point. Updated the InMemoryBuffer in FileOutputBuffer.cpp to track the requested buffer size. Patch by Machiel van Hooren. Thanks Machiel! https://reviews.llvm.org/D61599 llvm-svn: 361195
* [llvm-readelf] - Rework how we parse the .dynamic section.George Rimar2019-05-203-15/+71
| | | | | | | | | | | | | This is a result of what I found during my work on https://bugs.llvm.org/show_bug.cgi?id=41679. Previously LLVM readelf took the information about .dynamic section from its PT_DYNAMIC segment only. GNU tools have a bit different logic. They also use the information from the .dynamic section header if it is available. This patch changes the code to improve the compatibility with the GNU Binutils. Differential revision: https://reviews.llvm.org/D61937 llvm-svn: 361165
* Update llvm-nm -s to use a multi-var optionMichael Trent2019-05-181-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously llvm-nm relied on a positional parameter to read two values into the SegSect list. This worked, but required the "-s" paramater and its arguments to be the last elements on the command-line. The CommandLine library now supports mutli-var parameters, so it can naturally deal with "-s" expecting two arguments, and now the input file can appear anywhere (within reason) in the command line invocation. E.g. llvm-nm -s __TEXT __text /bin/ls llvm-nm /bin/ls -s __TEXT __text rdar://27284011 Reviewers: lhames, pete Reviewed By: pete Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62070 llvm-svn: 361091
* [ELF] Implement Dependent Libraries FeatureBen Dunbobbin2019-05-173-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements a limited form of autolinking primarily designed to allow either the --dependent-library compiler option, or "comment lib" pragmas ( https://docs.microsoft.com/en-us/cpp/preprocessor/comment-c-cpp?view=vs-2017) in C/C++ e.g. #pragma comment(lib, "foo"), to cause an ELF linker to automatically add the specified library to the link when processing the input file generated by the compiler. Currently this extension is unique to LLVM and LLD. However, care has been taken to design this feature so that it could be supported by other ELF linkers. The design goals were to provide: - A simple linking model for developers to reason about. - The ability to to override autolinking from the linker command line. - Source code compatibility, where possible, with "comment lib" pragmas in other environments (MSVC in particular). Dependent library support is implemented differently for ELF platforms than on the other platforms. Primarily this difference is that on ELF we pass the dependent library specifiers directly to the linker without manipulating them. This is in contrast to other platforms where they are mapped to a specific linker option by the compiler. This difference is a result of the greater variety of ELF linkers and the fact that ELF linkers tend to handle libraries in a more complicated fashion than on other platforms. This forces us to defer handling the specifiers to the linker. In order to achieve a level of source code compatibility with other platforms we have restricted this feature to work with libraries that meet the following "reasonable" requirements: 1. There are no competing defined symbols in a given set of libraries, or if they exist, the program owner doesn't care which is linked to their program. 2. There may be circular dependencies between libraries. The binary representation is a mergeable string section (SHF_MERGE, SHF_STRINGS), called .deplibs, with custom type SHT_LLVM_DEPENDENT_LIBRARIES (0x6fff4c04). The compiler forms this section by concatenating the arguments of the "comment lib" pragmas and --dependent-library options in the order they are encountered. Partial (-r, -Ur) links are handled by concatenating .deplibs sections with the normal mergeable string section rules. As an example, #pragma comment(lib, "foo") would result in: .section ".deplibs","MS",@llvm_dependent_libraries,1 .asciz "foo" For LTO, equivalent information to the contents of a the .deplibs section can be retrieved by the LLD for bitcode input files. LLD processes the dependent library specifiers in the following way: 1. Dependent libraries which are found from the specifiers in .deplibs sections of relocatable object files are added when the linker decides to include that file (which could itself be in a library) in the link. Dependent libraries behave as if they were appended to the command line after all other options. As a consequence the set of dependent libraries are searched last to resolve symbols. 2. It is an error if a file cannot be found for a given specifier. 3. Any command line options in effect at the end of the command line parsing apply to the dependent libraries, e.g. --whole-archive. 4. The linker tries to add a library or relocatable object file from each of the strings in a .deplibs section by; first, handling the string as if it was specified on the command line; second, by looking for the string in each of the library search paths in turn; third, by looking for a lib<string>.a or lib<string>.so (depending on the current mode of the linker) in each of the library search paths. 5. A new command line option --no-dependent-libraries tells LLD to ignore the dependent libraries. Rationale for the above points: 1. Adding the dependent libraries last makes the process simple to understand from a developers perspective. All linkers are able to implement this scheme. 2. Error-ing for libraries that are not found seems like better behavior than failing the link during symbol resolution. 3. It seems useful for the user to be able to apply command line options which will affect all of the dependent libraries. There is a potential problem of surprise for developers, who might not realize that these options would apply to these "invisible" input files; however, despite the potential for surprise, this is easy for developers to reason about and gives developers the control that they may require. 4. This algorithm takes into account all of the different ways that ELF linkers find input files. The different search methods are tried by the linker in most obvious to least obvious order. 5. I considered adding finer grained control over which dependent libraries were ignored (e.g. MSVC has /nodefaultlib:<library>); however, I concluded that this is not necessary: if finer control is required developers can fall back to using the command line directly. RFC thread: http://lists.llvm.org/pipermail/llvm-dev/2019-March/131004.html. Differential Revision: https://reviews.llvm.org/D60274 llvm-svn: 360984
OpenPOWER on IntegriCloud