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

174 Commits

Author SHA1 Message Date
Rafael Espindola
a0cba71be8 Remove some dead code.
llvm-svn: 169963
2012-12-12 06:18:15 +00:00
Chandler Carruth
a490793037 Use the new script to sort the includes of every file under lib.
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
2012-12-03 16:50:05 +00:00
Benjamin Kramer
178c42a20b Object: Pass the buffer name through when making a copy.
Should bring the buildbots back to life.

llvm-svn: 168935
2012-11-29 20:08:03 +00:00
Jim Grosbach
f1c40fbc49 Fix a memory leak in MachOObjectFile.
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-29 19:14:11 +00:00
Matt Beaumont-Gay
2c3f2d564d s/assert/llvm_unreachable/
llvm-svn: 167936
2012-11-14 17:58:11 +00:00
Matt Beaumont-Gay
ddc09cb0a2 Fix broken asserts. Also, spell 'indices' correctly.
llvm-svn: 167894
2012-11-14 00:21:27 +00:00
Michael J. Spencer
3a44951466 [Object] Fix endianess bug by refactoring Archive::Symbol::getMember.
llvm-svn: 167893
2012-11-14 00:04:13 +00:00
Shankar Easwaran
f934185b04 Adding changes to support GNU style archive library reading
llvm-svn: 167853
2012-11-13 18:38:42 +00:00
Tim Northover
86db334e17 Add interface for querying object files for symbol values.
Currently only implemented for ELF.

Patch by Amara Emerson.

llvm-svn: 166918
2012-10-29 10:47:00 +00:00
Andrew Kaylor
2698e6d553 Cosmetic changes
llvm-svn: 165588
2012-10-10 01:45:52 +00:00
Andrew Kaylor
b850da774b This patch adds new functions to the SectionRef and ObjectFile interfaces to 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-10-10 01:41:33 +00:00
Galina Kistanova
93e0e20314 Reverting r 160419.
llvm-svn: 160525
2012-07-19 21:43:55 +00:00
Galina Kistanova
df72b5f7b6 Fixed few warnings.
llvm-svn: 160419
2012-07-18 04:06:49 +00:00
Marshall Clow
c56632d5e5 Added accessors for getting coff_relocation info
llvm-svn: 158675
2012-06-18 19:47:16 +00:00
Marshall Clow
0ee85444ac Had a closing brace inside an #ifdef -- oops!
llvm-svn: 158485
2012-06-15 01:15:47 +00:00
Marshall Clow
49e964c47f Adding acessors to COFFObjectFile so that clients can get at the (non-generic) bits
llvm-svn: 158484
2012-06-15 01:08:25 +00:00
Dmitri Gribenko
6319fd5eb8 Convert comments to proper Doxygen comments.
llvm-svn: 158248
2012-06-09 00:01:45 +00:00
Craig Topper
936702e142 Mark some static arrays as const.
llvm-svn: 157377
2012-05-24 06:35:32 +00:00
Jim Grosbach
343a996ca5 Refactor data-in-code annotations.
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-18 19:12:01 +00:00
Eli Friedman
101c4055c5 Fix the implementation of MachOObjectFile::isSectionZeroInit so it follows the MachO spec.
llvm-svn: 155976
2012-05-02 02:31:28 +00:00
Preston Gurd
e52a5ca15b Implement GDB integration for source level debugging of code JITed using
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-16 22:12:58 +00:00
Benjamin Kramer
9087b1f54a Remove unused variable.
llvm-svn: 154661
2012-04-13 08:09:12 +00:00
Preston Gurd
6e9bcca355 This patch improves the MCJIT runtime dynamic loader by adding new handling
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-12 20:13:57 +00:00
Danil Malyshev
6db4fe8581 Add a constructor for DataRefImpl and remove excess initialization.
llvm-svn: 154371
2012-04-10 01:54:44 +00:00
Dylan Noblesmith
2431e625b9 Object: drop bogus VMCore dependency
llvm-svn: 153956
2012-04-03 15:48:10 +00:00
Michael J. Spencer
e5d5ca4072 [Object/COFF]: Expose getSectionContents.
llvm-svn: 153051
2012-03-19 20:27:37 +00:00
Michael J. Spencer
2174510edf [Object/COFF]: Expose getSectionName.
Also add some documentation.

llvm-svn: 153050
2012-03-19 20:27:15 +00:00
Michael J. Spencer
bff63f6e96 Fix bug found by warning.
llvm-svn: 152812
2012-03-15 17:49:29 +00:00
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