summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't use InMemoryStruct in getSymbol64TableEntry.Rafael Espindola2013-04-061-24/+19
| | | | llvm-svn: 178946
* Don't use InMemoryStruct in getSymbolTableEntry.Rafael Espindola2013-04-061-23/+19
| | | | llvm-svn: 178945
* Don't use InMemoryStruct in getRelocation.Rafael Espindola2013-04-061-31/+21
| | | | llvm-svn: 178943
* Define versions of Section that are explicitly marked as little endian.Rafael Espindola2013-04-051-34/+34
| | | | | | These should really be templated like ELF, but this is a start. llvm-svn: 178896
* Don't use InMemoryStruct in getSection and getSection64.Rafael Espindola2013-04-051-86/+51
| | | | llvm-svn: 178894
* Don't fetch pointers from a InMemoryStruct.Rafael Espindola2013-04-051-9/+18
| | | | | | | | InMemoryStruct is extremely dangerous as it returns data from an internal buffer when the endiannes doesn't match. This should fix the tests on big endian hosts. llvm-svn: 178875
* Move an assert earlier in a file and check that the result ofEric Christopher2013-02-281-2/+5
| | | | | | | | our bitwise compare is equal to the field we're looking for. Noticed on inspection. llvm-svn: 176296
* Add static cast to unsigned char whenever a character classification ↵Guy Benyei2013-02-122-2/+2
| | | | | | function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration. llvm-svn: 175006
* [Object][Archive] Improve performance.Michael J. Spencer2013-02-031-98/+10
| | | | | | | | | | | | Improve performance of iterating over children and accessing the member file buffer by caching the file size and moving code out to the header. This also makes getBuffer return a StringRef instead of a MemoryBuffer. Both fixing a memory leak and removing a malloc. This takes getBuffer from ~10% of the time in lld to unmeasurable. llvm-svn: 174272
* [Support] Add LLVM_IS_UNALIGNED_ACCESS_FAST.Michael J. Spencer2013-02-031-4/+16
| | | | llvm-svn: 174271
* Object: Fix errant fallthrough.Jim Grosbach2013-01-311-0/+1
| | | | llvm-svn: 174079
* When encountering an unknown file format, ObjectFile::createObjectFile shouldEli Bendersky2013-01-251-1/+3
| | | | | | | | | politely report it instead of running into llvm_unreachable. Also patch llvm-dwarfdump to actually check whether the file it's attempting to dump is a valid object file. llvm-svn: 173489
* [MC/Mach-O] Add support for linker options in Mach-O files.Daniel Dunbar2013-01-181-0/+11
| | | | llvm-svn: 172779
* [Object][ELF] Simplify ELFObjectFile by using ELFType.Michael J. Spencer2013-01-151-8/+8
| | | | | | | | | | | | | This simplifies the usage and implementation of ELFObjectFile by using ELFType to replace: <endianness target_endianness, std::size_t max_alignment, bool is64Bits> This does complicate the base ELF types as they must now use template template parameters to partially specialize for the 32 and 64bit cases. However these are only defined once. llvm-svn: 172515
* Fix More CastsDavid Greene2013-01-141-1/+2
| | | | | | Fix another cast-away-const cast. llvm-svn: 172466
* [Object][Archive] Fix name handling with bsd style long names.Michael J. Spencer2013-01-101-8/+14
| | | | llvm-svn: 172026
* [Object][Archive] Apparently StringRef::getAsInteger for APInt accepts spaces.Michael J. Spencer2013-01-101-2/+6
| | | | llvm-svn: 172022
* [Object][Archive] Use uint64_t instead of APInt. It is significantly faster.Michael J. Spencer2013-01-091-10/+10
| | | | llvm-svn: 172015
* [Object][ELF] Add a maximum alignment. This is used by createELFObjectFile ↵Michael J. Spencer2013-01-041-6/+28
| | | | | | to create a properly aligned reader. llvm-svn: 171520
* Add a function to get the segment name of a section.Rafael Espindola2012-12-211-14/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On MachO, sections also have segment names. When a tool looking at a .o file prints a segment name, this is what they mean. In reality, a .o has only one anonymous, segment. This patch adds a MachO only function to fetch that segment name. I named it getSectionFinalSegmentName since the main use for the name seems to be inform the linker with segment this section should go to. The patch also changes MachOObjectFile::getSectionName to return just the section name instead of computing SegmentName,SectionName. The main difference from the previous patch is that it doesn't use InMemoryStruct. It is extremely dangerous: if the endians match it returns a pointer to the file buffer, if not, it returns a pointer to an internal buffer that is overwritten in the next API call. We should change all of this code to use support::detail::packed_endian_specific_integral like ELF, but since these functions only handle strings, they work with big and little endian machines as is. I have tested this by installing ubuntu 12.10 ppc on qemu, that is why it took so long :-) llvm-svn: 170838
* Revert 170545 while I debug the ppc failures.Rafael Espindola2012-12-191-25/+10
| | | | llvm-svn: 170547
* Add r170095 back.Rafael Espindola2012-12-191-10/+25
| | | | | | | | | | | | | | | | | | | | | | | I cannot reproduce it the failures locally, so I will keep an eye at the ppc bots. This patch does add the change to the "Disassembly of section" message, but that is not what was failing on the bots. Original message: Add a funciton to get the segment name of a section. On MachO, sections also have segment names. When a tool looking at a .o file prints a segment name, this is what they mean. In reality, a .o has only one anonymous, segment. This patch adds a MachO only function to fetch that segment name. I named it getSectionFinalSegmentName since the main use for the name seems to be infor the linker with segment this section should go to. The patch also changes MachOObjectFile::getSectionName to return just the section name instead of computing SegmentName,SectionName. llvm-svn: 170545
* Teach MachO which sections contain codeTim Northover2012-12-171-2/+2
| | | | llvm-svn: 170349
* Revert "Add a funciton to get the segment name of a section."Eric Christopher2012-12-131-25/+10
| | | | | | This reverts commit r170095 since it appears to be breaking the bots. llvm-svn: 170105
* Add a funciton to get the segment name of a section.Rafael Espindola2012-12-131-10/+25
| | | | | | | | | | | | | | | On MachO, sections also have segment names. When a tool looking at a .o file prints a segment name, this is what they mean. In reality, a .o has only one, anonymous, segment. This patch adds a MachO only function to fetch that segment name. I named it getSectionFinalSegmentName since the main use for the name seems to be informing the linker with segment this section should go to. The patch also changes MachOObjectFile::getSectionName to return just the section name instead of computing SegmentName,SectionName. llvm-svn: 170095
* Remove some dead code.Rafael Espindola2012-12-121-8/+0
| | | | llvm-svn: 169963
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-033-5/+4
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Object: Pass the buffer name through when making a copy.Benjamin Kramer2012-11-291-1/+2
| | | | | | Should bring the buildbots back to life. llvm-svn: 168935
* Fix a memory leak in MachOObjectFile.Jim Grosbach2012-11-291-8/+15
| | | | | | | | | | | | | MachOObjectFile owns a MachOObj, but never frees it. Both MachOObjectFile and MachOObj want to own the MemoryBuffer, though, so we have to be careful and give them each one of their own. Thanks to Greg Clayton, Eric Christopher and Michael Spencer for helping figure out what's going wrong here. rdar://12561773 llvm-svn: 168923
* s/assert/llvm_unreachable/Matt Beaumont-Gay2012-11-141-3/+4
| | | | llvm-svn: 167936
* Fix broken asserts. Also, spell 'indices' correctly.Matt Beaumont-Gay2012-11-141-6/+6
| | | | llvm-svn: 167894
* [Object] Fix endianess bug by refactoring Archive::Symbol::getMember.Michael J. Spencer2012-11-141-18/+32
| | | | llvm-svn: 167893
* Adding changes to support GNU style archive library readingShankar Easwaran2012-11-131-26/+118
| | | | llvm-svn: 167853
* Add interface for querying object files for symbol values.Tim Northover2012-10-292-0/+9
| | | | | | | | Currently only implemented for ELF. Patch by Amara Emerson. llvm-svn: 166918
* Cosmetic changesAndrew Kaylor2012-10-102-4/+4
| | | | llvm-svn: 165588
* This patch adds new functions to the SectionRef and ObjectFile interfaces to ↵Andrew Kaylor2012-10-102-0/+18
| | | | | | | | determine whether or not a section is meant to be read-only. These functions will be used by the MCJIT RuntimeDyld to give hints to the memory manager during the object loading process in a future patch. Patch by Ashok Thirumurthi. llvm-svn: 165586
* Reverting r 160419.Galina Kistanova2012-07-191-2/+1
| | | | llvm-svn: 160525
* Fixed few warnings.Galina Kistanova2012-07-181-1/+2
| | | | llvm-svn: 160419
* Added accessors for getting coff_relocation infoMarshall Clow2012-06-181-0/+5
| | | | llvm-svn: 158675
* Had a closing brace inside an #ifdef -- oops!Marshall Clow2012-06-151-1/+1
| | | | llvm-svn: 158485
* Adding acessors to COFFObjectFile so that clients can get at the ↵Marshall Clow2012-06-151-0/+31
| | | | | | (non-generic) bits llvm-svn: 158484
* Convert comments to proper Doxygen comments.Dmitri Gribenko2012-06-091-1/+1
| | | | llvm-svn: 158248
* Mark some static arrays as const.Craig Topper2012-05-242-6/+6
| | | | llvm-svn: 157377
* Refactor data-in-code annotations.Jim Grosbach2012-05-181-0/+13
| | | | | | | | | | | | | | | | | | | | | | Use a dedicated MachO load command to annotate data-in-code regions. This is the same format the linker produces for final executable images, allowing consistency of representation and use of introspection tools for both object and executable files. Data-in-code regions are annotated via ".data_region"/".end_data_region" directive pairs, with an optional region type. data_region_directive := ".data_region" { region_type } region_type := "jt8" | "jt16" | "jt32" | "jta32" end_data_region_directive := ".end_data_region" The previous handling of ARM-style "$d.*" labels was broken and has been removed. Specifically, it didn't handle ARM vs. Thumb mode when marking the end of the section. rdar://11459456 llvm-svn: 157062
* Fix the implementation of MachOObjectFile::isSectionZeroInit so it follows ↵Eli Friedman2012-05-021-4/+6
| | | | | | the MachO spec. llvm-svn: 155976
* Implement GDB integration for source level debugging of code JITed usingPreston Gurd2012-04-161-10/+0
| | | | | | | | | | | | | | | the MCJIT execution engine. The GDB JIT debugging integration support works by registering a loaded object image with a pre-defined function that GDB will monitor if GDB is attached. GDB integration support is implemented for ELF only at this time. This integration requires GDB version 7.0 or newer. Patch by Andy Kaylor! llvm-svn: 154868
* Remove unused variable.Benjamin Kramer2012-04-131-3/+0
| | | | llvm-svn: 154661
* This patch improves the MCJIT runtime dynamic loader by adding new handlingPreston Gurd2012-04-122-4/+72
| | | | | | | | | | of zero-initialized sections, virtual sections and common symbols and preventing the loading of sections which are not required for execution such as debug information. Patch by Andy Kaylor! llvm-svn: 154610
* Add a constructor for DataRefImpl and remove excess initialization.Danil Malyshev2012-04-102-16/+0
| | | | llvm-svn: 154371
* Object: drop bogus VMCore dependencyDylan Noblesmith2012-04-031-1/+1
| | | | llvm-svn: 153956
OpenPOWER on IntegriCloud