Commit Graph

21 Commits

Author SHA1 Message Date
Bruno Cardoso Lopes 40ca1f1c2e Change ELFCodeEmitter logic to emit the constant pool and jump tables to
their appropriate sections before the code itself. They need to be emitted
before the function because on some targets (x86 but not x86_64) the later
may reference a JT or CP entry address

llvm-svn: 76672
2009-07-21 23:13:26 +00:00
Bruno Cardoso Lopes 12e543228d Support adding relocations for data sections, handling the cases where
global declared symbols are initialized with references from other global
symbols.

llvm-svn: 76540
2009-07-21 06:51:32 +00:00
Bruno Cardoso Lopes 50bf9a60e5 Use R_X86_64_32S to handle Jump Table Index relocation entries. Hide TAI usage inside getSection* functions
llvm-svn: 76347
2009-07-18 23:24:01 +00:00
Bruno Cardoso Lopes e376b53c7b Use a better name for the label relocations while emitting them for Jump Tables
llvm-svn: 76334
2009-07-18 20:52:11 +00:00
Bruno Cardoso Lopes 484e90b45e Add support to properly reference private symbols on relocation entries.
Use proper relocation type to build relocations for JumpTables (rodata
sections).

llvm-svn: 76326
2009-07-18 19:30:09 +00:00
Bruno Cardoso Lopes 2717863900 use std::vector instead of std::list for both Section and Symbol lists because
we care more about random access than insertion/deletion of elements.

llvm-svn: 75828
2009-07-15 20:49:10 +00:00
Torok Edwin fbcc663cbf llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").

llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Bruno Cardoso Lopes ffb38f8d35 Cleanup the global emission and refactor some code
llvm-svn: 75537
2009-07-13 22:40:39 +00:00
Torok Edwin 56d0659726 assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.

llvm-svn: 75379
2009-07-11 20:10:48 +00:00
Bruno Cardoso Lopes f539f03289 Changed ELFCodeEmitter to inherit from ObjectCodeEmitter
llvm-svn: 74821
2009-07-06 09:26:48 +00:00
Bruno Cardoso Lopes 95dd8657ca Factor some code out and support for Jump Table relocations
llvm-svn: 74760
2009-07-03 04:36:26 +00:00
Bruno Cardoso Lopes 6dca2847d9 shrinking down #includes
llvm-svn: 74718
2009-07-02 18:29:24 +00:00
Bruno Cardoso Lopes eefbf1961c Remove getFunctionAlignment from TargetELFInfo and use new MachineFunction alignment method
llvm-svn: 74686
2009-07-02 02:13:13 +00:00
Bruno Cardoso Lopes e364a233c0 Support Constant Pool Sections
Add section symbols to the symbol table

llvm-svn: 74170
2009-06-25 07:36:24 +00:00
Bruno Cardoso Lopes a040566fec Add more methods to gather target specific elf stuff
Support for .text relocations, implementing TargetELFWriter overloaded methods for x86/x86_64.
Use a map to track global values to their symbol table indexes
Code cleanup and small fixes

llvm-svn: 73894
2009-06-22 19:16:16 +00:00
Bruno Cardoso Lopes 2f55027012 Introduce new BinaryObject (blob) class, ELF Writer modified to use it. BinaryObject.h by Aaron Gray
llvm-svn: 73333
2009-06-14 07:53:21 +00:00
Bruno Cardoso Lopes 1656366e4d Support for ELF Visibility
Emission for globals, using the correct data sections
Function alignment can be computed for each target using TargetELFWriterInfo
Some small fixes

llvm-svn: 73201
2009-06-11 19:16:03 +00:00
Bruno Cardoso Lopes e577492a17 Simple ELF32/64 binary files can now be emitted for x86 and x86_64 without
relocation sections.

llvm-svn: 73038
2009-06-07 21:22:38 +00:00
Bruno Cardoso Lopes 1596c3d9b2 Remove elf specific info from ELFWriter.h to Elf.h. Code cleanup and more comments added
llvm-svn: 72982
2009-06-06 03:56:29 +00:00
Bruno Cardoso Lopes 12ad90a7a6 ELF Code Emitter now uses CurBufferPtr, BufferBegin and BufferEnd, as do JIT and
MachO Writer. This will change with the arrival of ObjectCodeEmitter and
BinaryObject

llvm-svn: 72906
2009-06-05 00:22:10 +00:00
Bruno Cardoso Lopes d51db005d0 Move ELFCodeEmiter stuff to new files
llvm-svn: 72785
2009-06-03 17:47:27 +00:00