summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCObjectFileInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* COFF: Consistently format the DWARF sectionsDavid Majnemer2015-02-221-45/+44
| | | | llvm-svn: 230155
* Compute the ELF SectionKind from the flags.Rafael Espindola2015-01-291-132/+66
| | | | | | | | | | | | Any code creating an MCSectionELF knows ELF and already provides the flags. SectionKind is an abstraction used by common code that uses a plain MCSection. Use the flags to compute the SectionKind. This removes a lot of guessing and boilerplate from the MCSectionELF construction. llvm-svn: 227476
* Commit back the correct bits of r222760 (was r222538).Rafael Espindola2014-11-271-0/+6
| | | | | | | | | | | | | | | | | I also added a test. Original message: Allow FDE references outside the +/-2GB range supported by PC relative offsets for code models other than small/medium. For JIT application, memory layout is less controlled and can result in truncations otherwise. Patch from Akos Kiss. Differential Revision: http://reviews.llvm.org/D6079 llvm-svn: 222897
* Revert "Reapply 222538 and update tests to explicitly request small code ↵Rafael Espindola2014-11-271-11/+0
| | | | | | | | | | | | | | | | model and PIC:" This reverts commit r222760. It changed our behaviour on PIC so we don't match gas anymore. It also included lots of unnecessary changes to tests. If those changes are desirable, there should be an independent discussion as they are out of scope for that patch. I will recommit the other bits. llvm-svn: 222896
* Reapply 222538 and update tests to explicitly request small code modelJoerg Sonnenberger2014-11-251-0/+11
| | | | | | | | | | | | | | | and PIC: Allow FDE references outside the +/-2GB range supported by PC relative offsets for code models other than small/medium. For JIT application, memory layout is less controlled and can result in truncations otherwise. Patch from Akos Kiss. Differential Revision: http://reviews.llvm.org/D6079 llvm-svn: 222760
* Tidied up target triple OS detection. NFCSimon Pilgrim2014-11-221-1/+1
| | | | | | Use Triple::isOS*() helper functions where possible. llvm-svn: 222622
* Revert "Allow FDE references outside the +/-2GB range supported by PC ↵Duncan P. N. Exon Smith2014-11-211-11/+0
| | | | | | | | | | | | | | | | | relative offsets for code models other than small/medium. For JIT application, memory layout is less controlled and can result in truncations otherwise." This reverts commit r222538. It's causing test failures for CFI, at least on Darwin: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental/1189/ http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/1391/ Note that the previous incremental build was on r222537, and the CFI tests weren't failing: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental/1188/ llvm-svn: 222542
* Allow FDE references outside the +/-2GB range supported by PC relativeJoerg Sonnenberger2014-11-211-0/+11
| | | | | | | | | | | | offsets for code models other than small/medium. For JIT application, memory layout is less controlled and can result in truncations otherwise. Patch from Akos Kiss. Differential Revision: http://reviews.llvm.org/D6079 llvm-svn: 222538
* COFF: Add support for Dwarf accelerator tables.Frederic Riss2014-11-141-0/+21
| | | | | | | | | This allows COFF targets to emit accelerator tables when requested by -dwarf-accel-tables=Enable instead of aborting. The test DebugInfo/cross-cu-inlining.ll covers this on COFF platforms. llvm-svn: 222034
* [mips64] Fix MIPS64 exception personality encodingPetar Jovanovic2014-11-051-0/+2
| | | | | | | | | | | Remove dynamic relocations of __gxx_personality_v0 from the .eh_frame. The MIPS64 follow-up of the MIPS32 fix (rL209907). Patch by Vladimir Stefanovic. Differential Revision: http://reviews.llvm.org/D6141 llvm-svn: 221408
* MC: Support aligned COMMON symbols for COFFDavid Majnemer2014-09-211-3/+1
| | | | | | | | | | | | | | | | | | | | | link.exe: Fuzz testing has shown that COMMON symbols with size > 32 will always have an alignment of at least 32 and all symbols with size < 32 will have an alignment of at least the largest power of 2 less than the size of the symbol. binutils: The BFD linker essentially work like the link.exe behavior but with alignment 4 instead of 32. The BFD linker also supports an extension to COFF which adds an -aligncomm argument to the .drectve section which permits specifying a precise alignment for a variable but MC currently doesn't support editing .drectve in this way. With all of this in mind, we decide to play a little trick: we can ensure that the alignment will be respected by bumping the size of the global to it's alignment. llvm-svn: 218201
* Add support for StackMap section for ELF/Linux systemsPhilip Reames2014-08-011-0/+6
| | | | | | | | | | This patch adds code to emits the StackMap section on ELF systems. This section is required to support llvm.experimental.stackmap and llvm.experimental.patchpoint intrinsics. Reviewers: ributzka, echristo Differential Revision: http://reviews.llvm.org/D4574 llvm-svn: 214538
* Reapply "DebugInfo: Don't put fission type units in comdat sections."David Blaikie2014-07-251-7/+7
| | | | | | | | | | | | | | | | This recommits r208930, r208933, and r208975 (by reverting r209338) and reverts r209529 (the FIXME to readd this functionality once the tools were fixed) now that DWP has been fixed to cope with a single section for all fission type units. Original commit message: "Since type units in the dwo file are handled by a debug aware tool, they don't need to leverage the ELF comdat grouping to implement deduplication. Avoid creating all the .group sections for these as a space optimization." llvm-svn: 213956
* Use the same .eh_frame encoding for 32bit PPC as on i386.Joerg Sonnenberger2014-07-241-0/+1
| | | | llvm-svn: 213890
* AArch64: remove arm64 triple enumerator.Tim Northover2014-07-231-7/+4
| | | | | | | | | | | | Having both Triple::arm64 and Triple::aarch64 is extremely confusing, and invites bugs where only one is checked. In reality, the only legitimate difference between the two (arm64 usually means iOS) is also present in the OS part of the triple and that's what should be checked. We still parse the "arm64" triple, just canonicalise it to Triple::aarch64, so there aren't any LLVM-side test changes. llvm-svn: 213743
* Re-apply r211399, "Generate native unwind info on Win64" with a fix to ↵NAKAMURA Takumi2014-06-251-5/+10
| | | | | | | | | | | | | | | | | | | | | | | ignore SEH pseudo ops in X86 JIT emitter. -- This patch enables LLVM to emit Win64-native unwind info rather than DWARF CFI. It handles all corner cases (I hope), including stack realignment. Because the unwind info is not flexible enough to describe stack frames with a gap of unknown size in the middle, such as the one caused by stack realignment, I modified register spilling code to place all spills into the fixed frame slots, so that they can be accessed relative to the frame pointer. Patch by Vadim Chugunov! Reviewed By: rnk Differential Revision: http://reviews.llvm.org/D4081 llvm-svn: 211691
* Stop producing func.eh symbols on Darwin.Rafael Espindola2014-06-231-2/+0
| | | | | | | | | | 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
* MC: adjust text section flags for WoASaleem Abdulrasool2014-06-221-8/+9
| | | | | | | | | | | | | | | | | | | | | | | Correct the section flags for code built for Windows on ARM with `-ffunction-sections`. Windows on ARM uses solely Thumb-2 instructions, and indicates that the function is thumb by placing it in a text section that has IMAGE_SCN_MEM_16BIT flag set. When we encounter a .section directive, a new section is constructed. This may be a text segment. In order to identify that we need the additional flag, expose the target triple through the ObjectFileInfo as this information is lost otherwise. Since any modern ARM targeting environment on Windows would be Thumb-2 (Windows ARM NT or Windows Embedded Compact), introducing a new flag to indicate the section attribute seems to be a bit overkill. Simply depend on the target triple. Since there is one location that this information is currently needed, creating a target specific assembly parser and delegating the parsing of section switches also feels a bit heavy handed. If it turns out that this information ends up changing additional behaviour, then it may be worth considering that alternative. llvm-svn: 211481
* Revert r211399, "Generate native unwind info on Win64"NAKAMURA Takumi2014-06-221-10/+5
| | | | | | It broke Legacy JIT Tests on x86_64-{mingw32|msvc}, aka Windows x64. llvm-svn: 211480
* Use compact unwind for the iOS simulator.Rafael Espindola2014-06-201-0/+5
| | | | | | Another step in fixing pr19185. llvm-svn: 211416
* Use a helper function and clang-format.Rafael Espindola2014-06-201-6/+19
| | | | | | No functionality change. llvm-svn: 211415
* Generate native unwind info on Win64Reid Kleckner2014-06-201-5/+10
| | | | | | | | | | | | | | | | | | | | This patch enables LLVM to emit Win64-native unwind info rather than DWARF CFI. It handles all corner cases (I hope), including stack realignment. Because the unwind info is not flexible enough to describe stack frames with a gap of unknown size in the middle, such as the one caused by stack realignment, I modified register spilling code to place all spills into the fixed frame slots, so that they can be accessed relative to the frame pointer. Patch by Vadim Chugunov! Reviewed By: rnk Differential Revision: http://reviews.llvm.org/D4081 llvm-svn: 211399
* Fix gcc warning (enumeral and non-enumeral type in conditional expression)Patrik Hagglund2014-06-091-1/+2
| | | | llvm-svn: 210450
* MC: fix text section characteristics for WoASaleem Abdulrasool2014-06-081-0/+3
| | | | | | | | | | link.exe requires that the text section has the IMAGE_SCN_MEM_16BIT flag set. Otherwise, it will treat the function as ARM. If this occurs, then jumps to the function will fail, switching from thumb to ARM mode execution. With this change, it is possible to link using the MSVC linker as well. llvm-svn: 210415
* MC: fix ctor/dtor section for windows-itaniumSaleem Abdulrasool2014-06-081-1/+1
| | | | | | | | This adjusts the section setup for the windows-itanium environment. This environment does not report to be a known windows msvc environment, even though it is (nearly) identical to the MSVC environment for C code. llvm-svn: 210406
* MC: whitespace, grouping for COFF section setupSaleem Abdulrasool2014-06-081-26/+33
| | | | | | | | Add some whitespace, combine two sequential conditionals into a single one. Reformat some section definitions to maintain uniformity in the function. NFC. llvm-svn: 210405
* Fix MIPS exception personality encoding.Logan Chien2014-05-301-0/+7
| | | | | | | | | For MIPS, we have to encode the personality routine with an indirect pointer to absptr; otherwise, some link warning warning will be raised, and the program might crash in some early MIPS Android device. llvm-svn: 209907
* AArch64/ARM64: move ARM64 into AArch64's placeTim Northover2014-05-241-4/+6
| | | | | | | | | | | | | | | 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
* Revert "DebugInfo: Don't put fission type units in comdat sections."David Blaikie2014-05-211-7/+7
| | | | | | | | | This reverts commit r208930, r208933, and r208975. It seems not all fission consumers are ready to handle this behavior. Reverting until tools are brought up to spec. llvm-svn: 209338
* MC: mark COFF .drectve section as REMOVESaleem Abdulrasool2014-05-211-1/+1
| | | | | | | | | The .drectve section should be marked as IMAGE_SCN_LNK_REMOVE. This matches what the MSVC toolchain does and accurately reflects that this section should not be emitted into the final binary. This section is merely information for the linker, comprising of additional linker directives. llvm-svn: 209273
* MC: Add DwarfTypesDWOSection also to MCCOFF.NAKAMURA Takumi2014-05-161-0/+4
| | | | llvm-svn: 208975
* DebugInfo: Don't put fission type units in comdat sections.David Blaikie2014-05-151-7/+3
| | | | | | | | | Since type units in the dwo file are handled by a debug aware tool, they don't need to leverage the ELF comdat grouping to implement deduplication. Avoid creating all the .group sections for these as a space optimization. llvm-svn: 208930
* Check explicitly for EHABI and just use the default settings.Joerg Sonnenberger2014-05-131-0/+4
| | | | | | Code depends on the assembler and linker to fix things up... llvm-svn: 208715
* Remove always true argument and unused field.Rafael Espindola2014-05-121-17/+3
| | | | llvm-svn: 208561
* Allow using normal .eh_frame based unwinding on ARM. Use the sameJoerg Sonnenberger2014-05-071-0/+4
| | | | | | encodings as x86. Use this exception model for NetBSD. llvm-svn: 208166
* Add missing breaks.Joerg Sonnenberger2014-04-301-0/+3
| | | | llvm-svn: 207723
* Switch over getArch()'s result.Joerg Sonnenberger2014-04-301-15/+28
| | | | llvm-svn: 207721
* [ARM64] Ensure arm64_be is dealt with when emitting debug info.James Molloy2014-04-301-1/+2
| | | | | | | This is a partial port of r204816 (cpirker "Elf support for MC-JIT runtime dynamic linker") from AArch64 to ARM64. llvm-svn: 207625
* MC: restore behaviour of defaulting to ELFSaleem Abdulrasool2014-04-271-4/+3
| | | | | | | This restores the previous behaviour of just assuming that if you dont specify a valid triple that you really meant the default triple with an ELF object file. llvm-svn: 207349
* Add WoA object file emission supportSaleem Abdulrasool2014-04-271-2/+4
| | | | | | | | | | | | | | | | | | | | | | Introduce support for WoA PE/COFF object file emission from LLVM. Add the new target specific PE/COFF Streamer (ARMWinCOFFStreamer) that handles the ARM specific behaviour of PE/COFF object emission. ARM exception information is not yet emitted and is a TODO item. The ARM specific object writer (ARMWinCOFFObjectWriter) handles the ARM specific relocation handling in conjunction with the WinCOFFObjectWriter in the MC layer. The MC layer needs to be updated to deal with the relocation adjustments. Branch relocations are adjusted by 4 bytes (unlikely their ELF counterparts). Minor tweaks to switch multiple conditional checks into equivalent switch statements. The ObjectFileInfo is updated to relax the object file setup for Windows COFF. Move the architecture checks into an assertion. Windows COFF is currently only supported on x86, x86_64, and ARM (thumb). Rather than defaulting to ELF, we will refuse to generate an object file. This is better though as you do not get an (arbitrary) object file which is different from the request. llvm-svn: 207345
* AArch64/ARM64: port across stub handling for ELF C++ exceptions.Tim Northover2014-04-161-2/+3
| | | | | | | | The most important part here is that we should actuall emit the stubs we refer to in the exception table, but as a side issue this uses more sensible & GCC compatible representations for some of the bits of information. llvm-svn: 206380
* [C++11] More 'nullptr' conversion or in some cases just using a boolean ↵Craig Topper2014-04-131-9/+9
| | | | | | check instead of comparing to nullptr. llvm-svn: 206129
* WinCOFF: Emit common symbols as specified in the COFF specDavid Majnemer2014-04-081-0/+4
| | | | | | | | | | | | | | | | | | Summary: Local common symbols were properly inserted into the .bss section. However, putting external common symbols in the .bss section would give them a strong definition. Instead, encode them as undefined, external symbols who's symbol value is equivalent to their size. Reviewers: Bigcheese, rafael, rnk CC: llvm-commits Differential Revision: http://reviews.llvm.org/D3324 llvm-svn: 205811
* ARM64: initial backend importTim Northover2014-03-291-1/+8
| | | | | | | | | | | | 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
* MC-exceptions: add support for compact-unwind without .eh_frameTim Northover2014-03-291-0/+1
| | | | | | | | | | | | ARM64 has compact-unwind information, but doesn't necessarily want to emit .eh_frame directives as well. This teaches MC about such a situation so that it will skip .eh_frame info when compact unwind has been successfully produced. For functions incompatible with compact unwind, the normal information is still written. llvm-svn: 205087
* Canonicalise Windows target triple spellingsSaleem Abdulrasool2014-03-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Construct a uniform Windows target triple nomenclature which is congruent to the Linux counterpart. The old triples are normalised to the new canonical form. This cleans up the long-standing issue of odd naming for various Windows environments. There are four different environments on Windows: MSVC: The MS ABI, MSVCRT environment as defined by Microsoft GNU: The MinGW32/MinGW32-W64 environment which uses MSVCRT and auxiliary libraries Itanium: The MSVCRT environment + libc++ built with Itanium ABI Cygnus: The Cygwin environment which uses custom libraries for everything The following spellings are now written as: i686-pc-win32 => i686-pc-windows-msvc i686-pc-mingw32 => i686-pc-windows-gnu i686-pc-cygwin => i686-pc-windows-cygnus This should be sufficiently flexible to allow us to target other windows environments in the future as necessary. llvm-svn: 204977
* AArch64_BE Elf support for MC-JIT runtime dynamic linkerChristian Pirker2014-03-261-1/+2
| | | | llvm-svn: 204816
* DebugInfo: Add fission-related sections to COFFDavid Blaikie2014-03-261-0/+27
| | | | | | | Allows this test to pass on COFF platforms so we don't need to restrict this test to a single target anymore. llvm-svn: 204780
* MC: Remove superfluous section attribute flag definitionsDavid Majnemer2014-03-071-42/+42
| | | | | | | | | | | | | | | | | | | 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
* Reapply "MC: simplify object file selection for Windows"Saleem Abdulrasool2014-03-061-3/+2
| | | | | | | | That was overly aggressive in assuming that we could always assume COFF. Some of the tests assume that they will get ELF rather than COFF even on Windows where the default is COFF. llvm-svn: 203176
OpenPOWER on IntegriCloud