aboutsummaryrefslogtreecommitdiff
path: root/lib/MC/MCAssembler.cpp
AgeCommit message (Collapse)Author
2010-03-25MC: Sink Section address assignment into LayoutSection.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99528 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25MC: Explicity track section and fragment ordinals.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99500 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25MC: Route access to SectionData offset and file size through MCAsmLayout.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99474 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25MC: Route access to Fragment offset and effective size through MCAsmLayout.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25MC: Eliminate MC{Fragment,{Section,Symbol}Data}::getAddress.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99467 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24MC: Direct all {fragment,section,symbol} address access through the ↵Daniel Dunbar
MCAsmLayout object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99380 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23MC: Sprinkle in some more interesting statistics.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99350 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23MC: Switch to using MCInst fragments to do relaxation.Daniel Dunbar
Also, both MCMachOStreamer and MCAssembler are now target independent! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99256 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23MC: Add TargetAsmBackend::MayNeedRelaxation, for checking whether a ↵Daniel Dunbar
particular instruction + fixups might need relaxation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99249 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23MC: Add TargetAsmBackend::WriteNopData and use to eliminate some target ↵Daniel Dunbar
dependencies in MCMachOStreamer and MCAssembler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23MC: Tweak MCInstFragment to include the encoded data and fixups, so that we ↵Daniel Dunbar
don't need to recompute them during relaxation. I will revisit this once all the other pieces of fast relaxation are in place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99244 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22MC: Add MCInstFragment, not used yet.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99229 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22MC: Fix a few more cases we were passing an MCDataFragment when a MCFragment ↵Daniel Dunbar
would do, and sprinkle in some const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99218 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22Simplify.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99217 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22MC: Change MCObjectWriter::RecordRelocation to take an MCFragment (instead ↵Daniel Dunbar
of a MCDataFragment). Object files should only need the generic MCFragment features. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99205 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22MC: Eliminate MCFragment::getMaxFileSize.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99203 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22MC: Share the MCAsmLayout object, although its still not used for anything ↵Daniel Dunbar
important. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99202 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19MC: Add TargetAsmBackend::createObjectWriter.Daniel Dunbar
- MCAssembler is now object-file independent, although we will surely need more work to fully support ELF/COFF. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98955 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19MCCodeEmitter: Add target independent fixup flag for is-pc-relative.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98954 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19MC: Sink code emitter into MCAssembler.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98953 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19MC/Mach-O: Move to MachObjectWriter.{h,cpp}.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98952 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19MC: Add TargetAsmBackend::isVirtualSection hook.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98950 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19MC: Split MCObjectWriter out of MCAssembler.cpp.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98949 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19MCAssembler: Pull out MCObjectWriter class.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98948 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19MCAssembler: Move ApplyFixup to the TargetAsmBackend, this is a target ↵Daniel Dunbar
specific not object writer specific task. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19MC/Mach-O: Lift the fixup evaluation and application up (to the same place), ↵Daniel Dunbar
and eliminate MCAsmFixup::FixedValue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98944 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19MC/Mach-O: Factor out ExecutePostLayoutBinding, to separate the post-layout ↵Daniel Dunbar
changes the object writer may need to make to the assembler from the actual .o writing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98943 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19MC/Mach-O: Lift relocation emission logic a bit higher to separate ↵Daniel Dunbar
evaluation / relocation handling from the actual .o writing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98942 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19MC/Mach-O: Add isScatteredFixupFullyResolved, which implements the correct ↵Daniel Dunbar
algorithm (used on x86_64) for determining whether an evaluated fixup is fully resolved (doesn't need relocation). - Test cases will follow, once we have x86_64 relocation support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98926 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19MC/Mach-O/x86_64: Add getAtom[ForAddress].Daniel Dunbar
- These find the defining symbol which identifies the containing atom for a symbol or address. They are currently very slow, but will be eliminated eventually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98925 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19MC/Mach-O: Factor out isScatteredFixupFullyResolvedSimple predicate, and fix ↵Daniel Dunbar
some corner cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98924 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19MC/Mach-O: Factor out isSymbolLinkerVisible method; "linker visible" is a ↵Daniel Dunbar
made up term to refer to non-temporary labels + temporary labels in sections-which-require symbols. For Darwin, it corresponds to symbols which effectively define an atom. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98923 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18MCValue: Change to holding MCSymbolRefExprs instead of MCSymbols, we will ↵Daniel Dunbar
need this for accessing to symbol modifiers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15MC/Mach-O/x86_64: Temporary labels in cstring sections require symbols (and ↵Daniel Dunbar
external relocations, but we don't have x86_64 relocations yet). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98583 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15MC/Mach-O: Add MCSectionMachO::getType()Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98582 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13MC/X86_64: Symbol support.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98456 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13MC/Mach-O: Initial x86_64 support.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13MC/Mach-O: PCrel relocations weren't using the right base address, they areDaniel Dunbar
relative to the fragment address, not its offset. This was masked by the text section normally being at address 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98420 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12MC/Mach-O: Implement initial support for relaxation.Daniel Dunbar
- The implementation is currently very brain dead and inefficient, but I have a clear plan on how to fix it. - The good news is, it works and correctly assembles 403.gcc (when built with Clang, at '-Os', '-Os -g', and '-O3'). Even better, at '-Os' and '-Os -g', the resulting binary is exactly equivalent to that when built with the system assembler. So it probably works! :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12MC: Factor out MCAssembler::EvaluateFixup, and simplify.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98381 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11MC/Mach-O: Add MCSymbolData::getAddress() utility.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98266 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11MC/Mach-O: Implement "absolutizing" semantics of .set, by evaluating the ↵Daniel Dunbar
assembly time value of variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98241 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11MC/Mach-O: Start passing in the basic MCAsmLayout object.Daniel Dunbar
- Also, drop the current location part of AsmLayout, I think I prefer to implement this via explicit symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11MC: Provide MCAssembler with a TargetAsmBackend.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98222 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10MC/Mach-O: Use the MCAssembler symbol map instead of reconstructing.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98187 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10MC/Mach-O: Resolve a FIXME; these relocation types are no longer semanticaly ↵Daniel Dunbar
different. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98120 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10MC/Mach-O: Use the SECTDIFF relocation type for (A - B + constant) where A ↵Daniel Dunbar
is external. - I'm not sure why, but this is what 'as' does. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98115 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09MC/Mach-O: For PCrel relocations, we need to compensate for the PCrel ↵Daniel Dunbar
adjustment when determining if we need a scattered relocation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09MC/Mach-O: Also set the PCrel bit in the second half of paired relocation ↵Daniel Dunbar
entries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98081 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09MC/Mach-O: Don't generate relocations for PCrel fixups to local labels.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98080 91177308-0d34-0410-b5e6-96231b3b80d8