summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MachObjectWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [MC/Mach-O] Load commands are supposed to 8-byte aligned on 64-bit.Daniel Dunbar2013-01-221-7/+8
| | | | llvm-svn: 173120
* [MC/Mach-O] Add support for linker options in Mach-O files.Daniel Dunbar2013-01-181-5/+51
| | | | llvm-svn: 172779
* Add more reset methods to make all objects that the backend may use for ↵Pedro Artigas2012-12-141-0/+10
| | | | | | outputting code have a reset, some are not used but were declared for completeness llvm-svn: 170227
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-3/+2
| | | | | | | | | | | | | | | | | 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. =] llvm-svn: 169131
* Tidy up. 80 columns.Jim Grosbach2012-09-181-2/+6
| | | | llvm-svn: 164181
* Fix Doxygen issues:Dmitri Gribenko2012-09-141-2/+2
| | | | | | | | | | * 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. llvm-svn: 163902
* MachO: Correctly mark symbol-difference variables as N_ABS.Jim Grosbach2012-09-131-5/+30
| | | | | | | | | | | .set a, b - c + CONSTANT d = b - c + CONSTANT Both 'a' and 'd' should be marked as absolute symbols (N_ABS). rdar://12219394 llvm-svn: 163853
* Reduce duplicated hash map lookups.Benjamin Kramer2012-08-221-4/+2
| | | | llvm-svn: 162362
* Refactor data-in-code annotations.Jim Grosbach2012-05-181-2/+51
| | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 157062
* Prune some includes and forward declarations.Craig Topper2012-03-261-1/+1
| | | | llvm-svn: 153429
* ARM Darwin symbol ref differences w/o subsection-via-symbols.Jim Grosbach2012-01-241-1/+2
| | | | | | | | 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. llvm-svn: 148865
* MCAssembler tweak for determining when a symbol difference is resolved.Jim Grosbach2012-01-181-1/+2
| | | | | | | | | | | | 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 llvm-svn: 148423
* MC tweak symbol difference resolution for non-local symbols.Jim Grosbach2012-01-171-2/+2
| | | | | | | | | | | | | | 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 llvm-svn: 148341
* Darwin assembler improved relocs when w/o subsections_via_symbols.Jim Grosbach2011-12-071-1/+6
| | | | | | | | 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. llvm-svn: 146054
* Tidy up. Hard tabs.Jim Grosbach2011-12-061-1/+1
| | | | llvm-svn: 145878
* Switch MCAssembler to method names starting w/ lower-case.Jim Grosbach2011-12-061-1/+1
| | | | | | per http://llvm.org/docs/CodingStandards.html#ll_naming llvm-svn: 145873
* Formatting and typo.Eric Christopher2011-09-081-2/+3
| | | | llvm-svn: 139325
* Fix a Darwin x86_64 special case of a jmp to a temporary symbol from an atomKevin Enderby2011-09-081-0/+10
| | | | | | without a base symbol that must not have a relocation entry. llvm-svn: 139316
* MachOWriter: Don't crash on fixups with arithmetic, emit a relocation ↵Benjamin Kramer2011-08-121-2/+6
| | | | | | instead. This matches what as does. llvm-svn: 137414
* Don't truncate MachO addresses.Jim Grosbach2011-08-091-1/+1
| | | | | | | | | | | | | | 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 llvm-svn: 137158
* Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to ↵Evan Cheng2011-07-251-1/+1
| | | | | | createMCAsmBackend. llvm-svn: 136010
* Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where ↵Evan Cheng2011-07-231-1/+1
| | | | | | they belong. llvm-svn: 135833
* Refactor MachO relocation generaration into the Target directories.Jim Grosbach2011-06-241-985/+19
| | | | | | | | | 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. llvm-svn: 133844
* tidy up whitespace.Jim Grosbach2011-06-241-1/+1
| | | | llvm-svn: 133815
* Fixup info for Thumb2 unconditional branch.Jim Grosbach2011-06-241-0/+1
| | | | | | rdar://9667872 llvm-svn: 133808
* Tidy up.Jim Grosbach2011-06-231-1/+1
| | | | llvm-svn: 133770
* 80-column violations.Bill Wendling2011-06-231-12/+17
| | | | llvm-svn: 133668
* Move class methods out-of-line. This reduces the indentation, and is more inBill Wendling2011-06-221-1289/+1410
| | | | | | | line with LLVM's general coding style. No functionality change. llvm-svn: 133645
* MC/Mach-O: Update getSymbolAddress() to support evaluation of variables.Daniel Dunbar2011-04-291-0/+27
| | | | llvm-svn: 130522
* MC/Mach-O: Allow emission of relocations for variables in some more cases.Daniel Dunbar2011-04-291-19/+19
| | | | llvm-svn: 130520
* MC/Mach-O: Find section ordinal's by looking at the symbol, instead of ↵Daniel Dunbar2011-04-291-4/+8
| | | | | | assuming they are present in a fragment. llvm-svn: 130519
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-151-2/+2
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129558
* Fix a bug introduced by my patch yesterday: BL is a 4-byte instructions like ↵Owen Anderson2011-03-231-3/+2
| | | | | | BLX, rather than a 2-byte instruction like B. llvm-svn: 128169
* RIT_ARM_ThumbBranch32Bit relocations are not used and should never be generated.Owen Anderson2011-03-221-6/+2
| | | | | | | This fixes kimwitu++, bullet, and tramp3dv4 with the ARM integrated assembler. Fixes <rdar://problem/9165738>. llvm-svn: 128117
* Silence compiler warning about case values not being in the enumerated typeDuncan Sands2011-03-151-1/+1
| | | | | | MCFixupKind. This is the same technique that is used elsewhere in MC. llvm-svn: 127676
* Fixes warnings emitted by Visual Studio 2010 compiler.Oscar Fuentes2011-03-011-2/+2
| | | | | | Patch by Erik Olofsson! llvm-svn: 126796
* Teach ARM/MC/ELF to handle R_ARM_JUMP24 relocation type for conditional jumps.Jason W Kim2011-02-041-1/+2
| | | | | | | | | | | | | | | | (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
* Fix bogus assert condition noticed by Csaba Raduly.Evan Cheng2011-02-011-2/+2
| | | | llvm-svn: 124645
* Completed :lower16: / :upper16: support for movw / movt pairs on Darwin.Evan Cheng2011-01-141-9/+126
| | | | | | | | - 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
* MC/Mach-O/Thumb: Select appropriate relocation types for Thumb.Daniel Dunbar2010-12-271-9/+11
| | | | llvm-svn: 122583
* Merge IsFixupFullyResolved and IsSymbolRefDifferenceFullyResolved. We nowRafael Espindola2010-12-241-124/+33
| | | | | | have a single point where targets test if a relocation is needed. llvm-svn: 122549
* MC/Mach-O/ARM: Start handling some Thumb branches.Daniel Dunbar2010-12-241-0/+14
| | | | llvm-svn: 122547
* MC/Mach-O/ARM: Don't try to use scattered relocs for BR24 fixups.Daniel Dunbar2010-12-221-1/+1
| | | | llvm-svn: 122441
* Fix another conditional expression mismatched enum type warning.Matt Beaumont-Gay2010-12-221-1/+2
| | | | llvm-svn: 122419
* MC/Mach-O/ARM: We always use the SECTDIFF reloc type on ARM, which isDaniel Dunbar2010-12-221-6/+1
| | | | | | esp. important given that the LOCAL_SECTDIFF enumeration got redefined. llvm-svn: 122412
* MC/Mach-O/ARM: Clone off an ARM version of RecordScatteredRelocation until I ↵Daniel Dunbar2010-12-221-4/+68
| | | | | | figure out how it is supposed to work. llvm-svn: 122410
* MC/Mach-O: Return to reporting errors if we see unexpected fixup kinds.Daniel Dunbar2010-12-221-6/+3
| | | | llvm-svn: 122409
* MC/Mach-O/ARM: Recognize generic _Data_N fixup kinds.Daniel Dunbar2010-12-221-0/+16
| | | | llvm-svn: 122408
* MC/Mach-O/ARM: Add enough relocation logic to get BR24 relocations.Daniel Dunbar2010-12-221-3/+26
| | | | llvm-svn: 122407
* MC/Mach-O/ARM: Fix thinko.Daniel Dunbar2010-12-221-1/+1
| | | | llvm-svn: 122406
OpenPOWER on IntegriCloud