summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/MachO
Commit message (Collapse)AuthorAgeFilesLines
...
* [AsmPrinter][TLOF] 32-bit MachO support for replacing GOT equivalentsBruno Cardoso Lopes2015-03-061-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | Add MachO 32-bit (i.e. arm and x86) support for replacing global GOT equivalent symbol accesses. Unlike 64-bit targets, there's no GOTPCREL relocation, and access through a non_lazy_symbol_pointers section is used instead. -- before _extgotequiv: .long _extfoo _delta: .long _extgotequiv-_delta -- after _delta: .long L_extfoo$non_lazy_ptr-_delta .section __IMPORT,__pointers,non_lazy_symbol_pointers L_extfoo$non_lazy_ptr: .indirect_symbol _extfoo .long 0 llvm-svn: 231475
* [AsmPrinter][TLOF] ARM64 MachO support for replacing GOT equivalentsBruno Cardoso Lopes2015-03-061-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow up r230264 and add ARM64 support for replacing global GOT equivalent symbol accesses by references to the GOT entry for the final symbol instead, example: -- before .globl _foo _foo: .long 42 .globl _gotequivalent _gotequivalent: .quad _foo .globl _delta _delta: .long _gotequivalent-_delta -- after .globl _foo _foo: .long 42 .globl _delta Ltmp3: .long _foo@GOT-Ltmp3 llvm-svn: 231474
* [opaque pointer type] Add textual IR support for explicit type parameter to ↵David Blaikie2015-02-272-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | load instruction Essentially the same as the GEP change in r230786. A similar migration script can be used to update test cases, though a few more test case improvements/changes were required this time around: (r229269-r229278) import fileinput import sys import re pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)") for line in sys.stdin: sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line)) Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7649 llvm-svn: 230794
* Learn that __DATA,__objc_classrefs is not atomized via symbols.Rafael Espindola2015-02-121-0/+25
| | | | | | This should hopefully fix objc on AArch64. llvm-svn: 228976
* Add r224985 back with fixes.Rafael Espindola2015-01-193-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fixes are to note that AArch64 has additional restrictions on when local relocations can be used. In particular, ld64 requires that relocations to cstring/cfstrings use linker visible symbols. Original message: In an assembly expression like bar: .long L0 + 1 the intended semantics is that bar will contain a pointer one byte past L0. In sections that are merged by content (strings, 4 byte constants, etc), a single position in the section doesn't give the linker enough information. For example, it would not be able to tell a relocation must point to the end of a string, since that would look just like the start of the next. The solution used in ELF to use relocation with symbols if there is a non-zero addend. In MachO before this patch we would just keep all symbols in some sections. This would miss some cases (only cstrings on x86_64 were implemented) and was inefficient since most relocations have an addend of 0 and can be represented without the symbol. This patch implements the non-zero addend logic for MachO too. llvm-svn: 226503
* Add a test that would have found the issue with r225644.Rafael Espindola2015-01-141-0/+24
| | | | llvm-svn: 226035
* Revert "Add r224985 back with two fixes."Rafael Espindola2015-01-143-124/+0
| | | | | | This reverts commit r225644 while I debug a regression. llvm-svn: 226022
* Add r224985 back with two fixes.Rafael Espindola2015-01-123-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One is that AArch64 has additional restrictions on when local relocations can be used. We have to take those into consideration when deciding to put a L symbol in the symbol table or not. The other is that ld64 requires the relocations to cstring to use linker visible symbols on AArch64. Thanks to Michael Zolotukhin for testing this! Remove doesSectionRequireSymbols. In an assembly expression like bar: .long L0 + 1 the intended semantics is that bar will contain a pointer one byte past L0. In sections that are merged by content (strings, 4 byte constants, etc), a single position in the section doesn't give the linker enough information. For example, it would not be able to tell a relocation must point to the end of a string, since that would look just like the start of the next. The solution used in ELF to use relocation with symbols if there is a non-zero addend. In MachO before this patch we would just keep all symbols in some sections. This would miss some cases (only cstrings on x86_64 were implemented) and was inefficient since most relocations have an addend of 0 and can be represented without the symbol. This patch implements the non-zero addend logic for MachO too. llvm-svn: 225644
* Add a test that would have found the issue in r224935.Rafael Espindola2015-01-071-0/+24
| | | | llvm-svn: 225385
* Add a testcase that would have found the problem in r225048.Rafael Espindola2015-01-061-0/+27
| | | | llvm-svn: 225235
* Revert r225048: It broke ObjC on AArch64.Lang Hames2015-01-063-124/+0
| | | | | | I've filed http://llvm.org/PR22100 to track this issue. llvm-svn: 225228
* Add r224985 back with a fix.Rafael Espindola2014-12-313-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issues was that AArch64 has additional restrictions on when local relocations can be used. We have to take those into consideration when deciding to put a L symbol in the symbol table or not. Original message: Remove doesSectionRequireSymbols. In an assembly expression like bar: .long L0 + 1 the intended semantics is that bar will contain a pointer one byte past L0. In sections that are merged by content (strings, 4 byte constants, etc), a single position in the section doesn't give the linker enough information. For example, it would not be able to tell a relocation must point to the end of a string, since that would look just like the start of the next. The solution used in ELF to use relocation with symbols if there is a non-zero addend. In MachO before this patch we would just keep all symbols in some sections. This would miss some cases (only cstrings on x86_64 were implemented) and was inefficient since most relocations have an addend of 0 and can be represented without the symbol. This patch implements the non-zero addend logic for MachO too. llvm-svn: 225048
* Add a test for the recent compiler-rt build failure.Rafael Espindola2014-12-311-0/+14
| | | | llvm-svn: 225046
* Revert "Remove doesSectionRequireSymbols."Rafael Espindola2014-12-313-124/+0
| | | | | | | | This reverts commit r224985. I am investigating why it made an Apple bot unhappy. llvm-svn: 225044
* Remove doesSectionRequireSymbols.Rafael Espindola2014-12-303-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | In an assembly expression like bar: .long L0 + 1 the intended semantics is that bar will contain a pointer one byte past L0. In sections that are merged by content (strings, 4 byte constants, etc), a single position in the section doesn't give the linker enough information. For example, it would not be able to tell a relocation must point to the end of a string, since that would look just like the start of the next. The solution used in ELF to use relocation with symbols if there is a non-zero addend. In MachO before this patch we would just keep all symbols in some sections. This would miss some cases (only cstrings on x86_64 were implemented) and was inefficient since most relocations have an addend of 0 and can be represented without the symbol. This patch implements the non-zero addend logic for MachO too. llvm-svn: 224985
* Simplify test a bit.Rafael Espindola2014-12-301-516/+3
| | | | | | | | | | It looks like the original intent was to check which symbols were created. With macho-dump the sections were being checked just to match which symbol was in which section. llvm-objdump prints the section a symbol is in. llvm-svn: 224980
* Convert test to llvm-readobj. NFC.Rafael Espindola2014-12-301-127/+214
| | | | llvm-svn: 224973
* Convert test to llvm-readobj. NFC.Rafael Espindola2014-12-291-16/+41
| | | | llvm-svn: 224959
* Convert test to FileCheck. NFC.Rafael Espindola2014-12-291-876/+877
| | | | llvm-svn: 224950
* Convert test to llvm-readobj. NFC.Rafael Espindola2014-12-261-318/+361
| | | | llvm-svn: 224872
* Use llvm-readobj. NFC.Rafael Espindola2014-12-261-238/+162
| | | | llvm-svn: 224864
* IR: Make metadata typeless in assemblyDuncan P. N. Exon Smith2014-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that `Metadata` is typeless, reflect that in the assembly. These are the matching assembly changes for the metadata/value split in r223802. - Only use the `metadata` type when referencing metadata from a call intrinsic -- i.e., only when it's used as a `Value`. - Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode` when referencing it from call intrinsics. So, assembly like this: define @foo(i32 %v) { call void @llvm.foo(metadata !{i32 %v}, metadata !0) call void @llvm.foo(metadata !{i32 7}, metadata !0) call void @llvm.foo(metadata !1, metadata !0) call void @llvm.foo(metadata !3, metadata !0) call void @llvm.foo(metadata !{metadata !3}, metadata !0) ret void, !bar !2 } !0 = metadata !{metadata !2} !1 = metadata !{i32* @global} !2 = metadata !{metadata !3} !3 = metadata !{} turns into this: define @foo(i32 %v) { call void @llvm.foo(metadata i32 %v, metadata !0) call void @llvm.foo(metadata i32 7, metadata !0) call void @llvm.foo(metadata i32* @global, metadata !0) call void @llvm.foo(metadata !3, metadata !0) call void @llvm.foo(metadata !{!3}, metadata !0) ret void, !bar !2 } !0 = !{!2} !1 = !{i32* @global} !2 = !{!3} !3 = !{} I wrote an upgrade script that handled almost all of the tests in llvm and many of the tests in cfe (even handling many `CHECK` lines). I've attached it (or will attach it in a moment if you're speedy) to PR21532 to help everyone update their out-of-tree testcases. This is part of PR21532. llvm-svn: 224257
* IR: Canonicalize metadata formatting, NFCDuncan P. N. Exon Smith2014-12-111-5/+1
| | | | | | | | | | | | Canonicalize formatting of metadata to make it easier to upgrade via scripts -- in particular, one line per metadata definition makes it more `sed`-able. This is preparation for changing the assembly syntax for metadata [1]. [1]: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141208/248449.html llvm-svn: 224002
* Don't produce relocations for a difference in a section with no symbols.Rafael Espindola2014-11-041-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | We were producing a relocation for ---------------- .section foo,bar La: Lb: .long La-Lb -------------- but not for --------------------- .section foo,bar zed: La: Lb: .long La-Lb ---------------- This patch handles the case where both fragments are part of the first atom in a section and there is no corresponding symbol to that atom. This fixes pr21328. llvm-svn: 221304
* Update test to use llvm-readobj. NFC.Rafael Espindola2014-11-021-29/+9
| | | | llvm-svn: 221074
* Fix a Mach-O assembler segfault for a subtraction expression with an ↵Kevin Enderby2014-10-242-0/+12
| | | | | | | | | | | | | | | | | undefined symbol. In a Mach-O object file a relocatable expression of the form SymbolA - SymbolB + constant is allowed when both symbols are defined in a section. But when either symbol is undefined it is an error. The code was crashing when it had an undefined symbol in this case. And should have printed a error message using the location information in the relocation entry. rdar://18678402 llvm-svn: 220599
* Drop support for an old version of ld64 (from darwin 9).Rafael Espindola2014-10-212-32/+3
| | | | llvm-svn: 220310
* Convert two tests to use llvm-readobj.Rafael Espindola2014-10-212-32/+41
| | | | llvm-svn: 220308
* MachObjectWriter: optimize the string table for common sufficesHans Wennborg2014-10-0624-252/+252
| | | | | | | | This is a follow-up to r207670 (ELF) and r218636 (COFF). Differential Revision: http://reviews.llvm.org/D5622 llvm-svn: 219126
* [dwarfdump] Dump full filenames as DW_AT_(decl|call)_file attribute valuesFrederic Riss2014-09-221-3/+3
| | | | | | | | | | Reviewers: dblaikie samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5192 llvm-svn: 218246
* [dwarfdump] Dump DW_AT_(decl|call)_line attribute values as decimal values.Frederic Riss2014-09-051-3/+3
| | | | llvm-svn: 217232
* Reapply "[dwarfdump] Add missing DW_LANG_Mips_Assembler case to ↵Frederic Riss2014-09-051-1/+1
| | | | | | | | LanguageString()" This commit was reverted in r217183, but is OK to go in again now that its dependency is commited (as of r217186). llvm-svn: 217231
* Revert "[dwarfdump] Add missing DW_LANG_Mips_Assembler case to LanguageString()"Frederic Riss2014-09-041-1/+1
| | | | | | | | This reverts commit 93c7e6161e1adbd2c7ac81fa081823183035cb64. This commit got approved first, but was dependant on another one going in (The one pretty printing attribute values). I'll reapply when the other one is in. llvm-svn: 217183
* [dwarfdump] Add missing DW_LANG_Mips_Assembler case to LanguageString()Frederic Riss2014-09-041-1/+1
| | | | | | | | | | Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5193 llvm-svn: 217182
* Adds the next bit of support for llvm-objdump’s -private-headers for ↵Kevin Enderby2014-09-042-2/+2
| | | | | | | | | executable Mach-O files. This adds the printing of more load commands, so that the normal load commands in a typical X86 Mach-O executable can all be printed. llvm-svn: 217172
* X86: drop relocations on __eh_frame sections globally.Tim Northover2014-07-221-17/+3
| | | | | | | | | | | | | | Without this, we produce non-extern relocations when targeting older OS X versions that ld64 can't cope with in the particular context of __eh_frame sections (who'd want generic relocation-processing anyway?). This means that an updated linker (ld64 from Xcode 3.2.6 or later) may be needed when targeting such platforms with a modern version of LLVM, but this is probably the case anyway and a reasonable requirement. PR20212, rdar://problem/17544795 llvm-svn: 213665
* llvm-readobj: fix MachO relocatoin printing a bit.Tim Northover2014-07-041-2/+2
| | | | | | | | | | | | | | | | There were two issues here: 1. At the very least, scattered relocations cannot use the same code to determine the corresponding symbol being referred to. For some reason we pretend there is no symbol, even when one actually exists in the symtab, so to match this behaviour getRelocationSymbol should simply return symbols_end for scattered relocations. 2. Printing "-" when we can't get a symbol (including the scattered case, but not exclusively), isn't that helpful. In both cases there *is* interesting information in that field, so we should print it. As hex will do. Small part of rdar://problem/17553104 llvm-svn: 212332
* Change the default input for llvm-nm to be a.out instead of standard inputKevin Enderby2014-06-231-1/+1
| | | | | | | | | to match llvm-size and other UNIX systems for their nm(1). Tweak test cases that used llvm-nm with standard input to add a "-" to indicate that and add a test case to check the default of a.out for llvm-nm. llvm-svn: 211529
* Stop producing func.eh symbols on Darwin.Rafael Espindola2014-06-232-26/+1
| | | | | | | | | | According Nick Kledzik (http://llvm.org/bugs/show_bug.cgi?id=19430#c2): "... mach-o no longer needs names in the __eh_frame section (and has not for years)." Iain Sandoe confirms it is also unnecessary for their old darwin support. llvm-svn: 211500
* Always use a temp symbol for CIE.Rafael Espindola2014-06-201-0/+6
| | | | | | Fixes pr19185. llvm-svn: 211423
* Don't produce eh_frame relocations when targeting the IOS simulator.Rafael Espindola2014-06-201-0/+1
| | | | | | First step for fixing pr19185. llvm-svn: 211404
* Reduce verbiage of lit.local.cfg filesAlp Toker2014-06-093-6/+3
| | | | | | We can just split targets_to_build in one place and make it immutable. llvm-svn: 210496
* MachO: move test to ARM directory.Tim Northover2014-05-301-0/+0
| | | | | | | This test specifies an ARM triple, so it needs ARM as a registered target. llvm-svn: 209905
* MachO: support N_INDR aliases in assembly files.Tim Northover2014-05-302-4/+119
| | | | | | | | | This makes LLVM create N_INDR aliases (to be resolved by the linker) when appropriate. rdar://problem/15125513 llvm-svn: 209894
* AArch64/ARM64: move ARM64 into AArch64's placeTim Northover2014-05-243-1/+1
| | | | | | | | | | | | | | | This commit starts with a "git mv ARM64 AArch64" and continues out from there, renaming the C++ classes, intrinsics, and other target-local objects for consistency. "ARM64" test directories are also moved, and tests that began their life in ARM64 use an arm64 triple, those from AArch64 use an aarch64 triple. Both should be equivalent though. This finishes the AArch64 merge, and everyone should feel free to continue committing as normal now. llvm-svn: 209577
* This command line option is only used in one place. Move it there andEric Christopher2014-05-211-1/+1
| | | | | | rename it to something more descriptive. llvm-svn: 209263
* Fix the assembler to print a better relocatable expression errorKevin Enderby2014-04-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic that includes location information. Currently if one has this assembly: .quad (0x1234 + (4 * SOME_VALUE)) where SOME_VALUE is undefined ones gets the less than useful error message with no location information: % clang -c x.s clang -cc1as: fatal error: error in backend: expected relocatable expression With this fix one now gets a more useful error message with location information: % clang -c x.s x.s:5:8: error: expected relocatable expression .quad (0x1234 + (4 * SOME_VALUE)) ^ To do this I plumbed the SMLoc through the MCObjectStreamer EmitValue() and EmitValueImpl() interfaces so it could be used when creating the MCFixup. rdar://12391022 llvm-svn: 206906
* [MC] Emit an error if cfi_startproc is used before a symbol is defined.Quentin Colombet2014-04-151-0/+1
| | | | | | | | | Currently, we bind those directives with the last symbol, so if none has been defined, this would lead to a crash of the compiler. <rdar://problem/15939159> llvm-svn: 206236
* ARM: consolidate MachO checks for ARM asm parserSaleem Abdulrasool2014-04-051-9/+14
| | | | | | | | | | | | | | | | | | | This consolidates the duplicated MachO checks in the directive parsing for various directives that are unsupported for Mach-O. The error message change is unimportant as this restores the behaviour to that prior to the addition of the new directive handling. Furthermore, use a more direct check for MachO targeting rather than an indirect feature check of the assembler. Also simplify the test execution command to avoid temporary files. Further more, perform the check in both object and assembly emission. Whether all non-applicable directives are handled is another question. .fnstart is marked as being unsupported, however, the complementary .fnend is not. The additional unwinding directives are also still honoured. This change does not change that, though, it would be good to validate and mark them as being unsupported if they are unsupported for the MachO emission. llvm-svn: 205678
* ARM64: initial backend importTim Northover2014-03-293-0/+182
| | | | | | | | | | | | This adds a second implementation of the AArch64 architecture to LLVM, accessible in parallel via the "arm64" triple. The plan over the coming weeks & months is to merge the two into a single backend, during which time thorough code review should naturally occur. Everything will be easier with the target in-tree though, hence this commit. llvm-svn: 205090
OpenPOWER on IntegriCloud