aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object
AgeCommit message (Collapse)AuthorFilesLines
2012-11-29Object: Pass the buffer name through when making a copy.Benjamin Kramer1-1/+2
Should bring the buildbots back to life. llvm-svn: 168935
2012-11-29Fix a memory leak in MachOObjectFile.Jim Grosbach1-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
2012-11-14s/assert/llvm_unreachable/Matt Beaumont-Gay1-3/+4
llvm-svn: 167936
2012-11-14Fix broken asserts. Also, spell 'indices' correctly.Matt Beaumont-Gay1-6/+6
llvm-svn: 167894
2012-11-14[Object] Fix endianess bug by refactoring Archive::Symbol::getMember.Michael J. Spencer1-18/+32
llvm-svn: 167893
2012-11-13Adding changes to support GNU style archive library readingShankar Easwaran1-26/+118
llvm-svn: 167853
2012-10-29Add interface for querying object files for symbol values.Tim Northover2-0/+9
Currently only implemented for ELF. Patch by Amara Emerson. llvm-svn: 166918
2012-10-10Cosmetic changesAndrew Kaylor2-4/+4
llvm-svn: 165588
2012-10-10This patch adds new functions to the SectionRef and ObjectFile interfaces to ↵Andrew Kaylor2-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
2012-07-19Reverting r 160419.Galina Kistanova1-2/+1
llvm-svn: 160525
2012-07-18Fixed few warnings.Galina Kistanova1-1/+2
llvm-svn: 160419
2012-06-18Added accessors for getting coff_relocation infoMarshall Clow1-0/+5
llvm-svn: 158675
2012-06-15Had a closing brace inside an #ifdef -- oops!Marshall Clow1-1/+1
llvm-svn: 158485
2012-06-15Adding acessors to COFFObjectFile so that clients can get at the ↵Marshall Clow1-0/+31
(non-generic) bits llvm-svn: 158484
2012-06-09Convert comments to proper Doxygen comments.Dmitri Gribenko1-1/+1
llvm-svn: 158248
2012-05-24Mark some static arrays as const.Craig Topper2-6/+6
llvm-svn: 157377
2012-05-18Refactor data-in-code annotations.Jim Grosbach1-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
2012-05-02Fix the implementation of MachOObjectFile::isSectionZeroInit so it follows ↵Eli Friedman1-4/+6
the MachO spec. llvm-svn: 155976
2012-04-16Implement GDB integration for source level debugging of code JITed usingPreston Gurd1-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
2012-04-13Remove unused variable.Benjamin Kramer1-3/+0
llvm-svn: 154661
2012-04-12This patch improves the MCJIT runtime dynamic loader by adding new handlingPreston Gurd2-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
2012-04-10Add a constructor for DataRefImpl and remove excess initialization.Danil Malyshev2-16/+0
llvm-svn: 154371
2012-04-03Object: drop bogus VMCore dependencyDylan Noblesmith1-1/+1
llvm-svn: 153956
2012-03-19[Object/COFF]: Expose getSectionContents.Michael J. Spencer1-10/+19
llvm-svn: 153051
2012-03-19[Object/COFF]: Expose getSectionName.Michael J. Spencer1-19/+24
Also add some documentation. llvm-svn: 153050
2012-03-15Fix bug found by warning.Michael J. Spencer1-1/+2
llvm-svn: 152812
2012-03-09[Object]David Meyer3-3/+3
Make Binary::TypeID more granular, to distinguish between ELF 32/64 little/big llvm-svn: 152435
2012-03-01[Object]David Meyer2-0/+11
Add ObjectFile::getLoadName() for retrieving the soname/installname of a shared object. llvm-svn: 151845
2012-03-01[Object]David Meyer2-0/+41
* Add begin_dynamic_table() / end_dynamic_table() private interface to ELFObjectFile. * Add begin_libraries_needed() / end_libraries_needed() interface to ObjectFile, for grabbing the list of needed libraries for a shared object or dynamic executable. * Implement this new interface completely for ELF, leave stubs for COFF and MachO. * Add 'llvm-readobj' tool for dumping ObjectFile information. llvm-svn: 151785
2012-02-29[Object] Add symbol attribute flags: ST_ThreadLocal, ST_Common, and ↵David Meyer2-4/+13
ST_Undefined. Implement these completely for ELF. Rename ST_External to ST_Unknown, and slightly change its semantics. It now only indicates that the symbol's type is unknown, not that the symbol is undefined. (For that, use ST_Undefined). llvm-svn: 151696
2012-02-28In the ObjectFile interface, replace isInternal(), isAbsolute(), isGlobal(), ↵David Meyer2-65/+32
and isWeak(), with a bitset of flags. llvm-svn: 151670
2012-02-28[Object] Add {begin,end}_dynamic_symbols stubs and implementation for ELF.Michael J. Spencer2-0/+19
Add -D option to llvm-nm to dump dynamic symbols. Patch by David Meyer. llvm-svn: 151600
2012-02-22Remove static ctor.Benjamin Kramer1-2/+2
llvm-svn: 151160
2012-02-12Expose the ELFObjectFile class directly in the Object/ELF.h header, similarlyEli Bendersky1-1695/+25
to what's done for MachO and COFF. This allows advanced uses of the class to be implemented outside the Object library. In particular, the DyldELFObject subclass is now moved into its logical home - ExecutionEngine/RuntimeDyld. This patch was reviewed by Michael Spencer. llvm-svn: 150327
2012-02-04Object: avoid undefined behavior when bounds-checkingDylan Noblesmith1-8/+22
Don't form an out of bounds pointer just to test if it would be out of bounds. Also perform the same bounds checking for all the previous mapped structures. llvm-svn: 149750
2012-01-24Sink assert-only variables into the assertsMatt Beaumont-Gay1-16/+10
llvm-svn: 148849
2012-01-23Silence warnings in -asserts buildMatt Beaumont-Gay1-0/+6
llvm-svn: 148715
2012-01-22Remove trailing spacesEli Bendersky1-2/+2
llvm-svn: 148654
2012-01-22Basic runtime dynamic loading capabilities added to ELFObjectFile, implementedEli Bendersky1-19/+239
in a subclass named DyldELFObject. This class supports rebasing the object file it represents by re-mapping section addresses to the actual memory addresses the object was placed in. This is required for MC-JIT implementation on ELF with debugging support. Patch reviewed on llvm-commits. Developed together with Ashok Thirumurthi and Andrew Kaylor. llvm-svn: 148653
2011-12-25Remove unused variables.Rafael Espindola1-1/+1
llvm-svn: 147261
2011-12-20Unweaken vtables as per ↵David Blaikie2-0/+4
http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146960
2011-12-12LLVMBuild: Remove trailing newline, which irked me.Daniel Dunbar1-1/+0
llvm-svn: 146409
2011-11-29build/CMake: Finish removal of add_llvm_library_dependencies.Daniel Dunbar1-5/+0
llvm-svn: 145420
2011-11-29Fixed ObjectFile functions:Danil Malyshev4-32/+140
- getSymbolOffset() renamed as getSymbolFileOffset() - getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile. - added getRelocationOffset() - fixed MachOObjectFile::getSymbolSize() - fixed MachOObjectFile::getSymbolSection() - fixed MachOObjectFile::getSymbolOffset() for symbols without section data. llvm-svn: 145408
2011-11-28Fix some possible gcc-4.2 may be used uninitialized warnings.Daniel Dunbar1-2/+2
llvm-svn: 145292
2011-11-27Revert r145180 as it is causing test failures on all the bots.Chandler Carruth4-126/+32
Original commit message: Fixed ObjectFile functions: - getSymbolOffset() renamed as getSymbolFileOffset() - getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile. - added getRelocationOffset() - fixed MachOObjectFile::getSymbolSize() - fixed MachOObjectFile::getSymbolSection() - fixed MachOObjectFile::getSymbolOffset() for symbols without section data. llvm-svn: 145182
2011-11-27Fixed ObjectFile functions:Danil Malyshev4-32/+126
- getSymbolOffset() renamed as getSymbolFileOffset() - getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile. - added getRelocationOffset() - fixed MachOObjectFile::getSymbolSize() - fixed MachOObjectFile::getSymbolSection() - fixed MachOObjectFile::getSymbolOffset() for symbols without section data. llvm-svn: 145180
2011-11-16Object/COFF: Support common symbols.Michael J. Spencer1-1/+3
llvm-svn: 144861
2011-11-12build: Attempt to rectify inconsistencies between CMake and LLVMBuild ↵Daniel Dunbar1-1/+1
versions of explicit dependencies. - The hope is that we have a tool/test to verify these are accurate (and tight) soon. llvm-svn: 144444
2011-11-08Object/COFF: Fix PE reading.Michael J. Spencer1-23/+30
llvm-svn: 144148