aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/ELFObjectWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Refactor X86 target to separate MC code from Target code.Evan Cheng2011-07-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135930 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where ↵Evan Cheng2011-07-231-2/+2
| | | | | | they belong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135833 91177308-0d34-0410-b5e6-96231b3b80d8
* Sink ARM mc routines into MCTargetDesc.Evan Cheng2011-07-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135825 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an uneeded switch - Turns out reloc results are identical w/o the ↵Jason W Kim2011-06-091-12/+1
| | | | | | switch. (face+palm) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132790 91177308-0d34-0410-b5e6-96231b3b80d8
* Produce an undefined reference to _GLOBAL_OFFSET_TABLE_ if we have aRafael Espindola2011-06-051-0/+2
| | | | | | | | | | VK_GOTOFF reloc. This matches as' behavior, but it is not clear why the linker might need this, so I added a FIXME. I could test this by duplicating test/MC/ELF/got.s, but it doesn't look worthwhile. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132655 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for @GOTPTOFF in i386 mode.Nick Lewycky2011-06-041-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132643 91177308-0d34-0410-b5e6-96231b3b80d8
* fixes target address tBL and tBLX and sets relocation typeRafael Espindola2011-05-201-0/+11
| | | | | | | | of tBL/tBLX to R_ARM_THM_CALL (ARM ELF 4.7.1.6) Patch by koan-sin tan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131748 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a FIXME reminder to remove ForceARMElfPIC switch.Jason W Kim2011-05-161-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131411 91177308-0d34-0410-b5e6-96231b3b80d8
* sets bit 0 of the function address of thumb function in .symtabRafael Espindola2011-05-161-2/+7
| | | | | | | | | | ("T is 1 if the target symbol S has type STT_FUNC and the symbol addresses a Thumb instruction ;it is 0 otherwise." from "ELF for the ARM Architecture" 4.7.1.2) Patch by Koan-Sin Tan! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131406 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unused variable and move a couple others inside DEBUG.Matt Beaumont-Gay2011-05-111-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131208 91177308-0d34-0410-b5e6-96231b3b80d8
* Address the last bit of relocation flag related divergence betweeenJason W Kim2011-05-111-20/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LLVM and binutils. With this patch, there are no functional differences between the .o produced directly from LLVM versus the .s to .o via GNU as, for relocation tags at least, for both PIC and non-PIC modes. Because some non-PIC reloc tags are used (legally) on PIC, so IsPCRel flag is necessary but not sufficient to determine whether the overall codegen mode is PIC or not. Why is this necessary? There is an incompatibility of how relocs are emitted in the .rodata section. Binutils PIC likes to emit certain relocs as section relative offsets. Non-PIC does not do this. So I added a hidden switch on the ELFObjectwriter "-arm-elf-force-pic" which forces the objectwriter to pretend that all relocs are for PIC mode. Todo: Activate ForceARMElfPIC to true if -relocation-model=pic is selected on llc. Todo: There are probably more issues for PIC mode on ARM/MC/ELF... Todo: Existing tests in MC/ARM/elf-reloc*.ll need to be converted over to .s tests as well as expanded to cover the gamut. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131205 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the handling of pcrel relocations on ELF. Now we do the right thingRafael Espindola2011-05-011-1/+5
| | | | | | | | | | for all symbol differences and can drop the old EmitPCRelSymbolValue method. This also make getExprForFDESymbol on ELF equal to the one on MachO, and it can be made non-virtual. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130634 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129115 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127972 91177308-0d34-0410-b5e6-96231b3b80d8
* Split MCEELFStreamer and ELFObjectWriter into .h and .cpp files, so that ↵Jan Sjödin2011-03-031-363/+1
| | | | | | other components can use them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126942 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126933 91177308-0d34-0410-b5e6-96231b3b80d8
* Make all static functions become static class methods. Move shared ↵Jan Sjödin2011-02-281-89/+77
| | | | | | (duplicated) functions to new MCELF class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126686 91177308-0d34-0410-b5e6-96231b3b80d8
* Put in the symbol table symbols only used in a .globl statement.Rafael Espindola2011-02-231-1/+5
| | | | | | Fixes PR9292. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126330 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle FK_PCRel_1 and add a test case for this and FK_PCRel_4.Joerg Sonnenberger2011-02-211-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126157 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125648 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124996 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124899 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124895 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the --noexecstack option.Rafael Espindola2011-01-231-9/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124077 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124059 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove more duplicated code.Rafael Espindola2011-01-231-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124056 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123424 91177308-0d34-0410-b5e6-96231b3b80d8
* Style clean up - break up the breaks.Jason W Kim2011-01-131-21/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123347 91177308-0d34-0410-b5e6-96231b3b80d8
* 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) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123294 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR8878.Rafael Espindola2011-01-011-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122658 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle reloc_riprel_4byte_movq_load. Should make the bots happy.Rafael Espindola2010-12-271-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122579 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the same encodings of the personality function that gnu asRafael Espindola2010-12-271-18/+32
| | | | | | supports. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122577 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for @note. Patch by Jörg Sonnenberger.Rafael Espindola2010-12-261-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122568 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge IsFixupFullyResolved and IsSymbolRefDifferenceFullyResolved. We nowRafael Espindola2010-12-241-42/+16
| | | | | | have a single point where targets test if a relocation is needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122549 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the handling of .size expressions.Rafael Espindola2010-12-221-17/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122404 91177308-0d34-0410-b5e6-96231b3b80d8
* Set the value of absolute symbols.Roman Divacky2010-12-201-0/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122268 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge isAbsolute into IsSymbolRefDifferenceFullyResolved.Rafael Espindola2010-12-181-14/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122148 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the MCObjectFormat class.Rafael Espindola2010-12-181-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122147 91177308-0d34-0410-b5e6-96231b3b80d8
* Move some data to the TargetWriter.Rafael Espindola2010-12-181-79/+53
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122134 91177308-0d34-0410-b5e6-96231b3b80d8
* Store and free the TargetObjectWriter.Rafael Espindola2010-12-171-13/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122070 91177308-0d34-0410-b5e6-96231b3b80d8
* Stub out explicit MCELFObjectTargetWriter interface.Rafael Espindola2010-12-171-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122067 91177308-0d34-0410-b5e6-96231b3b80d8
* Move createELFObjectWriter to its own header.Rafael Espindola2010-12-171-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122064 91177308-0d34-0410-b5e6-96231b3b80d8
* Use getFixupKindInfo to implement isFixupKindPCRel, ELF version.Rafael Espindola2010-12-171-40/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122050 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122037 91177308-0d34-0410-b5e6-96231b3b80d8
* 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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122032 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121951 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121732 91177308-0d34-0410-b5e6-96231b3b80d8
* Thumb unconditional branch binary encoding. rdar://8754994Jim Grosbach2010-12-101-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121496 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename CB/CBZ specific fixup accordingly.Jim Grosbach2010-12-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121404 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121312 91177308-0d34-0410-b5e6-96231b3b80d8