summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object
Commit message (Collapse)AuthorAgeFilesLines
* Added forgotten noexcept.Abramo Bagnara2014-08-181-1/+1
| | | | llvm-svn: 215886
* llvm-objdump: don't print relocations in non-relocatable files.Rafael Espindola2014-08-172-0/+8
| | | | | | This matches the behavior of GNU objdump. llvm-svn: 215844
* Add a non-templated ELFObjectFileBase class.Rafael Espindola2014-08-171-0/+4
| | | | | | | Use it to implement some ELF only virtual interfaces instead of using error prone series of dyn_casts. llvm-svn: 215838
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-131-2/+2
| | | | | | | | | | Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
* AArch64: add support for dynamic-loader relocationsTim Northover2014-08-111-0/+11
| | | | | | | | | LLD needs them, and it's good to be able to print them properly when our object dumpers encounter them. Patch by Daniel Stewart. llvm-svn: 215352
* Delete dead code. NFC.Rafael Espindola2014-08-082-40/+0
| | | | llvm-svn: 215224
* getLoadName is only implemented for ELF, make it ELF only.Rafael Espindola2014-08-082-10/+0
| | | | llvm-svn: 215219
* Use a simpler predicate. NFC.Rafael Espindola2014-08-081-31/+19
| | | | llvm-svn: 215218
* pr20589: Fix duplicated arch flag.Rafael Espindola2014-08-081-1/+1
| | | | llvm-svn: 215216
* Add two missing ARM cpusubtypes to the switch statement in Kevin Enderby2014-08-071-0/+4
| | | | | | | | | MachOObjectFile::getArch(uint32_t CPUType, uint32_t CPUSubType) . Upcoming changes will cause existing test cases to use this but I wanted to check in this obvious change separately. llvm-svn: 215150
* A std::unique_ptr case I missed in the previous patch.Rafael Espindola2014-07-312-4/+6
| | | | llvm-svn: 214379
* Use std::unique_ptr to make the ownership explicit.Rafael Espindola2014-07-317-14/+19
| | | | llvm-svn: 214377
* AArch64: remove arm64 triple enumerator.Tim Northover2014-07-231-2/+1
| | | | | | | | | | | | Having both Triple::arm64 and Triple::aarch64 is extremely confusing, and invites bugs where only one is checked. In reality, the only legitimate difference between the two (arm64 usually means iOS) is also present in the OS part of the triple and that's what should be checked. We still parse the "arm64" triple, just canonicalise it to Triple::aarch64, so there aren't any LLVM-side test changes. llvm-svn: 213743
* Correct the ownership passing semantics of object::createBinary and make ↵David Blaikie2014-07-212-3/+3
| | | | | | | | | | | | | | | | them explicit in the type system. createBinary documented that it destroyed the parameter in error cases, though by observation it does not. By passing the unique_ptr by value rather than lvalue reference, callers are now explicit about passing ownership and the function implements the documented contract. Remove the explicit documentation, since now the behavior cannot be anything other than what was documented, so it's redundant. Also drops a unique_ptr::release in llvm-nm that was always run on a null unique_ptr anyway. llvm-svn: 213557
* Remove unnecessary use of unique_ptr::release() used to construct another ↵David Blaikie2014-07-211-2/+1
| | | | | | unique_ptr. llvm-svn: 213556
* Remove unused variable.David Blaikie2014-07-211-1/+0
| | | | llvm-svn: 213554
* Namespace cleanup (no functional change)Artyom Skrobov2014-07-201-11/+7
| | | | llvm-svn: 213478
* [PowerPC] 32-bit ELF PIC supportHal Finkel2014-07-181-0/+1
| | | | | | | | | | This adds initial support for PPC32 ELF PIC (Position Independent Code; the -fPIC variety), thus rectifying a long-standing deficiency in the PowerPC backend. Patch by Justin Hibbits! llvm-svn: 213427
* extracting swapStruct into include/llvm/Support/MachO.h (no functional change)Artyom Skrobov2014-07-181-208/+9
| | | | llvm-svn: 213361
* [RuntimeDyld] Revert r211652 - MachO object GDB registration support.Lang Hames2014-07-151-5/+1
| | | | | | | | The registration scheme used in r211652 violated the read-only contract of MemoryBuffer. This caused crashes in llvm-rtdyld where macho objects were backed by read-only mmap'd memory. llvm-svn: 213086
* Object/LLVMBuild.txt: Sort required_libraries by alphabetical order.NAKAMURA Takumi2014-07-141-1/+1
| | | | llvm-svn: 212917
* Add forgotten `break` statement.Simon Atanasyan2014-07-131-0/+1
| | | | llvm-svn: 212910
* [Mips] Support SHT_MIPS_ABIFLAGS section type flag in the llvm-readobj,Simon Atanasyan2014-07-131-0/+1
| | | | | | obj2yaml and yaml2obj tools. llvm-svn: 212908
* [ELFYAML] Group ELF section type flags to target specific blocks.Simon Atanasyan2014-07-121-9/+23
| | | | | | Recognize only flags which correspond to the current target. llvm-svn: 212880
* Add support for BSD format Archive map symbols (aka the table of contentsKevin Enderby2014-07-081-6/+63
| | | | | | from a __.SYMDEF or "__.SYMDEF SORTED" archive member). llvm-svn: 212568
* Update the MemoryBuffer API to use ErrorOr.Rafael Espindola2014-07-062-6/+8
| | | | llvm-svn: 212405
* This only needs a StringRef. No functionality change.Rafael Espindola2014-07-051-1/+2
| | | | llvm-svn: 212371
* Make RecordStreamer.h private.Rafael Espindola2014-07-043-3/+45
| | | | llvm-svn: 212361
* Ignore llvm.* globals.Rafael Espindola2014-07-041-6/+3
| | | | | | | It is not clear if llvm.global_ctors should or should not be in llvm.metadata, but in practice it is not and we need to ignore it for LTO. llvm-svn: 212351
* Implement LTOModule on top of IRObjectFile.Rafael Espindola2014-07-041-14/+12
| | | | | | | | | | | | | IRObjectFile provides all the logic for producing mangled names and getting symbols from inline assembly. LTOModule then adds logic for linking specific tasks, like constructing llvm.compiler_user or extracting linker options from the bitcode. The rule of the thumb is that IRObjectFile has the functionality that is needed by both LTO and llvm-ar. llvm-svn: 212349
* Mark intrinsic functions as llvm-specific.Rafael Espindola2014-07-041-0/+5
| | | | llvm-svn: 212347
* Don't include llvm.metadata variables in archive symbol tables.Rafael Espindola2014-07-041-0/+5
| | | | llvm-svn: 212344
* llvm-readobj: fix MachO relocatoin printing a bit.Tim Northover2014-07-041-0/+3
| | | | | | | | | | | | | | | | There were two issues here: 1. At the very least, scattered relocations cannot use the same code to determine the corresponding symbol being referred to. For some reason we pretend there is no symbol, even when one actually exists in the symtab, so to match this behaviour getRelocationSymbol should simply return symbols_end for scattered relocations. 2. Printing "-" when we can't get a symbol (including the scattered case, but not exclusively), isn't that helpful. In both cases there *is* interesting information in that field, so we should print it. As hex will do. Small part of rdar://problem/17553104 llvm-svn: 212332
* Move createIRObjectFile to the IRObjectFile class and return the concrete type.Rafael Espindola2014-07-031-1/+1
| | | | llvm-svn: 212301
* Add support for inline asm symbols to IRObjectFile.Rafael Espindola2014-07-034-22/+232
| | | | | | This also enables it in llvm-nm so that it can be tested. llvm-svn: 212282
* Invert the MC -> Object dependency.Rafael Espindola2014-07-034-120/+1
| | | | | | | | | Now that we have a lib/MC/MCAnalysis, the dependency was there just because of two helper classes. Move the two over to MC. This will allow IRObjectFile to parse inline assembly. llvm-svn: 212248
* Speculatively fix some code handling Power64 MachO filesReid Kleckner2014-06-301-1/+1
| | | | | | | MSVC was warning on a switch containing only default labels. In this instance, it looks like it uncovered a real bug. :) llvm-svn: 212062
* Add the -arch flag support to llvm-nm to select the slice out of a Mach-OKevin Enderby2014-06-301-0/+102
| | | | | | | | universal file. This also includes support for -arch all, selecting the host architecture by default from a universal file and checking if -arch is used with a standard Mach-O it matches that architecture. llvm-svn: 212054
* macho-dump: add code to print LC_ID_DYLIB load commands.Tim Northover2014-06-301-0/+6
| | | | | | I want to check them in lld. llvm-svn: 212043
* Revert "Introduce a string_ostream string builder facilty"Alp Toker2014-06-261-3/+4
| | | | | | Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814
* Introduce a string_ostream string builder faciltyAlp Toker2014-06-261-4/+3
| | | | | | | | | | | | | | | | | | | | string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. llvm-svn: 211749
* [RuntimeDyld] Adds the necessary hooks to MCJIT to be able to debug generatedLang Hames2014-06-251-1/+5
| | | | | | | | MachO files using the GDB JIT debugging interface. Patch by Keno Fischer. Thanks Keno! llvm-svn: 211652
* Replace two release calls with std::move. I missed this on the previous commit.Rafael Espindola2014-06-241-2/+2
| | | | llvm-svn: 211597
* Pass a unique_ptr<MemoryBuffer> to the constructors in the Binary hierarchy.Rafael Espindola2014-06-249-52/+58
| | | | | | | Once the objects are constructed, they own the buffer. Passing a unique_ptr makes that clear. llvm-svn: 211595
* Pass a std::unique_ptr& to the create??? methods is lib/Object.Rafael Espindola2014-06-238-35/+44
| | | | | | | | This makes the buffer ownership on error conditions very natural. The buffer is only moved out of the argument if an object is constructed that now owns the buffer. llvm-svn: 211546
* Make ObjectFile and BitcodeReader always own the MemoryBuffer.Rafael Espindola2014-06-238-97/+71
| | | | | | | | | | This allows us to just use a std::unique_ptr to store the pointer to the buffer. The flip side is that they have to support releasing the buffer back to the caller. Overall this looks like a more efficient and less brittle api. llvm-svn: 211542
* Convert a few methods to use ErrorOr.Rafael Espindola2014-06-231-10/+6
| | | | | | | It used to be inconvenient to mix ErrorOr and UniquePtr, but with c++11 they work OK together. llvm-svn: 211532
* Fix a warning about the use of const being ignored with a cast.Kevin Enderby2014-06-201-1/+1
| | | | llvm-svn: 211383
* Change the output of llvm-nm and llvm-size for Mach-O universal files (akaKevin Enderby2014-06-191-6/+2
| | | | | | | | | | fat files) to print “ (for architecture XYZ)” for fat files with more than one architecture to be like what the darwin tools do for fat files. Also clean up the Mach-O printing of archive membernames in llvm-nm to use the darwin form of "libx.a(foo.o)". llvm-svn: 211316
* Teach llvm-size to know about Mach-O universal files (aka fat files) andKevin Enderby2014-06-181-1/+1
| | | | | | | | | | fat files containing archives. Also fix a bug in MachOUniversalBinary::ObjectForArch::ObjectForArch() where it needed a >= when comparing the Index with the number of objects in a fat file. As the index starts at 0. llvm-svn: 211230
OpenPOWER on IntegriCloud