Bruno Cardoso Lopes
a7fc820079
Remove hack used to strip unwanted chars from section name
...
Use MCSectionELF methods as much as possible, removing some
ELFWriter methods which are now unused
llvm-svn: 78940
2009-08-13 21:25:27 +00:00
Bruno Cardoso Lopes
5347f22cb1
Move ConstantExpr handling to ResolveConstantExpr method and also
...
add support for PtrToInt, Add, Mul.
llvm-svn: 78552
2009-08-10 03:32:40 +00:00
Bruno Cardoso Lopes
9e93ee1c78
ELF improvements:
...
Handle large integers, x86_fp80, ConstantAggregateZero, and two more ConstantExpr:
GetElementPtr and IntToPtr
Set SHF_MERGE bit for mergeable strings
Avoid zero initialized strings to be classified as a bss symbol
Don't allow common symbols to be classified as STB_WEAK
Add a constant to be used as a global value offset in data relocations
llvm-svn: 78476
2009-08-08 17:29:04 +00:00
Bruno Cardoso Lopes
2ae97a2777
- Remove custom handling of jumptables by the elf writter (this was
...
a dirty hack and isn't need anymore since the last x86 code emitter patch)
- Add a target-dependent modifier to addend calculation
- Use R_X86_64_32S relocation for X86::reloc_absolute_word_sext
- Use getELFSectionFlags whenever possible
- fix getTextSection to use TLOF and emit the right text section
- Handle global emission for static ctors, dtors and Type::PointerTyID
- Some minor fixes
llvm-svn: 78176
2009-08-05 06:57:03 +00:00
Chris Lattner
c156a00641
refactor section construction in TLOF to be through an explicit
...
initialize method, which can be called when an MCContext is available.
llvm-svn: 77687
2009-07-31 17:42:42 +00:00
Bruno Cardoso Lopes
f6ea9fb8c2
add module identifier to the elf object file
...
llvm-svn: 77238
2009-07-27 19:32:57 +00:00
Bruno Cardoso Lopes
a536302ed5
Handle external symbols for ELF and add some static methods to ELFSym
...
llvm-svn: 77232
2009-07-27 18:54:47 +00:00
Chris Lattner
a2b00bdd7a
Eliminate SectionFlags, just embed a SectionKind into Section
...
instead and drive things based off of that.
llvm-svn: 77184
2009-07-27 05:32:16 +00:00
Bruno Cardoso Lopes
2015382398
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
b47b093de2
For PC relative relocations where symbols are defined in the same section they
...
are referenced, ignore the relocation entry and patch the relocatable field with
the computed symbol offset directly
llvm-svn: 76414
2009-07-20 08:52:02 +00:00
Bruno Cardoso Lopes
84568ea6f1
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
d5eafae1fd
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
c69e9d53bb
Fix coding style issues pointed by Bill.
...
llvm-svn: 75898
2009-07-16 06:26:41 +00:00
Bruno Cardoso Lopes
7bdb20f6a2
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
Bruno Cardoso Lopes
046ddf7ca0
Cleanup the global emission and refactor some code
...
llvm-svn: 75537
2009-07-13 22:40:39 +00:00
Daniel Dunbar
cf2cfb50d3
Match declaration to definition.
...
llvm-svn: 75454
2009-07-13 06:00:13 +00:00
Bruno Cardoso Lopes
f03970cf37
Changed ELFCodeEmitter to inherit from ObjectCodeEmitter
...
llvm-svn: 74821
2009-07-06 09:26:48 +00:00
Bruno Cardoso Lopes
0dc4fd3fcc
Factor some code out and support for Jump Table relocations
...
llvm-svn: 74760
2009-07-03 04:36:26 +00:00
Bruno Cardoso Lopes
810ef07890
shrinking down #includes
...
llvm-svn: 74718
2009-07-02 18:29:24 +00:00
Bruno Cardoso Lopes
5e0be0b9a1
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
bd023b8ebe
Use a default alignment for data and bss sections.
...
Only pad when the section size > 0 and move the code that deals
with globals initializers to a place we know for sure the global
is initialized.
llvm-svn: 73944
2009-06-23 04:39:27 +00:00
Bruno Cardoso Lopes
4615b9cdf9
Use different functions to emit the string and symbol tables.
...
llvm-svn: 73895
2009-06-22 19:29:56 +00:00
Bruno Cardoso Lopes
7b196ba30e
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
d73d79eaf9
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
9b68e8653f
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
cfa07266cf
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
b3b24681ca
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
23b9f95d35
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
Owen Anderson
2c1d54952b
Use raw_ostream throughout the AsmPrinter.
...
llvm-svn: 55092
2008-08-21 00:14:44 +00:00
Dan Gohman
a363ba510c
Don't include <map> in Pass.h, which doesn't need it. This requires
...
adding <map> to many files that actually do need it.
llvm-svn: 48667
2008-03-21 23:51:57 +00:00
Chris Lattner
ad9a6ccb83
Remove attribution from file headers, per discussion on llvmdev.
...
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Gabor Greif
5f705671e4
Here is the bulk of the sanitizing.
...
Almost all occurrences of "bytecode" in the sources have been eliminated.
llvm-svn: 37913
2007-07-05 17:07:56 +00:00
Devang Patel
cd45427a87
Drop 'const'
...
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Devang Patel
8ee9065162
Use 'static const char' instead of 'static const int'.
...
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.
llvm-svn: 36652
2007-05-02 21:39:20 +00:00
Devang Patel
38a66bc82e
Do not use typeinfo to identify pass in pass manager.
...
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Bill Wendling
48653bfaa4
Moved from include/llvm/CodeGen to lib/CodeGen.
...
llvm-svn: 34027
2007-02-08 01:30:50 +00:00