1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

146 Commits

Author SHA1 Message Date
David Meyer
c6de5a081b [Object]
Make Binary::TypeID more granular, to distinguish between ELF 32/64 little/big

llvm-svn: 152435
2012-03-09 20:41:57 +00:00
David Meyer
7f21ecb667 [Object]
Add ObjectFile::getLoadName() for retrieving the soname/installname of a shared object.

llvm-svn: 151845
2012-03-01 22:19:54 +00:00
David Meyer
44201a2d17 [Object]
* 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-03-01 01:36:50 +00:00
David Meyer
e9705e2949 [Object] Add symbol attribute flags: ST_ThreadLocal, ST_Common, and 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-29 02:11:55 +00:00
David Meyer
31e23de700 In the ObjectFile interface, replace isInternal(), isAbsolute(), isGlobal(), and isWeak(), with a bitset of flags.
llvm-svn: 151670
2012-02-28 23:47:53 +00:00
Michael J. Spencer
0aef1b9f18 [Object] Add {begin,end}_dynamic_symbols stubs and implementation for ELF.
Add -D option to llvm-nm to dump dynamic symbols.

Patch by David Meyer.

llvm-svn: 151600
2012-02-28 00:40:37 +00:00
Benjamin Kramer
4d0ae7cfef Remove static ctor.
llvm-svn: 151160
2012-02-22 13:42:11 +00:00
Eli Bendersky
ff2a79674c Expose the ELFObjectFile class directly in the Object/ELF.h header, similarly
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-12 06:12:10 +00:00
Dylan Noblesmith
2692a852bb Object: avoid undefined behavior when bounds-checking
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-02-04 02:41:39 +00:00
Matt Beaumont-Gay
b86c4c6d24 Sink assert-only variables into the asserts
llvm-svn: 148849
2012-01-24 19:43:30 +00:00
Matt Beaumont-Gay
ea859b30be Silence warnings in -asserts build
llvm-svn: 148715
2012-01-23 18:46:04 +00:00
Eli Bendersky
2545105c90 Remove trailing spaces
llvm-svn: 148654
2012-01-22 09:02:48 +00:00
Eli Bendersky
d2042f3698 Basic runtime dynamic loading capabilities added to ELFObjectFile, implemented
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
2012-01-22 09:01:03 +00:00
Rafael Espindola
b598485fb9 Remove unused variables.
llvm-svn: 147261
2011-12-25 01:20:19 +00:00
David Blaikie
576aba04f1 Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
llvm-svn: 146960
2011-12-20 02:50:00 +00:00
Daniel Dunbar
30d6a45140 LLVMBuild: Remove trailing newline, which irked me.
llvm-svn: 146409
2011-12-12 19:48:00 +00:00
Daniel Dunbar
4e00f5f8fd build/CMake: Finish removal of add_llvm_library_dependencies.
llvm-svn: 145420
2011-11-29 19:25:30 +00:00
Danil Malyshev
5ce4e1a9d3 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: 145408
2011-11-29 17:40:10 +00:00
Daniel Dunbar
64fe398fc0 Fix some possible gcc-4.2 may be used uninitialized warnings.
llvm-svn: 145292
2011-11-28 22:19:32 +00:00
Chandler Carruth
e5e455c97f Revert r145180 as it is causing test failures on all the bots.
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-27 10:37:47 +00:00
Danil Malyshev
3bbe062799 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: 145180
2011-11-27 10:12:52 +00:00
Michael J. Spencer
346238dcfc Object/COFF: Support common symbols.
llvm-svn: 144861
2011-11-16 23:36:12 +00:00
Daniel Dunbar
73d41b0f03 build: Attempt to rectify inconsistencies between CMake and LLVMBuild 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-12 02:10:57 +00:00
Michael J. Spencer
ca21136ca9 Object/COFF: Fix PE reading.
llvm-svn: 144148
2011-11-08 23:34:07 +00:00
Benjamin Kramer
a05d5433f5 MachOObject: Use DataExtractor's uleb parser instead of rolling our own.
llvm-svn: 143810
2011-11-05 12:13:21 +00:00
Benjamin Kramer
26ed5d6390 Simplify code.
llvm-svn: 143695
2011-11-04 13:52:17 +00:00
Daniel Dunbar
3760ebeebb build: Add initial cut at LLVMBuild.txt files.
llvm-svn: 143634
2011-11-03 18:53:17 +00:00
Chad Rosier
8a1a2adbb7 Removed unused variable.
llvm-svn: 143591
2011-11-02 23:21:55 +00:00
Michael J. Spencer
7dcaa63cb2 object/COFF: Properly initalize uses of DataRefImpl.
llvm-svn: 143562
2011-11-02 19:33:26 +00:00
Michael J. Spencer
c059c6c5b9 Object/Archive: Add symbol table iteration.
llvm-svn: 143561
2011-11-02 19:33:12 +00:00
Owen Anderson
6508cba44c If we're searching for a symbol reference to pretty-print a scattered relocation address, and we don't find a symbol table entry, try section begin addresses as well.
llvm-svn: 143151
2011-10-27 21:53:50 +00:00
Owen Anderson
9aaee13bf1 Fix pretty printing of i386 local sect diff relocations, TLV relocations, and x86_64 TLV relocations in MachO.
llvm-svn: 143140
2011-10-27 20:46:09 +00:00
Owen Anderson
997d323baa Expose relocation accessors through the libObject C API.
llvm-svn: 143109
2011-10-27 17:32:36 +00:00
Owen Anderson
ece66e91f2 Add relocation iterators to the libObject C API.
llvm-svn: 143107
2011-10-27 17:15:47 +00:00
Owen Anderson
11396b575d Add support for scattered relocations to the MachO relocatation pretty printer.
llvm-svn: 143051
2011-10-26 20:42:54 +00:00
Owen Anderson
8d9656dd53 The order of the two symbol listings in a Macho x86_64 subtractor relocation is reversed from what seems intuitive to me.
llvm-svn: 143035
2011-10-26 17:28:49 +00:00
Owen Anderson
27580bf1eb Include the full 64 bits of relocation data in the type info for MachO relocations, so that we can recognize scattered relocations.
llvm-svn: 143033
2011-10-26 17:10:22 +00:00
Owen Anderson
7a9bb4d47f Expand relocation type field to 64 bits. MachO scattered relocations require 33 bits of type info.
llvm-svn: 143032
2011-10-26 17:08:49 +00:00
Owen Anderson
fc7467fd5e Improve pretty printing of GOT relocations in MachO on x86_64.
llvm-svn: 143031
2011-10-26 17:05:20 +00:00
Eric Christopher
0042cece21 Remove unused variable.
llvm-svn: 143011
2011-10-26 03:47:16 +00:00
Michael J. Spencer
03ffc01ea6 Object/Archive: Cleanup anon namespace.
llvm-svn: 142983
2011-10-25 22:31:11 +00:00
Michael J. Spencer
6f6b8f7b4d Object/Archive: Add BSD style long file name support and skip internal members.
llvm-svn: 142981
2011-10-25 22:30:42 +00:00
Owen Anderson
b3538ebf33 Remove extraneous printing of "-PC".
llvm-svn: 142970
2011-10-25 20:44:00 +00:00
Owen Anderson
69d98376b9 Add support for the notion of "hidden" relocations. On MachO, these are 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-25 20:35:53 +00:00
Owen Anderson
60bbbbced1 Teach the MachO relocation pretty-printer to interpret ARM half-relocations.
llvm-svn: 142938
2011-10-25 18:48:41 +00:00
Owen Anderson
3bfe29265a More fixes and improvements to MachO relocation pretty-printing, particular for x86 and x86_64 relocations with addends.
llvm-svn: 142875
2011-10-24 23:20:07 +00:00
Owen Anderson
aa91e360eb Get relocation parsing/dumping to a mostly-working state for MachO files.
llvm-svn: 142852
2011-10-24 21:44:00 +00:00
Owen Anderson
445fdc6049 Stub out some of the MachO relocation decoding hooks.
llvm-svn: 142840
2011-10-24 20:19:18 +00:00
Owen Anderson
0d40d283e9 Use LLVMBool for a function that logically returns a boolean value.
llvm-svn: 142683
2011-10-21 20:35:58 +00:00
Owen Anderson
806a1e5c78 STABS symbols are debug symbols.
llvm-svn: 142673
2011-10-21 19:26:54 +00:00