summaryrefslogtreecommitdiff
path: root/lib/MC/MCELFStreamer.cpp
Commit message (Collapse)AuthorAge
* Don't drop alignment info on local common symbols.Benjamin Kramer2011-09-01
| | | | | | | | | | | - On COFF the .lcomm directive has an alignment argument. - On ELF we fall back to .local + .comm Based on a patch by NAKAMURA Takumi. Fixes PR9337, PR9483 and PR10128. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138976 91177308-0d34-0410-b5e6-96231b3b80d8
* Support .code32 and .code64 in X86 assembler.Evan Cheng2011-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136197 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to ↵Evan Cheng2011-07-25
| | | | | | createMCAsmBackend. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136010 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where ↵Evan Cheng2011-07-23
| | | | | | they belong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135833 91177308-0d34-0410-b5e6-96231b3b80d8
* Unfortunately several files in MC are badly violating layering rule by usingEvan Cheng2011-07-14
| | | | | | | | | | TargetAsmInfo, which in turn pulls in TargetRegisterInfo, etc. :-( There are other cases of violations, but this is probably the worst. This patch is but one small step towards fixing this. 500 more steps to go. :-( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135131 91177308-0d34-0410-b5e6-96231b3b80d8
* sets bit 0 of the function address of thumb function in .symtabRafael Espindola2011-05-16
| | | | | | | | | | ("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
* Factor some code into a new EmitFrames method.Rafael Espindola2011-05-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131119 91177308-0d34-0410-b5e6-96231b3b80d8
* GCC uses a different encoding of pointers in the FDE when usingRafael Espindola2011-05-01
| | | | | | -fno-dwarf2-cfi-asm. Implement the same behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130637 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix handling of @IDNTPOFF relocations, they need to get STT_TLS.Joerg Sonnenberger2011-03-17
| | | | | | | While here, add VK_ARM_TPOFF and VK_ARM_GOTTPOFF, too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127780 91177308-0d34-0410-b5e6-96231b3b80d8
* Split MCEELFStreamer and ELFObjectWriter into .h and .cpp files, so that ↵Jan Sjödin2011-03-03
| | | | | | other components can use them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126942 91177308-0d34-0410-b5e6-96231b3b80d8
* Make all static functions become static class methods. Move shared ↵Jan Sjödin2011-02-28
| | | | | | (duplicated) functions to new MCELF class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126686 91177308-0d34-0410-b5e6-96231b3b80d8
* Roll out r126425 and r126450 to see if it fixes the failures on the buildbots.Cameron Zwarich2011-02-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126488 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable DebugInfo support for COFF object files.Devang Patel2011-02-24
| | | | | | | | Patch by Nathan Jeffords! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126425 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for pushsection and popsection. Patch by Joerg Sonnenberger.Rafael Espindola2011-02-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125629 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the --noexecstack option.Rafael Espindola2011-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124077 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove more duplicated code.Rafael Espindola2011-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124056 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove duplicated code.Rafael Espindola2011-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124054 91177308-0d34-0410-b5e6-96231b3b80d8
* Add basic support for .cfi_personality.Rafael Espindola2010-12-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122566 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. ARM/MC/ELF: A few more ELF relocs for .oJason W Kim2010-12-16
| | | | | | | | | 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
* Fixed version of 121434 with no new memory leaks.Rafael Espindola2010-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121471 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert my previous patch to make the valgrind bots happy.Rafael Espindola2010-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121461 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial support for the cfi directives. This is just enough to getRafael Espindola2010-12-09
| | | | | | | | | | | f: .cfi_startproc nop .cfi_endproc assembled (on ELF). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121434 91177308-0d34-0410-b5e6-96231b3b80d8
* Sorry for such a large commit. The summary is that only MachO cares about theRafael Espindola2010-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121076 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to resolve symbol differences early, and if successful create a plainRafael Espindola2010-12-03
| | | | | | | data fragment. This reduces the time to assemble the test in 8711 from 60s to 54s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120767 91177308-0d34-0410-b5e6-96231b3b80d8
* Move EmitValueToOffset to the ObjectStreamer.Rafael Espindola2010-12-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120691 91177308-0d34-0410-b5e6-96231b3b80d8
* Add EmitInstToFragment to the generic object streamer.Rafael Espindola2010-12-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120690 91177308-0d34-0410-b5e6-96231b3b80d8
* Move EmitValue to MCObjectStreamer.Rafael Espindola2010-11-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120269 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed verson of r120245.Rafael Espindola2010-11-28
| | | | | | Factor some duplicated code into MCObjectStreamer::EmitLabel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120248 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert previous patch while I debug the darwin bootstrap failure.Rafael Espindola2010-11-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120246 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor some duplicated code into MCObjectStreamer::EmitLabel.Rafael Espindola2010-11-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120245 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid code duplication in the many unsupported EmitGPRel32Value implementations.Rafael Espindola2010-11-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120243 91177308-0d34-0410-b5e6-96231b3b80d8
* Define generic 1, 2 and 4 byte pc relative relocations. They are commonRafael Espindola2010-11-28
| | | | | | and at least the 4 byte one will be needed to implement the .cfi_* directives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120240 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix and add tests for all cases in x86 and x86_64 where gnu as implicitlyRafael Espindola2010-11-24
| | | | | | sets the type of a symbol to STT_TLS. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120100 91177308-0d34-0410-b5e6-96231b3b80d8
* If a symbol is used as tls, mark it as tls even if not declare as so. ProbablyRafael Espindola2010-11-24
| | | | | | fixes PR8659. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120076 91177308-0d34-0410-b5e6-96231b3b80d8
* Added support for the Mach-O .symbol_resolver directive. rdar://8673046Kevin Enderby2010-11-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119816 91177308-0d34-0410-b5e6-96231b3b80d8
* Change some methods in MCDwarf.cpp to be able to handle an arbitraryRafael Espindola2010-11-19
| | | | | | | | | | | | MCStreamer instead of just MCObjectStreamer. Address changes cannot be as efficient as we have to use DW_LNE_set_addres, but at least most of the logic is shared. This will be used so that, with CodeGen still using EmitDwarfLocDirective, llvm-gcc is able to produce debug_line sections without needing an assembler that supports .loc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119777 91177308-0d34-0410-b5e6-96231b3b80d8
* Add .loc methods to the streamer.Rafael Espindola2010-11-16
| | | | | | | Next: Add support for the !HasDotLocAndDotFile case to the MCAsmStreamer and then switch codegen to use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119384 91177308-0d34-0410-b5e6-96231b3b80d8
* Change MCExpr::EvaluateAsRelocatableImpl of variables to return the originalRafael Espindola2010-11-15
| | | | | | | | | | | | | | | | | | | | | | | | | | variable if recursing fails to simplify it. Factor AliasedSymbol to be a method of MCSymbol. Update MCAssembler::EvaluateFixup to match the change in EvaluateAsRelocatableImpl. Remove the WeakRefExpr hack, as the object writer now sees the weakref with no extra effort needed. Nothing else is using MCTargetExpr, but keep it for now. Now that the ELF writer sees relocations with aliases, handle .weak foo2 foo2: .weak bar2 .set bar2,foo2 .quad bar2 the same way gas does and produce a relocation with bar2. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119152 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix another case of a .comm directive without a corresponding .typeRafael Espindola2010-11-14
| | | | | | directive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119073 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the type of a symbol created with .comm and no corresponding .type.Rafael Espindola2010-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119060 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle a peculiar comdat case: Creating a section with an undefinedRafael Espindola2010-11-14
| | | | | | | signature symbol causes a local symbol to be created unless there is some other use of the symbol. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119026 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix warning.Rafael Espindola2010-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119021 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark labels declared in tls sections as STT_TLS. This matches the behavior ofRafael Espindola2010-11-11
| | | | | | gas. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118818 91177308-0d34-0410-b5e6-96231b3b80d8
* Add '.code 32' assembler directive to MC streamers.Jim Grosbach2010-11-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118309 91177308-0d34-0410-b5e6-96231b3b80d8
* MC'ize the '.code 16' and '.thumb_func' ARM directives.Jim Grosbach2010-11-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118301 91177308-0d34-0410-b5e6-96231b3b80d8
* Put class into an anonymous namespace.Benjamin Kramer2010-11-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118294 91177308-0d34-0410-b5e6-96231b3b80d8
* Write the line info to .debug_line.Rafael Espindola2010-11-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117930 91177308-0d34-0410-b5e6-96231b3b80d8
* Move EmitInstruction to MCObjectStreamer so that ELF and MachO can share it.Rafael Espindola2010-11-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117925 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement .weakref.Rafael Espindola2010-11-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117911 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure weak symbols are listed after the local ones.Rafael Espindola2010-10-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115795 91177308-0d34-0410-b5e6-96231b3b80d8