summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCObjectFileInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.Daniel Sanders2015-06-021-3/+9
| | | | | | | | | | | | | | | | | | | | | Summary: Following on from r209907 which made personality encodings indirect, do the same for TType encodings. This fixes the case where a try/catch block needs to generate references to, for example, std::exception in the .gcc_except_table. Previous attempts at committing this broke the buildbots due to bugs in IAS. These bugs have now been fixed so trying again. Reviewers: petarj Reviewed By: petarj Subscribers: srhines, joerg, tberghammer, llvm-commits Differential Revision: http://reviews.llvm.org/D9669 llvm-svn: 238863
* [WinCOFF] Add support for the .safeseh directiveDavid Majnemer2015-05-301-0/+3
| | | | | | | | | .safeseh adds an entry to the .sxdata section to register all the appropriate functions which may handle an exception. This entry is not a relocation to the symbol but instead the symbol table index of the function. llvm-svn: 238641
* Revert r238427 - [mips] Make TTypeEncoding indirect to allow .eh_frame to be ↵Daniel Sanders2015-05-281-10/+3
| | | | | | | | read-only. It caused a smaller number of failures than the previous attempt at committing but still caused a couple on the llvm-linux-mips builder. Reverting while I investigate the remainder. llvm-svn: 238483
* [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.Daniel Sanders2015-05-281-3/+10
| | | | | | | | | | | | | | | | | | Summary: Following on from r209907 which made personality encodings indirect, do the same for TType encodings. This fixes the case where a try/catch block needs to generate references to, for example, std::exception in the .gcc_except_table. Reviewers: petarj Reviewed By: petarj Subscribers: srhines, joerg, tberghammer, llvm-commits Differential Revision: http://reviews.llvm.org/D9669 llvm-svn: 238427
* Revert r238190 and r238197: [mips] Make TTypeEncoding indirect to allow ↵Daniel Sanders2015-05-271-14/+3
| | | | | | | | | | .eh_frame to be read-only. This broke the llvm-mips-linux builder and several of our out-of-tree builders. Initial investigations show that the commit probably isn't the problem but reverting anyway while I investigate. llvm-svn: 238302
* [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.Daniel Sanders2015-05-261-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Following on from r209907 which made personality encodings indirect, do the same for TType encodings. This fixes the case where a try/catch block needs to generate references to, for example, std::exception in the .gcc_except_table. This commit uses DW_EH_PE_sdata8 for N64 as far as is possible at the moment. However, it is possible to end up with DW_EH_PE_sdata4 when a TargetMachine is not available. There's no risk of issues with inconsistency here since the tables are self describing but it does mean there is a small chance of the PC-relative offset being out of range for particularly large programs. Reviewers: petarj Reviewed By: petarj Subscribers: srhines, joerg, tberghammer, llvm-commits Differential Revision: http://reviews.llvm.org/D9669 llvm-svn: 238190
* Move alignment from MCSectionData to MCSection.Rafael Espindola2015-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This starts merging MCSection and MCSectionData. There are a few issues with the current split between MCSection and MCSectionData. * It optimizes the the not as important case. We want the production of .o files to be really fast, but the split puts the information used for .o emission in a separate data structure. * The ELF/COFF/MachO hierarchy is not represented in MCSectionData, leading to some ad-hoc ways to represent the various flags. * It makes it harder to remember where each item is. The attached patch starts merging the two by moving the alignment from MCSectionData to MCSection. Most of the patch is actually just dropping 'const', since MCSectionData is mutable, but MCSection was not. llvm-svn: 237936
* Respect object format choice on DarwinKeno Fischer2015-05-041-1/+1
| | | | | | | | | | | | | | | Summary: The object format can be set to something other than MachO, e.g. to use ELF-on-Darwin for MCJIT. This already works on Windows, so there's no reason it shouldn't on Darwin. Reviewers: lhames, grosbach Subscribers: rafael, grosbach, t.p.northover, llvm-commits Differential Revision: http://reviews.llvm.org/D6185 llvm-svn: 236455
* [Sparc] Really add sparcel architecture support.Douglas Katzman2015-04-291-0/+1
| | | | | | | | Mostly copy-and-paste from Sparc v8 architecture. Differential Revision: http://reviews.llvm.org/D8741 llvm-svn: 236146
* Don't print labels that on ELF are never used.Rafael Espindola2015-03-111-16/+14
| | | | llvm-svn: 231904
* Add missing section symbol to COFF's .debug_types.dwo.Rafael Espindola2015-03-101-1/+1
| | | | | | | | | Should bring the cygwin bots back. I added a triple to the test that was failing so that it would have failed on Linux. llvm-svn: 231882
* Create symbols marking the start of a section earlier.Rafael Espindola2015-03-101-50/+55
| | | | | | | | | This lets us pass the symbol to the constructor and avoid the mutable field. This also opens the way for outputting the symbol only when needed, instead of outputting them at the start of the file. llvm-svn: 231859
* clang-format code that is about to change.Rafael Espindola2015-03-101-275/+209
| | | | llvm-svn: 231848
* Remove useless .debug_macinfo section setup.Paul Robinson2015-03-021-12/+0
| | | | llvm-svn: 231001
* COFF: Add 'IMAGE_SCN_CNT_INITIALIZED_DATA' to all DWARF sectionsDavid Majnemer2015-02-221-0/+25
| | | | | | | The CodeView debug info section, .debug$S, also has this set. MinGW sets this bit for their DWARF sections as well. llvm-svn: 230156
* 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
OpenPOWER on IntegriCloud