aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/MachOObjectFile.cpp
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-10-29Add interface for querying object files for symbol values.Tim Northover1-0/+4
Currently only implemented for ELF. Patch by Amara Emerson. llvm-svn: 166918
2012-10-10Cosmetic changesAndrew Kaylor1-3/+3
llvm-svn: 165588
2012-10-10This patch adds new functions to the SectionRef and ObjectFile interfaces to ↵Andrew Kaylor1-0/+11
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-05-24Mark some static arrays as const.Craig Topper1-4/+4
llvm-svn: 157377
2012-05-02Fix the implementation of MachOObjectFile::isSectionZeroInit so it follows ↵Eli Friedman1-4/+6
the MachO spec. llvm-svn: 155976
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 Gurd1-4/+51
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 Malyshev1-7/+0
llvm-svn: 154371
2012-03-09[Object]David Meyer1-1/+1
Make Binary::TypeID more granular, to distinguish between ELF 32/64 little/big llvm-svn: 152435
2012-03-01[Object]David Meyer1-0/+5
Add ObjectFile::getLoadName() for retrieving the soname/installname of a shared object. llvm-svn: 151845
2012-03-01[Object]David Meyer1-0/+21
* 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 Meyer1-2/+7
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 Meyer1-43/+17
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. Spencer1-0/+9
Add -D option to llvm-nm to dump dynamic symbols. Patch by David Meyer. llvm-svn: 151600
2011-11-29Fixed ObjectFile functions:Danil Malyshev1-11/+86
- 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-27Revert r145180 as it is causing test failures on all the bots.Chandler Carruth1-72/+11
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 Malyshev1-11/+72
- 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-10-27If we're searching for a symbol reference to pretty-print a scattered ↵Owen Anderson1-0/+18
relocation address, and we don't find a symbol table entry, try section begin addresses as well. llvm-svn: 143151
2011-10-27Fix pretty printing of i386 local sect diff relocations, TLV relocations, ↵Owen Anderson1-7/+50
and x86_64 TLV relocations in MachO. llvm-svn: 143140
2011-10-26Add support for scattered relocations to the MachO relocatation pretty printer.Owen Anderson1-86/+144
llvm-svn: 143051
2011-10-26The order of the two symbol listings in a Macho x86_64 subtractor relocation ↵Owen Anderson1-1/+3
is reversed from what seems intuitive to me. llvm-svn: 143035
2011-10-26Include the full 64 bits of relocation data in the type info for MachO ↵Owen Anderson1-1/+3
relocations, so that we can recognize scattered relocations. llvm-svn: 143033
2011-10-26Expand relocation type field to 64 bits. MachO scattered relocations ↵Owen Anderson1-1/+1
require 33 bits of type info. llvm-svn: 143032
2011-10-26Improve pretty printing of GOT relocations in MachO on x86_64.Owen Anderson1-0/+7
llvm-svn: 143031
2011-10-26Remove unused variable.Eric Christopher1-1/+0
llvm-svn: 143011
2011-10-25Remove extraneous printing of "-PC".Owen Anderson1-1/+0
llvm-svn: 142970
2011-10-25Add support for the notion of "hidden" relocations. On MachO, these are ↵Owen Anderson1-0/+32
relocation entries that are used as additional information for other, real relocations, rather than being relocations themselves. I'm not familiar enough with ELF or COFF to know if they should have any relocations marked hidden. llvm-svn: 142961
2011-10-25Teach the MachO relocation pretty-printer to interpret ARM half-relocations.Owen Anderson1-42/+104
llvm-svn: 142938
2011-10-24More fixes and improvements to MachO relocation pretty-printing, particular ↵Owen Anderson1-31/+127
for x86 and x86_64 relocations with addends. llvm-svn: 142875
2011-10-24Get relocation parsing/dumping to a mostly-working state for MachO files.Owen Anderson1-6/+127
llvm-svn: 142852
2011-10-24Stub out some of the MachO relocation decoding hooks.Owen Anderson1-0/+4
llvm-svn: 142840
2011-10-21STABS symbols are debug symbols.Owen Anderson1-1/+3
llvm-svn: 142673
2011-10-17Object: Add isSymbolAbsolute and getSymbolSection.Michael J. Spencer1-0/+37
llvm-svn: 142317
2011-10-17Object: Add isSymbolWeak.Michael J. Spencer1-0/+14
llvm-svn: 142316
2011-10-17Object: Fix redundant name.Michael J. Spencer1-2/+2
llvm-svn: 142238
2011-10-12The VMAs stored in the symbol table of a MachO file are absolute addresses, ↵Owen Anderson1-9/+9
not offsets from the section. llvm-svn: 141828
2011-10-12Don't label a STAB debugging symbol as a function symbol.Owen Anderson1-0/+5
llvm-svn: 141824
2011-10-12sectionContainsSymbol needs to be based on VMA's rather than section indices ↵Owen Anderson1-2/+17
to properly account for files with segment load commands that contain no sections. llvm-svn: 141822
2011-10-12Section indices in MachO symbol tables begin at 1, not 0.Owen Anderson1-1/+1
llvm-svn: 141815
2011-10-11Expose MachOObjectFile externally, like we do for COFF. First step in ↵Owen Anderson1-80/+3
reducing the amount of special-purpose code needed for llvm-objdump. llvm-svn: 141684
2011-10-10Fix warning.Michael J. Spencer1-2/+2
llvm-svn: 141597
2011-10-10Object: add getSectionAlignment.Michael J. Spencer1-0/+15
llvm-svn: 141581
2011-10-07Change relocation API to be per section. This time without breaking GCC.Michael J. Spencer1-33/+49
llvm-svn: 141385
2011-10-07Revert 141376 and 141377 due to breaking the build.Bill Wendling1-49/+33
--- Reverse-merging r141377 into '.': U tools/llvm-objdump/MachODump.cpp --- Reverse-merging r141376 into '.': U include/llvm/Object/COFF.h U include/llvm/Object/ObjectFile.h U include/llvm-c/Object.h U tools/llvm-objdump/llvm-objdump.cpp U lib/Object/MachOObjectFile.cpp U lib/Object/COFFObjectFile.cpp U lib/Object/Object.cpp U lib/Object/ELFObjectFile.cpp llvm-svn: 141379
2011-10-07Change relocation API to be per section.Michael J. Spencer1-33/+49
llvm-svn: 141376
2011-09-28Object: Add isSection{Data,BSS}.Michael J. Spencer1-0/+16
llvm-svn: 140721
2011-09-14Object: make the following changes into SymbolRefBenjamin Kramer1-1/+64
- Add enum SymbolType and function getSymbolType() - Add function isGlobal() - it's returns true for symbols that can be used in another objects, such as library functions. - Rename function getAddress() to getOffset() and add new function getAddress(), because currently getAddress() returns section offset of symbol first byte. new getAddress() return symbol address. - Change usage SymbolRef::getAddress() to getOffset() in tools/llvm-nm and tools/llvm-objdump. Patch by Danil Malyshev! llvm-svn: 139683
2011-09-09Remove dead code.Benjamin Kramer1-8/+0
llvm-svn: 139343