summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Simplify. NFC.Rafael Espindola2015-07-061-3/+1
| | | | llvm-svn: 241456
* Check that COFF .obj files have sections with zero virtual address spaces.Rafael Espindola2015-07-061-1/+6
| | | | | | | | | | | | | When talking about the virtual address of sections the coff spec says: ... for simplicity, compilers should set this to zero. Otherwise, it is an arbitrary value that is subtracted from offsets during relocation. We don't currently subtract it, so check that it is zero. If some producer does create such files, we can change getRelocationOffset instead. llvm-svn: 241447
* [RuntimeDyld] Skip relocations for external symbols with 64-bit address ~0ULL.Lang Hames2015-07-041-13/+59
| | | | | | | | | | | Requested by Eugene Rozenfeld of the LLILC team, this feature allows JIT clients to skip relocations for selected external symbols by returning ~0ULL from their symbol resolver. If this value is returned for a given symbol, RuntimeDyld will skip all relocations for that symbol. The client will be responsible for applying the skipped relocations manually before the code is executed. llvm-svn: 241383
* [ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj toolsSimon Atanasyan2015-07-032-0/+26
| | | | | | | | | | SHT_NOBITS sections do not have content in an object file. Now the yaml2obj tool does not accept `Content` field for such sections, and the obj2yaml tool does not attempt to read the section content from a file. Restore r241350 and r241352. llvm-svn: 241377
* Fix build with -DLLVM_USE_INTEL_JITEVENTS=ON -DLLVM_USE_OPROFILE=ON.Rafael Espindola2015-07-031-1/+1
| | | | | | Is anyone using those? llvm-svn: 241372
* Return ErrorOr from getSymbolAddress.Rafael Espindola2015-07-038-27/+44
| | | | | | | It can fail trying to get the section on ELF and COFF. This makes sure the error is handled. llvm-svn: 241366
* Replace a few more MachO only uses of getSymbolAddress.Rafael Espindola2015-07-032-9/+6
| | | | llvm-svn: 241365
* Use getValue instead of getAddress in a few MachO only cases.Rafael Espindola2015-07-031-23/+9
| | | | | | | In MachO the value of the symbol is always the address, so we can use the simpler function. llvm-svn: 241364
* This reverts commit r241350 and r241352.Rafael Espindola2015-07-032-22/+0
| | | | | | | | | | | r241350 broke lld tests. r241352 depends on r241350. Original messages: "[ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj tools" "[ELFYAML] Make the Size field for .bss section optional" llvm-svn: 241354
* [ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj toolsSimon Atanasyan2015-07-032-0/+22
| | | | | | | | SHT_NOBITS sections do not have content in an object file. Now yaml2obj tool does not accept `Content` field for such sections, and obj2yaml tool does not attempt to read the section content from a file. llvm-svn: 241350
* Return ErrorOr from SymbolRef::getName.Rafael Espindola2015-07-0215-114/+176
| | | | | | | | | | | | This function can really fail since the string table offset can be out of bounds. Using ErrorOr makes sure the error is checked. Hopefully a lot of the boilerplate code in tools/* can go away once we have a diagnostic manager in Object. llvm-svn: 241297
* [Support] Lazy load of dbghlp.dll on WindowsLeny Kholodov2015-07-021-0/+1
| | | | | | | | | | | | | This patch changes linkage with dbghlp.dll for clang from static (at load time) to on demand (at the first use of required functions). Clang uses dbghlp.dll only in minor use-cases. First of all in case of crash and in case of plugin load. The dbghlp.dll library can be absent on system. In this case clang will fail to load. With lazy load of dbghlp.dll clang can work even if dbghlp.dll is not available. Differential Revision: http://reviews.llvm.org/D10737 llvm-svn: 241271
* Expose getRel and getRela to reduce code duplication.Rafael Espindola2015-07-021-19/+10
| | | | llvm-svn: 241266
* Return ErrorOr from getSection.Rafael Espindola2015-07-014-40/+75
| | | | | | | | | | | | | | This also improves the logic of what is an error: * getSection(uint_32): only return an error if the index is out of bounds. The index 0 corresponds to a perfectly valid entry. * getSection(Elf_Sym): Returns null for symbols that normally don't have sections and error for out of bound indexes. In many places this just moves the report_fatal_error up the stack, but those can then be fixed in smaller patches. llvm-svn: 241156
* Remove Elf_Shdr_Iter. Diagnose files with invalid section header sizes.Rafael Espindola2015-06-301-1/+0
| | | | llvm-svn: 241109
* Use range loops. NFC.Rafael Espindola2015-06-301-30/+24
| | | | llvm-svn: 241105
* Use range loop.Rafael Espindola2015-06-301-8/+6
| | | | llvm-svn: 241104
* Use range loop.Rafael Espindola2015-06-301-5/+4
| | | | llvm-svn: 241100
* Fix the name of the iterator functions to match the coding standards.Rafael Espindola2015-06-304-28/+27
| | | | llvm-svn: 241074
* Don't return error_code from a function that doesn't fail.Rafael Espindola2015-06-303-7/+4
| | | | llvm-svn: 241042
* Move function to the only file that uses it.Rafael Espindola2015-06-301-2/+35
| | | | llvm-svn: 241040
* Don't return error_code from a function that doesn't fail.Rafael Espindola2015-06-301-5/+2
| | | | llvm-svn: 241039
* Don't return error_code from a function that doesn't fail.Rafael Espindola2015-06-301-3/+1
| | | | llvm-svn: 241033
* llvm-bcanalyzer: Add a field that was missed in r241016.Adrian Prantl2015-06-301-0/+1
| | | | llvm-svn: 241026
* Don't return error_code from function that never fails.Rafael Espindola2015-06-299-52/+24
| | | | llvm-svn: 241021
* lto: Clean up C libLTO interfaces pertaining to linker flags.Peter Collingbourne2015-06-292-19/+2
| | | | | | | | | Specifically, remove the dependent library interface and replace the existing linker option interface with a new one that returns a single list of flags. Differential Revision: http://reviews.llvm.org/D10820 llvm-svn: 241018
* bcanalyzer: Rewrite all the METADATA_ codesDuncan P. N. Exon Smith2015-06-291-9/+31
| | | | | | | | Add all the new `Metadata` codes since LLVM 3.6, and at the same time follow the precedent set in other blocks by removing the `METADATA_` prefix from the string output. llvm-svn: 241016
* bcanalyzer: Use a macro to decode bitcodes, NFCDuncan P. N. Exon Smith2015-06-291-86/+85
| | | | | | | I'm about to add a whack of missing names for metadata. Add a macro to make this easier. llvm-svn: 241015
* Teach LTOModule to emit linker flags for dllexported symbols, plus interface ↵Peter Collingbourne2015-06-291-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cleanup. This change unifies how LTOModule and the backend obtain linker flags for globals: via a new TargetLoweringObjectFile member function named emitLinkerFlagsForGlobal. A new function LTOModule::getLinkerOpts() returns the list of linker flags as a single concatenated string. This change affects the C libLTO API: the function lto_module_get_*deplibs now exposes an empty list, and lto_module_get_*linkeropts exposes a single element which combines the contents of all observed flags. libLTO should never have tried to parse the linker flags; it is the linker's job to do so. Because linkers will need to be able to parse flags in regular object files, it makes little sense for libLTO to have a redundant mechanism for doing so. The new API is compatible with the old one. It is valid for a user to specify multiple linker flags in a single pragma directive like this: #pragma comment(linker, "/defaultlib:foo /defaultlib:bar") The previous implementation would not have exposed either flag via lto_module_get_*deplibs (as the test in TargetLoweringObjectFileCOFF::getDepLibFromLinkerOpt was case sensitive) and would have exposed "/defaultlib:foo /defaultlib:bar" as a single flag via lto_module_get_*linkeropts. This may have been a bug in the implementation, but it does give us a chance to fix the interface. Differential Revision: http://reviews.llvm.org/D10548 llvm-svn: 241010
* Convert obj->getSymbolName to sym->getName.Rafael Espindola2015-06-293-5/+4
| | | | | | I doesn't depend on the object anymore. llvm-svn: 240996
* Factor out the checking of string tables.Rafael Espindola2015-06-293-5/+20
| | | | | | | | | | This moves the error checking for string tables to getStringTable which returns an ErrorOr<StringRef>. This improves error checking, makes it uniform across all string tables and makes it possible to check them once instead of once per name. llvm-svn: 240950
* Remove Elf_Sym_Iter.Rafael Espindola2015-06-294-51/+53
| | | | | | | | | | | | | | | | | | | It was a fairly broken concept for an ELF only class. An ELF file can have two symbol tables, but they have exactly the same format. There is no concept of a dynamic or a static symbol. Storing this on the iterator also makes us do more work per symbol than necessary. To fetch a name we would: * Find if we had a static or a dynamic symbol. * Look at the corresponding symbol table and find the string table section. * Look at the string table section to fetch its contents. * Compute the name as a substring of the string table. All but the last step can be done per symbol table instead of per symbol. This is a step in that direction. llvm-svn: 240939
* [StackMaps] Add a lightweight parser for stackmap version 1 sections.Lang Hames2015-06-266-1/+178
| | | | | | | | | | The parser provides a convenient interface for reading llvm stackmap v1 sections in object files. This patch also includes a new option for llvm-readobj, '-stackmap', which uses the parser to pretty-print stackmap sections for debugging/testing purposes. llvm-svn: 240860
* AMDGPU/SI: Set ELF OS/ABI to ELFOSABI_AMDGPU_HSATom Stellard2015-06-261-1/+7
| | | | | | | | | | Reviewers: arsenm, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10708 llvm-svn: 240832
* Silencing spurious MSVC C4189 warnings regarding local variables that are ↵Aaron Ballman2015-06-261-4/+4
| | | | | | initialized but not used; NFC. This bug has been reported to Microsoft (https://connect.microsoft.com/VisualStudio/feedback/details/1475983). llvm-svn: 240786
* Rename getObjectFile to getObject for consistency.Rafael Espindola2015-06-262-4/+4
| | | | llvm-svn: 240785
* Simplify isSymbolList64Bit. NFC.Rafael Espindola2015-06-261-9/+1
| | | | llvm-svn: 240784
* Simplify isObject. NFC.Rafael Espindola2015-06-261-19/+5
| | | | llvm-svn: 240783
* Implement elf_section_iterator and getELFType().Rafael Espindola2015-06-261-21/+10
| | | | | | And with those, simplify getSymbolNMTypeChar. llvm-svn: 240780
* Simplify getSymbolType.Rafael Espindola2015-06-266-31/+13
| | | | | | | | This is still a really odd function. Most calls are in object format specific contexts and should probably be replaced with a more direct query, but at least now this is not too obnoxious to use. llvm-svn: 240777
* AsmPrinter: Use an intrusively linked list for DIE::ChildrenDuncan P. N. Exon Smith2015-06-251-6/+6
| | | | | | | | | | | | | | Replace the `std::vector<>` for `DIE::Children` with an intrusively linked list. This is a strict memory improvement: it requires no auxiliary storage, and reduces `sizeof(DIE)` by one pointer. It also factors out the DIE-related malloc traffic. This drops llc memory usage from 735 MB down to 718 MB, or ~2.3%. (I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`; see r236629 for details.) llvm-svn: 240736
* AsmPrinter: Convert DIE::Values to a linked listDuncan P. N. Exon Smith2015-06-251-36/+28
| | | | | | | | | | | | | | | | Change `DIE::Values` to a singly linked list, where each node is allocated on a `BumpPtrAllocator`. In order to support `push_back()`, the list is circular, and points at the tail element instead of the head. I abstracted the core list logic out to `IntrusiveBackList` so that it can be reused for `DIE::Children`, which also cares about `push_back()`. This drops llc memory usage from 799 MB down to 735 MB, about 8%. (I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`; see r236629 for details.) llvm-svn: 240733
* Make llvm-dwarfdump exit with non-zero exit code if error was occured.Alexey Samsonov2015-06-251-8/+13
| | | | llvm-svn: 240729
* Add an ELFSymbolRef type.Rafael Espindola2015-06-252-4/+4
| | | | | | | This allows user code to say Sym.getSize() instead of having to manually fetch the object. llvm-svn: 240708
* [Object][ELF] Add support for dumping dynamic relocations when sections are ↵Michael J. Spencer2015-06-253-3/+44
| | | | | | stripped. llvm-svn: 240703
* dsymutil: Split out patchStmtList(), NFCDuncan P. N. Exon Smith2015-06-251-12/+13
| | | | | | | | | | | | | | | | Split out code to patch up the `DW_AT_stmt_list` for the cloned DIE, and reorganize it so that it doesn't depend on `DIE::values_begin()` and `DIE::values_end()` (which I'm trying to kill off). David Blaikie and I talked about adding a range-algorithm version of `std::find_if()`, but the assertion *still* required getting at the end iterator. IMO, a separate helper function with an early return is easier to reason about here. A follow-up commit that removes `DIE::setValue()` and mutates the `DIEValue` directly is coming shortly. llvm-svn: 240701
* We don't need the targets to read objects.Rafael Espindola2015-06-252-4/+0
| | | | llvm-svn: 240684
* llvm-nm: print 'n' instead of '?'Rafael Espindola2015-06-251-1/+1
| | | | | | This matches gnu nm and has the advantage that there is a upper case N. llvm-svn: 240655
* Use computeSymbolSizes in llvm-symbolize.Rafael Espindola2015-06-252-21/+8
| | | | llvm-svn: 240646
* Use range loop. NFC.Rafael Espindola2015-06-251-20/+18
| | | | llvm-svn: 240645
OpenPOWER on IntegriCloud