summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Strings.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge {COFF,ELF}/Strings.cpp to Common/Strings.cpp.Rui Ueyama2018-02-281-60/+0
| | | | | | | | | This should resolve the issue that lld build fails in some hosts that uses case-insensitive file system. Differential Revision: https://reviews.llvm.org/D43788 llvm-svn: 326339
* Consistent use of header file for ICF and MarkLiveSam Clegg2018-02-201-2/+0
| | | | | | | | | | Previously wasm used a separate header to declare markLive and ELF used to declare ICF. This change makes each backend consistently declare these in their own headers. Differential Revision: https://reviews.llvm.org/D43529 llvm-svn: 325631
* Factor out common code to Common/Strings.cpp.Rui Ueyama2017-11-281-18/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D40530 llvm-svn: 319138
* [lld] unified COFF and ELF error handling on new Common/ErrorHandlerBob Haarman2017-10-251-1/+1
| | | | | | | | | | | | | | | | | | | Summary: The COFF linker and the ELF linker have long had similar but separate Error.h and Error.cpp files to implement error handling. This change introduces new error handling code in Common/ErrorHandler.h, changes the COFF and ELF linkers to use it, and removes the old, separate implementations. Reviewers: ruiu Reviewed By: ruiu Subscribers: smeenai, jyknight, emaste, sdardis, nemanjai, nhaehnle, mgorny, javed.absar, kbarton, fedor.sergeev, llvm-commits Differential Revision: https://reviews.llvm.org/D39259 llvm-svn: 316624
* [ELF] - Update after LLVM r314883 change. NFC.George Rimar2017-10-041-10/+3
| | | | llvm-svn: 314884
* [ELF] Prevent crash with binary inputs with non-ascii file namesJames Henderson2017-09-071-1/+3
| | | | | | | | | | | | | | If using --format=binary with an input file name that has one or more non-ascii characters in, LLD has undefined behaviour (it crashes on my Windows Debug build) when calling isalnum with these non-ascii characters. Instead, of calling std::isalnum, this patch uses an internal version that ignores the locale and checks a specific subset of characters. Reviewers: ruiu Differential Revision: https://reviews.llvm.org/D37331 llvm-svn: 312705
* Move feature-specific functions out of Strings.cpp.Rui Ueyama2017-07-131-23/+0
| | | | | | | | Functions declared in Strings.h should provide generic string operations for the linker, but some of them are too specific to some features. This patch moves them to the location where they are used. llvm-svn: 307949
* [ELF] - Use llvm::to_integer() instead of StringRef::getAsInteger().George Rimar2017-05-161-2/+2
| | | | | | | | | | | Switch to llvm::to_integer() everywhere in LLD instead of StringRef::getAsInteger() because API of latter is confusing. It returns true on error and false otherwise what makes reading the code incomfortable. Differential revision: https://reviews.llvm.org/D33187 llvm-svn: 303149
* [ELF] __cxa_demangle is now called itaniumDemangle. Update.Davide Italiano2017-01-171-2/+2
| | | | llvm-svn: 292182
* Use ArrayRef instead of `const std::vector`.Rui Ueyama2016-12-201-1/+1
| | | | llvm-svn: 290213
* Move GlobPattern class from LLD to llvm/Support.Rui Ueyama2016-12-201-127/+7
| | | | | | | | | | GlobPattern is a class to handle glob pattern matching. Currently only LLD is using that, but technically that feature is not specific to linkers, so in this patch I move that file to LLVM. Differential Revision: https://reviews.llvm.org/D27969 llvm-svn: 290212
* Fix a bug that the glob pattern parser falls in an infinite loop for invalid ↵Rui Ueyama2016-12-201-0/+1
| | | | | | patterns. llvm-svn: 290160
* Remove unnecessary llvm/Config/config.h includesMichal Gorny2016-12-141-1/+0
| | | | | | | | | | | | | | | | | | Remove the includes of <llvm/Config/config.h> private LLVM header. The relevant files seem not to use any definitions from that file, and it is not available when building against installed LLVM. The use in lib/ReaderWriter/MachO/MachOLinkingContext.cpp originates from rL218718, and the use in ELF/Strings.cpp from rL274804 (where it was moved from Symbols.cpp). In both cases, they were added as a part of demangling support, and they provided HAVE_CXXABI_H. Since we are now using the LLVM demangler library instead, the code was removed and the includes and no longer necessary. Differential Revision: https://reviews.llvm.org/D27757 llvm-svn: 289707
* Make demangle() return None instead of "" if a given string is not a mangled ↵Rui Ueyama2016-12-071-3/+3
| | | | | | symbol. llvm-svn: 288993
* Introduce StringRefZ class to represent null-terminated strings.Rui Ueyama2016-11-291-0/+1
| | | | | | | | | | | | | | StringRefZ is a class to represent a null-terminated string. String length is computed lazily, so it's more efficient than StringRef to represent strings in string table. The motivation of defining this new class is to merge functions that only differ in string types; we have many constructors that takes `const char *` or `StringRef`. With StringRefZ, we can merge them. Differential Revision: https://reviews.llvm.org/D27037 llvm-svn: 288172
* Define toString(const SymbolBody &) and remove maybeDemangle instead.Rui Ueyama2016-11-241-6/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D27065 llvm-svn: 287899
* Add [<chars>] to the glob matcher to eliminate use of llvm::Regex.Rui Ueyama2016-11-031-51/+121
| | | | | | | | | | | | | Previously, it didn't support the character class, so we couldn't eliminate the use fo llvm::Regex. Now that it is supported, we can remove compileGlobPattern, which converts a glob pattern to a regex. This patch contains optimization for exact/prefix/suffix matches. Differential Revision: https://reviews.llvm.org/D26284 llvm-svn: 285949
* Use globMatch() instead of llvm::regex in linker scriptsEugene Leviant2016-11-031-0/+30
| | | | | | | | | This can speed up lld up to 5 times when linking applications with large number of sections and using linker script. Differential revision: https://reviews.llvm.org/D26241 llvm-svn: 285895
* Define a helper function to demangle symbols.Rui Ueyama2016-10-261-0/+7
| | | | llvm-svn: 285219
* [ELF] - Linkerscript: implemented SORT_BY_INIT_PRIORITY.George Rimar2016-09-151-0/+13
| | | | | | | | | | | This is PR30386, SORT_BY_INIT_PRIORITY is a keyword can be used to sort sections by numerical value of the GCC init_priority attribute encoded in the section name. Differential revision: https://reviews.llvm.org/D24611 llvm-svn: 281646
* Recommit [ELF] - Versionscript: do not treat non-wildcarded names as wildcards.George Rimar2016-09-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed code that was not checked before on windows for me, because of testcases that are disabled on that platform atm. Inital commit message: "[ELF] - Versionscript: do not treat non-wildcarded names as wildcards." Previously we incorrectly handled cases when symbol name in extern c++ tag was enclosed in quotes. Next case was treated as wildcard: GLIBCXX_3.4 { extern "C++" { "aaa*" } But it should have not. Quotes around aaa here means that we should have do exact name matching. That is PR30268 which has name with pointer is interpreted as wildcard by lld: extern "C++" { "operator delete[](void*)"; Patch fixes the issue. Differential revision: https://reviews.llvm.org/D24229 llvm-svn: 281049
* [ELF] - Fix for: PR29093 - version script does not support [chars] wildcardsGeorge Rimar2016-09-071-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | GNU ld supports [chars] wildcards in version scripts, to match a single instance of any of the chars. Here is an extern example from libstdc++'s version script in FreeBSD: extern "C++" { ... std::locale::_[T-Za-z]*; std::[A-Zm]*; std::n[^u]*; std::nu[^m]*; std::num[^e]*; ... } Patch adds support for scripts above. This is PR29093. Differential revision: https://reviews.llvm.org/D23803 llvm-svn: 280799
* Use the demangler in llvm.Rafael Espindola2016-09-061-10/+2
| | | | llvm-svn: 280733
* Update comments.Rui Ueyama2016-09-021-1/+2
| | | | llvm-svn: 280548
* [ELF] - Use std::regex instead of hand written logic in elf::globMatch()George Rimar2016-09-021-20/+29
| | | | | | | | | | Use std::regex instead of hand written matcher. Patch based on code and ideas of Rui Ueyama. Differential revision: https://reviews.llvm.org/D23829 llvm-svn: 280544
* Move demangle() from Symbols.cpp to Strings.cpp.Rui Ueyama2016-07-071-0/+28
| | | | | | | | | | | | Symbols.cpp contains functions to handle ELF symbols. demangle() function is essentially a function to work on a string rather than on an ELF symbol. So Strings.cpp is a better place to put that function. This change also make demangle to demangle symbols unconditionally. Previously, it demangled symbols only when Config->Demangle is true. llvm-svn: 274804
* Move isValidCIdentifier to Strings.cpp.Rui Ueyama2016-06-291-0/+13
| | | | llvm-svn: 274112
* Create Strings.cpp and move string manipulation functions to that file.Rui Ueyama2016-06-291-0/+57
llvm-svn: 274109
OpenPOWER on IntegriCloud