summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MachObjectWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* MC: Remove superfluous section attribute flag definitionsDavid Majnemer2014-03-071-8/+8
| | | | | | | | | | | | | | | | | | | Summary: llvm/MC/MCSectionMachO.h and llvm/Support/MachO.h both had the same definitions for the section flags. Instead, grab the definitions out of support. No functionality change. Reviewers: grosbach, Bigcheese, rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2998 llvm-svn: 203211
* Correct word hyphenationsAlp Toker2013-12-051-2/+2
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities and contractions in nearby lines. llvm-svn: 196471
* MachO: Improve backend diagnostic for overalignment.Jim Grosbach2013-09-241-1/+2
| | | | | | Give the symbol's name and disengage the enchanced crash reporting. llvm-svn: 191344
* Add names for mach-o permissions bits and use the symbol names in place of ↵Nick Kledzik2013-09-041-2/+4
| | | | | | magic numbers llvm-svn: 190013
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-09-011-46/+46
| | | | llvm-svn: 189728
* The integrated darwin assembler can hang in an infinite loop (or get an assert Kevin Enderby2013-08-281-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 189497
* Revert "Fix the build broken by r189315." and "Move everything depending on ↵Charles Davis2013-08-271-46/+46
| | | | | | | | | 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. llvm-svn: 189321
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-08-271-46/+46
| | | | llvm-svn: 189315
* [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
OpenPOWER on IntegriCloud