summaryrefslogtreecommitdiff
path: root/lib/MC/MachObjectWriter.cpp
Commit message (Collapse)AuthorAge
* Correct word hyphenationsAlp Toker2013-12-05
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities and contractions in nearby lines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196471 91177308-0d34-0410-b5e6-96231b3b80d8
* MachO: Improve backend diagnostic for overalignment.Jim Grosbach2013-09-24
| | | | | | Give the symbol's name and disengage the enchanced crash reporting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191344 91177308-0d34-0410-b5e6-96231b3b80d8
* Add names for mach-o permissions bits and use the symbol names in place of ↵Nick Kledzik2013-09-04
| | | | | | magic numbers git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190013 91177308-0d34-0410-b5e6-96231b3b80d8
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-09-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189728 91177308-0d34-0410-b5e6-96231b3b80d8
* The integrated darwin assembler can hang in an infinite loop (or get an assert Kevin Enderby2013-08-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | with a debug build) with this buggy .indirect_symbol directive usage: % cat test.s x: .indirect_symbol _y The assertion is because it is trying to get the symbol index for the symbol _y when it is writing out the indirect symbol table. This line of code in MachObjectWriter::WriteObject() : Write32(Asm.getSymbolData(*it->Symbol).getIndex()); And while there is a symbol _y it does not have any getSymbolData set which is only done in MachObjectWriter::BindIndirectSymbols() for pointer sections or stub sections. I added a check and an error in there to catch this in case something slips through. But to get a better error the parser should detect when a .indirect_symbol directive is used and it is not in a pointer section or stub section. To make that work I moved the handling of the indirect symbol out of the target independent AsmParser code into the DarwinAsmParser code that can check for the proper Mach-O section types. rdar://14825505 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189497 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Fix the build broken by r189315." and "Move everything depending on ↵Charles Davis2013-08-27
| | | | | | | | | Object/MachOFormat.h over to Support/MachO.h." This reverts commits r189319 and r189315. r189315 broke some tests on what I believe are big-endian platforms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189321 91177308-0d34-0410-b5e6-96231b3b80d8
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-08-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189315 91177308-0d34-0410-b5e6-96231b3b80d8
* [MC/Mach-O] Load commands are supposed to 8-byte aligned on 64-bit.Daniel Dunbar2013-01-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173120 91177308-0d34-0410-b5e6-96231b3b80d8
* [MC/Mach-O] Add support for linker options in Mach-O files.Daniel Dunbar2013-01-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172779 91177308-0d34-0410-b5e6-96231b3b80d8
* Add more reset methods to make all objects that the backend may use for ↵Pedro Artigas2012-12-14
| | | | | | outputting code have a reset, some are not used but were declared for completeness git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170227 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-03
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up. 80 columns.Jim Grosbach2012-09-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164181 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Doxygen issues:Dmitri Gribenko2012-09-14
| | | | | | | | | | | * wrap code blocks in \code ... \endcode; * refer to parameter names in paragraphs correctly (\arg is not what most people want -- it starts a new paragraph); * use \param instead of \arg to document parameters in order to be consistent with the rest of the codebase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163902 91177308-0d34-0410-b5e6-96231b3b80d8
* MachO: Correctly mark symbol-difference variables as N_ABS.Jim Grosbach2012-09-13
| | | | | | | | | | | .set a, b - c + CONSTANT d = b - c + CONSTANT Both 'a' and 'd' should be marked as absolute symbols (N_ABS). rdar://12219394 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163853 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce duplicated hash map lookups.Benjamin Kramer2012-08-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162362 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor data-in-code annotations.Jim Grosbach2012-05-18
| | | | | | | | | | | | | | | | | | | | | | Use a dedicated MachO load command to annotate data-in-code regions. This is the same format the linker produces for final executable images, allowing consistency of representation and use of introspection tools for both object and executable files. Data-in-code regions are annotated via ".data_region"/".end_data_region" directive pairs, with an optional region type. data_region_directive := ".data_region" { region_type } region_type := "jt8" | "jt16" | "jt32" | "jta32" end_data_region_directive := ".end_data_region" The previous handling of ARM-style "$d.*" labels was broken and has been removed. Specifically, it didn't handle ARM vs. Thumb mode when marking the end of the section. rdar://11459456 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157062 91177308-0d34-0410-b5e6-96231b3b80d8
* Prune some includes and forward declarations.Craig Topper2012-03-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153429 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM Darwin symbol ref differences w/o subsection-via-symbols.Jim Grosbach2012-01-24
| | | | | | | | When not using subsections via symbols, the assembler can resolve symbol differences (including pcrel references) to non-local labels at assembly time, not just those in the same atom. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148865 91177308-0d34-0410-b5e6-96231b3b80d8
* MCAssembler tweak for determining when a symbol difference is resolved.Jim Grosbach2012-01-18
| | | | | | | | | | | | If the two fragments are in the same Atom, then the difference expression is resolvable at compile time. Previously we were checking that they were in the same fragment, but that breaks down in the presence of instruction relaxation which has multiple fragments in the same atom. rdar://10711829 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148423 91177308-0d34-0410-b5e6-96231b3b80d8
* MC tweak symbol difference resolution for non-local symbols.Jim Grosbach2012-01-17
| | | | | | | | | | | | | | | | When the non-local symbol in the expression is in the same fragment as the second symbol, the assembler can still evaluate the expression without needing a relocation. For example, on ARM: _foo: ldr lr, (_foo - 4) rdar://10348687 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148341 91177308-0d34-0410-b5e6-96231b3b80d8
* Darwin assembler improved relocs when w/o subsections_via_symbols.Jim Grosbach2011-12-07
| | | | | | | | | | When the file isn't being built with subsections-via-symbols, symbol differences involving non-local symbols can be resolved more aggressively. Needed for gas compatibility. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146054 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up. Hard tabs.Jim Grosbach2011-12-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145878 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch MCAssembler to method names starting w/ lower-case.Jim Grosbach2011-12-06
| | | | | | per http://llvm.org/docs/CodingStandards.html#ll_naming git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145873 91177308-0d34-0410-b5e6-96231b3b80d8
* Formatting and typo.Eric Christopher2011-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139325 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a Darwin x86_64 special case of a jmp to a temporary symbol from an atomKevin Enderby2011-09-08
| | | | | | | without a base symbol that must not have a relocation entry. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139316 91177308-0d34-0410-b5e6-96231b3b80d8
* MachOWriter: Don't crash on fixups with arithmetic, emit a relocation ↵Benjamin Kramer2011-08-12
| | | | | | instead. This matches what as does. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137414 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't truncate MachO addresses.Jim Grosbach2011-08-09
| | | | | | | | | | | | | | | | Assigned symbol addresses get truncated to 32-bits, even on 64-bit platforms. That's obviously bogus. For example, .globl _foo .equ _foo, 0x987654321ULL rdar://9922863 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137158 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
* Refactor MachO relocation generaration into the Target directories.Jim Grosbach2011-06-24
| | | | | | | | | | Move the target-specific RecordRelocation logic out of the generic MC MachObjectWriter and into the target-specific object writers. This allows nuking quite a bit of target knowledge from the supposedly target-independent bits in lib/MC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133844 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy up whitespace.Jim Grosbach2011-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133815 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixup info for Thumb2 unconditional branch.Jim Grosbach2011-06-24
| | | | | | rdar://9667872 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133808 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up.Jim Grosbach2011-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133770 91177308-0d34-0410-b5e6-96231b3b80d8
* 80-column violations.Bill Wendling2011-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133668 91177308-0d34-0410-b5e6-96231b3b80d8
* Move class methods out-of-line. This reduces the indentation, and is more inBill Wendling2011-06-22
| | | | | | | | line with LLVM's general coding style. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133645 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Update getSymbolAddress() to support evaluation of variables.Daniel Dunbar2011-04-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130522 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Allow emission of relocations for variables in some more cases.Daniel Dunbar2011-04-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130520 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Find section ordinal's by looking at the symbol, instead of ↵Daniel Dunbar2011-04-29
| | | | | | assuming they are present in a fragment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130519 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-15
| | | | | | | | Luis Felipe Strano Moraes! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug introduced by my patch yesterday: BL is a 4-byte instructions like ↵Owen Anderson2011-03-23
| | | | | | BLX, rather than a 2-byte instruction like B. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128169 91177308-0d34-0410-b5e6-96231b3b80d8
* RIT_ARM_ThumbBranch32Bit relocations are not used and should never be generated.Owen Anderson2011-03-22
| | | | | | | | This fixes kimwitu++, bullet, and tramp3dv4 with the ARM integrated assembler. Fixes <rdar://problem/9165738>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128117 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence compiler warning about case values not being in the enumerated typeDuncan Sands2011-03-15
| | | | | | | MCFixupKind. This is the same technique that is used elsewhere in MC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127676 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes warnings emitted by Visual Studio 2010 compiler.Oscar Fuentes2011-03-01
| | | | | | Patch by Erik Olofsson! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126796 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ARM/MC/ELF to handle R_ARM_JUMP24 relocation type for conditional jumps.Jason W Kim2011-02-04
| | | | | | | | | | | | | | | | | | | (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
* Fix bogus assert condition noticed by Csaba Raduly.Evan Cheng2011-02-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124645 91177308-0d34-0410-b5e6-96231b3b80d8
* Completed :lower16: / :upper16: support for movw / movt pairs on Darwin.Evan Cheng2011-01-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
* MC/Mach-O/Thumb: Select appropriate relocation types for Thumb.Daniel Dunbar2010-12-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122583 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge IsFixupFullyResolved and IsSymbolRefDifferenceFullyResolved. We nowRafael Espindola2010-12-24
| | | | | | 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
* MC/Mach-O/ARM: Start handling some Thumb branches.Daniel Dunbar2010-12-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122547 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O/ARM: Don't try to use scattered relocs for BR24 fixups.Daniel Dunbar2010-12-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122441 91177308-0d34-0410-b5e6-96231b3b80d8