summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/ELFObjectWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Micro optimization and improved similarity with gas' output:Rafael Espindola2011-04-071-10/+38
| | | | | | When two section names share a suffix, reuse the entry in shstrtab. llvm-svn: 129115
* Write the section table and the section data in the same order thatRafael Espindola2011-03-201-93/+196
| | | | | | | gun as does. This makes it a lot easier to compare the output of both as the addresses are now a lot closer. llvm-svn: 127972
* Split MCEELFStreamer and ELFObjectWriter into .h and .cpp files, so that ↵Jan Sjödin2011-03-031-363/+1
| | | | | | other components can use them. llvm-svn: 126942
* PR9352: Always emit a relocation for weak symbols. Not emitting relocationsEli Friedman2011-03-031-0/+19
| | | | | | | | for calls to weak symbols with a definition has the appearance of working with LLVM-generated code because weak symbol definitions are put in their own sections. llvm-svn: 126933
* Make all static functions become static class methods. Move shared ↵Jan Sjödin2011-02-281-89/+77
| | | | | | (duplicated) functions to new MCELF class. llvm-svn: 126686
* Put in the symbol table symbols only used in a .globl statement.Rafael Espindola2011-02-231-1/+5
| | | | | | Fixes PR9292. llvm-svn: 126330
* Handle FK_PCRel_1 and add a test case for this and FK_PCRel_4.Joerg Sonnenberger2011-02-211-0/+4
| | | | llvm-svn: 126157
* Gas is very inconsistent about when a relaxation/relocation is needed. DoRafael Espindola2011-02-161-25/+0
| | | | | | the right thing and stop trying to copy it. Fixes PR8944. llvm-svn: 125648
* Teach ARM/MC/ELF about gcc compatible reloc output to get past odd linkageJason W Kim2011-02-071-3/+45
| | | | | | | | | | | | | | | | | | failures with relocations. The code committed is a first cut at compatibility for emitted relocations in ELF .o. Why do this? because existing ARM tools like emitting relocs symbols as explicit relocations, not as section-offset relocs. Result is that with these changes, 1) relocs are now substantially identical what to gcc outputs. 2) larger apps (including many spec2k tests) compile, cross-link, and pass Added reminder fixme to tests for future conversion to .s form. llvm-svn: 124996
* Teach ARM/MC/ELF about EF_ARM_EABI_VERSION. The magic number is set toJason W Kim2011-02-041-2/+15
| | | | | | | 5 to match the current doc. Added FIXME reminder Make it really configurable later. llvm-svn: 124899
* Teach ARM/MC/ELF to handle R_ARM_JUMP24 relocation type for conditional jumps.Jason W Kim2011-02-041-4/+8
| | | | | | | | | | | | | | | | (yes, this is different from R_ARM_CALL) - Adds a new method getARMBranchTargetOpValue() which handles the necessary distinction between the conditional and unconditional br/bl needed for ARM/ELF At least for ARM mode, the needed fixup for conditional versus unconditional br/bl is identical, but the ARM docs and existing ARM tools expect this reloc type... Added a few FIXME's for future naming fixups in ARMInstrInfo.td llvm-svn: 124895
* Add support for the --noexecstack option.Rafael Espindola2011-01-231-9/+21
| | | | llvm-svn: 124077
* Delay the creation of eh_frame so that the user can change the defaults.Rafael Espindola2011-01-231-0/+1
| | | | | | Add support for SHT_X86_64_UNWIND. llvm-svn: 124059
* Remove more duplicated code.Rafael Espindola2011-01-231-3/+3
| | | | llvm-svn: 124056
* Completed :lower16: / :upper16: support for movw / movt pairs on Darwin.Evan Cheng2011-01-141-0/+14
| | | | | | | | - Fixed :upper16: fix up routine. It should be shifting down the top 16 bits first. - Added support for Thumb2 :lower16: and :upper16: fix up. - Added :upper16: and :lower16: relocation support to mach-o object writer. llvm-svn: 123424
* Style clean up - break up the breaks.Jason W Kim2011-01-131-21/+40
| | | | llvm-svn: 123347
* 1. Support ELF pcrel relocations for movw/movt:Jason W Kim2011-01-121-0/+10
| | | | | | | | R_ARM_MOVT_PREL and R_ARM_MOVW_PREL_NC. 2. Fix minor bug in ARMAsmPrinter - treat bitfield flag as a bitfield, not an enum. 3. Add support for 3 new elf section types (no-ops) llvm-svn: 123294
* Fix PR8878.Rafael Espindola2011-01-011-0/+1
| | | | llvm-svn: 122658
* Handle reloc_riprel_4byte_movq_load. Should make the bots happy.Rafael Espindola2010-12-271-0/+1
| | | | llvm-svn: 122579
* Add support for the same encodings of the personality function that gnu asRafael Espindola2010-12-271-18/+32
| | | | | | supports. llvm-svn: 122577
* Add support for @note. Patch by Jörg Sonnenberger.Rafael Espindola2010-12-261-0/+1
| | | | llvm-svn: 122568
* Merge IsFixupFullyResolved and IsSymbolRefDifferenceFullyResolved. We nowRafael Espindola2010-12-241-42/+16
| | | | | | have a single point where targets test if a relocation is needed. llvm-svn: 122549
* Simplify the handling of .size expressions.Rafael Espindola2010-12-221-17/+6
| | | | llvm-svn: 122404
* Set the value of absolute symbols.Roman Divacky2010-12-201-0/+9
| | | | llvm-svn: 122268
* Merge isAbsolute into IsSymbolRefDifferenceFullyResolved.Rafael Espindola2010-12-181-14/+0
| | | | llvm-svn: 122148
* Remove the MCObjectFormat class.Rafael Espindola2010-12-181-0/+6
| | | | llvm-svn: 122147
* Move some data to the TargetWriter.Rafael Espindola2010-12-181-79/+53
| | | | llvm-svn: 122134
* Store and free the TargetObjectWriter.Rafael Espindola2010-12-171-13/+26
| | | | llvm-svn: 122070
* Stub out explicit MCELFObjectTargetWriter interface.Rafael Espindola2010-12-171-1/+2
| | | | llvm-svn: 122067
* Move createELFObjectWriter to its own header.Rafael Espindola2010-12-171-0/+1
| | | | llvm-svn: 122064
* Use getFixupKindInfo to implement isFixupKindPCRel, ELF version.Rafael Espindola2010-12-171-40/+8
| | | | llvm-svn: 122050
* MC/ObjectWriter: Add a new IsSymbolRefDifferenceFullyResolved target format ↵Daniel Dunbar2010-12-171-2/+11
| | | | | | | | specific hook. - Currently just has stub implementations for Mach-O, ELF, and COFF. llvm-svn: 122037
* MC/Assembler: Strip out object writer arguments, now that it is always availableDaniel Dunbar2010-12-171-1/+1
| | | | | | -- and remove FIXME asking for the same! llvm-svn: 122032
* 1. ARM/MC/ELF: A few more ELF relocs for .oJason W Kim2010-12-161-0/+6
| | | | | | | 2. Fixed EmitLocalCommonSymbol for ELF (Yes, they exist. :) Test added. llvm-svn: 121951
* First cut of ARM/MC/ELF PIC relocations.Jason W Kim2010-12-131-7/+25
| | | | | | Test has fixme, to move to .s -> .o test when AsmParser works better. llvm-svn: 121732
* Thumb unconditional branch binary encoding. rdar://8754994Jim Grosbach2010-12-101-0/+1
| | | | llvm-svn: 121496
* Rename CB/CBZ specific fixup accordingly.Jim Grosbach2010-12-091-1/+1
| | | | llvm-svn: 121404
* ARM/MC/ELF TPsoft is now a proper pseudo inst.Jason W Kim2010-12-081-5/+13
| | | | | | | | | Added test to check bl __aeabi_read_tp gets emitted properly for ELF/ASM as well as ELF/OBJ (including fixup) Also added support for ELF::R_ARM_TLS_IE32 llvm-svn: 121312
* Support the "target" encodings for the CB[N]Z instructions.Bill Wendling2010-12-081-0/+1
| | | | llvm-svn: 121308
* Add support for loading from a constant pool.Bill Wendling2010-12-081-0/+1
| | | | llvm-svn: 121226
* Sorry for such a large commit. The summary is that only MachO cares about theRafael Espindola2010-12-071-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | actuall addresses in a .o file, so it is better to let the MachO writer compute it. This is good for two reasons. First, areas that shouldn't care about addresses now don't have access to it. Second, the layout of each section is independent. I should use this in a subsequent commit to speed it up. Most of the patch is just removing the section address computation. The two interesting parts are the change on how we handle padding in the end of sections and how MachO can get the address of a-b when a and b are in different sections. Since now the expression evaluation normally doesn't know the section address, it will think that a-b needs relocation and let the MachO writer know. Once it has computed the section addresses, it calls back the expression evaluation with the section addresses to resolve these expressions. The remaining problem is the handling of padding. Currently it will create a special alignment fragment at the end. Since that fragment doesn't update the alignment of the section, it needs the real address to be computed. Since now the layout will not compute a-b with a and b in different sections, the only effect that the special alignment fragment has is update the address size of the section. This can also be done by the MachO writer. llvm-svn: 121076
* Add fixup for Thumb1 BL/BLX instructions.Jim Grosbach2010-12-061-0/+1
| | | | llvm-svn: 121072
* Refactor ELFObjectWriter.Jason W Kim2010-12-061-216/+106
| | | | | | | + ARM/X86/MBlaze now share a common RecordRelocation + ARM/X86/MBlaze arch specific routines are limited to GetRelocType() llvm-svn: 121043
* Remove the getAddress getter, initialize Ordinal in the constructor and useRafael Espindola2010-12-061-1/+1
| | | | | | that on the ELF writer to detect a section we created. llvm-svn: 120981
* Add a getSymbolOffset method and use it in the ELF writer.Rafael Espindola2010-12-061-15/+8
| | | | llvm-svn: 120977
* The sections that the ELF object writer has to create are very simple andRafael Espindola2010-12-021-20/+48
| | | | | | | | contain only data. Handle them specially instead of using AddSectionToTheEnd. This moves a hack from the generic assembler to the elf writer. It is also a bit faster and should make other improvements easier. llvm-svn: 120683
* Add support for binary encoding of ARM 'adr' instructions referencing constantJim Grosbach2010-12-021-2/+3
| | | | | | pool entries (LEApcrel pseudo). Ongoing saga of rdar://8542291. llvm-svn: 120635
* Add correct encodings for STRD and LDRD, including fixup support. ↵Owen Anderson2010-12-011-2/+2
| | | | | | Additionally, update these to unified syntax. llvm-svn: 120589
* Fix a mised reloc rename spot.Jim Grosbach2010-12-011-2/+2
| | | | llvm-svn: 120585
* ARM/MC/ELF relocation "hello world" for movw/movt.Jason W Kim2010-12-011-1/+97
| | | | | | | | | | | Lifted adjustFixupValue() from Darwin for sharing w ELF. Test added TODO: refactor ELFObjectWriter::RecordRelocation more. Possibly share more code with Darwin? Lots more relocations... llvm-svn: 120534
OpenPOWER on IntegriCloud