summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Add size of section header to data relocation offsets.Sam Clegg2017-04-281-9/+12
| | | | | | | | | | | Also, add test for data relocations and fix addend to be signed. Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32513 llvm-svn: 301690
* [WebAssembly] Write initial memory in pages not bytesSam Clegg2017-04-281-2/+4
| | | | | | | | Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32660 llvm-svn: 301687
* Rename some PDB classes.Zachary Turner2017-04-271-3/+3
| | | | | | | | | | | | | | | | | | | We have a lot of very similarly named classes related to dealing with module debug info. This patch has NFC, it just renames some classes to be more descriptive (albeit slightly more to type). The mapping from old to new class names is as follows: Old | New ModInfo | DbiModuleDescriptor ModuleSubstream | ModuleDebugFragment ModStream | ModuleDebugStream With the corresponding Builder classes renamed accordingly. Differential Revision: https://reviews.llvm.org/D32506 llvm-svn: 301555
* [MC] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC).Eugene Zelenko2017-04-263-12/+13
| | | | llvm-svn: 301485
* PR31007 and PR27884 will be closed: a possibility to compile constants like ↵Andrew V. Tischenko2017-04-261-6/+7
| | | | | | 0bH is now supported in MS asm. llvm-svn: 301390
* [WebAssembly] Fix relocation count in wasm binaries with call_indirectSam Clegg2017-04-251-1/+1
| | | | | | | | Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32459 llvm-svn: 301331
* Distinguish between code pointer size and DataLayout::getPointerSize() in ↵Konstantin Zhuravlyov2017-04-172-12/+13
| | | | | | DWARF info generation llvm-svn: 300463
* This patch closes PR#32216: Better testing of schedule model instruction ↵Andrew V. Tischenko2017-04-143-9/+31
| | | | | | | | latencies/throughputs. The details are here: https://reviews.llvm.org/D30941 llvm-svn: 300311
* MC: Remove unused virtual function MCObjectWriter::isWeak. NFC.Peter Collingbourne2017-04-083-45/+1
| | | | llvm-svn: 299817
* [AsmParser]Emit an error if a macro has two (or more) parameters sharing the ↵Coby Tayree2017-04-081-0/+6
| | | | | | | | | | | | | same name Introducing a new error to macro parameters' parsing: currently, llvm-mc won't complain if a macro have two (or more) named params with the same name. this behavior is false, as there's no merit in having some params sharing a name. now, instead of tolerate such a phenomena - emit an appropriate error. Differential Revision: https://reviews.llvm.org/D31674 llvm-svn: 299815
* StringTableBuilder: Don't assert when writing an empty raw string table.Peter Collingbourne2017-04-061-1/+1
| | | | llvm-svn: 299602
* Add MCContext argument to MCAsmBackend::applyFixup for error reportingAlex Bradbury2017-04-051-2/+2
| | | | | | | | | | | | | | | | A number of backends (AArch64, MIPS, ARM) have been using MCContext::reportError to report issues such as out-of-range fixup values in their TgtAsmBackend. This is great, but because MCContext couldn't easily be threaded through to the adjustFixupValue helper function from its usual callsite (applyFixup), these backends ended up adding an MCContext* argument and adding another call to applyFixup to processFixupValue. Adding an MCContext parameter to applyFixup makes this unnecessary, and even better - applyFixup can take a reference to MCContext rather than a potentially null pointer. Differential Revision: https://reviews.llvm.org/D30264 llvm-svn: 299529
* [MC] Set defaults based on section names and support name suffixesPetr Hosek2017-04-041-6/+15
| | | | | | | | | | | | | Set correct default flags and section type based on its name for .text, .data, .bss, .init_array, .fini_array, .preinit_array, .tdata, and .tbss and support section name suffixes for .data.*, .rodata.*, .text.*, .bss.*, .tdata.* and .tbss.* which matches the behavior of GAS. Fixes PR31888. Differential Revision: https://reviews.llvm.org/D30229 llvm-svn: 299484
* Change section flag character for SHF_LINK_ORDER to "o".Evgeniy Stepanov2017-04-042-2/+2
| | | | | | | | GAS uses "m" as a compatibility alias for "M" (SHF_MERGE). "o" is free, except on ia64, where it already means SHF_LINK_ORDER. llvm-svn: 299479
* [X86][inline-asm] Add support for MS 'EVEN' directiveCoby Tayree2017-04-041-1/+1
| | | | | | | | | | | | MS assembly syntax provide us with the 'EVEN' directive as a synonymous to at&t '.even'. This patch include the (small, simple) changes need to allow it. Test is provided at the following (clang-side) review: https://reviews.llvm.org/D27418 Differential Revision: https://reviews.llvm.org/D27417 llvm-svn: 299453
* Reland r298901 with modifications (reverted in r298932)Weiming Zhao2017-04-032-4/+24
| | | | | | | | | | | | | | | | | | | Dont emit Mapping symbols for sections that contain only data. Summary: Dont emit mapping symbols for sections that contain only data. Reviewers: rengolin, weimingz, kparzysz, t.p.northover, peter.smith Reviewed By: t.p.northover Patched by Shankar Easwaran <shankare@codeaurora.org> Subscribers: alekseyshl, t.p.northover, llvm-commits Differential Revision: https://reviews.llvm.org/D30724 llvm-svn: 299392
* Fix signed/unsigned warningSimon Pilgrim2017-03-311-1/+1
| | | | llvm-svn: 299194
* [WebAssembly] Initial linking metadata supportDan Gohman2017-03-301-23/+123
| | | | | | | | | | | | | | | | Add support for the new relocations and linking metadata section support in https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md. In particular, this allows LLVM to indicate which variable is the stack pointer, so that it can be linked with other objects. This also adds support for emitting type relocations for call_indirect instructions. Right now, this is mainly tested by using wabt and hexdump to examine the output on selected testcases. We'll add more tests as the design stablizes and more of the pieces are in place. llvm-svn: 299141
* Revert "Dont emit Mapping symbols for sections that contain only data."Weiming Zhao2017-03-282-24/+4
| | | | | | | | It breaks some lld tests. This reverts commit 3a50eea6d9732ab40e9a7aebe6be777b53a8b35c. llvm-svn: 298932
* Dont emit Mapping symbols for sections that contain only data.Weiming Zhao2017-03-282-4/+24
| | | | | | | | | | | | | | | | | Summary: Dont emit mapping symbols for sections that contain only data. Patched by Shankar Easwaran <shankare@codeaurora.org> Reviewers: rengolin, peter.smith, weimingz, kparzysz, t.p.northover Reviewed By: t.p.northover Subscribers: t.p.northover, llvm-commits Differential Revision: https://reviews.llvm.org/D30724 llvm-svn: 298901
* [WebAssembly] Fix import type to be signed LEBsDerek Schuff2017-03-231-1/+1
| | | | | | | | | | | | | | This fix is a follow up a previous change with stored value types as signed integers in memory. In future, once the yaml<->wasm binary patche lands we can add test coverage for this kind of thing. Differential Revision: https://reviews.llvm.org/D31227 Patch by Sam Clegg llvm-svn: 298612
* Add default typo to .tbss.*Rafael Espindola2017-03-221-0/+2
| | | | | | This matches gas behavior and is part of pr31888. llvm-svn: 298508
* Set the default type for .bss.foo.Rafael Espindola2017-03-221-0/+2
| | | | | | This matches gas and is part of pr31888. llvm-svn: 298506
* Produce INIT_ARRAY for sections named .init_array.*Rafael Espindola2017-03-221-1/+5
| | | | | | | These sections are merged together by the linker, so they should have the same time. llvm-svn: 298505
* [Asm] Don't list '@<type>' in diag when '@' is a commentOliver Stannard2017-03-171-2/+6
| | | | | | | | This fixes https://bugs.llvm.org//show_bug.cgi?id=31280 Differential revision: https://reviews.llvm.org/D31026 llvm-svn: 298067
* [WebAssembly] Fix some broken type encodings in wasm binaryDerek Schuff2017-03-161-9/+9
| | | | | | | | | | | | A recent change switch the in-memory wasm value types to be signed integers, but I missing a few cases where these were being writing to the binary. Differential Revision: https://reviews.llvm.org/D31014 Patch by Sam Clegg llvm-svn: 297991
* Check that line table entries don't spill over between sections even if ↵David Blaikie2017-03-161-0/+1
| | | | | | they're empty at the end of a section llvm-svn: 297922
* Simplify/make more explicit (by making less explicit in some ways) some ↵David Blaikie2017-03-162-2/+2
| | | | | | function calls llvm-svn: 297921
* [WebAssembly] Update format of 'names' section.Derek Schuff2017-03-151-6/+11
| | | | | | | | | | | | This change updates to the format of the 'names' sectionin the generated wasm binary to match the latest changesto the design and 'wabt'. Differential Revision: https://reviews.llvm.org/D30950 Patch by Sam Clegg llvm-svn: 297877
* [WebAssembly] Use LEB encoding for value typesDerek Schuff2017-03-141-20/+24
| | | | | | | | | | | | Previously we were using the encoded LEB hex values for the value types. This change uses the decoded negative value and the LEB encoder to write them out. Differential Revision: https://reviews.llvm.org/D30847 Patch by Sam Clegg llvm-svn: 297777
* Fix asm printing of associated sections.Evgeniy Stepanov2017-03-144-20/+32
| | | | | | | Make MCSectionELF::AssociatedSection be a link to a symbol, because that's how it works in the assembly, and use it in the asm printer. llvm-svn: 297769
* [Assembler] Add location info to unary expressions.Sanne Wouda2017-03-102-6/+6
| | | | | | | | | | | | | | | | | Summary: This is a continuation of D28861. Add an SMLoc to MCUnaryExpr such that a better diagnostic can be given in case of an error in later stages of assembling. Reviewers: rengolin, grosbach, javed.absar, olista01 Reviewed By: olista01 Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D30581 llvm-svn: 297454
* [MC] Set SHT_MIPS_DWARF section type for all .debug_* sections on MIPSSimon Atanasyan2017-03-102-23/+36
| | | | | | | | | | | | All MIPS .debug_* sections should be marked with ELF type SHT_MIPS_DWARF accordingly the specification [1]. Also the same section type is assigned to these sections by GNU tools. [1] ftp.software.ibm.com/software/os390/czos/dwarf/mips_extensions.pdf Differential Revision: https://reviews.llvm.org/D29789 llvm-svn: 297447
* [MC] Accept a numeric value as an ELF section header's typeSimon Atanasyan2017-03-102-2/+9
| | | | | | | | | | | | | | | | | | | | | | GAS supports specification of section header's type using a numeric value [1]. This patch brings the same functionality to LLVM. That allows to setup some target-specific section types belong to the SHT_LOPROC - SHT_HIPROC range. If we attempt to print unknown section type, MCSectionELF class shows an error message. It's better than print sole '@' sign without any section type name. In case of MIPS, example of such section's type is SHT_MIPS_DWARF. Without the patch we will have to implement some workarounds in probably not-MIPS-specific part of code base to convert SHT_MIPS_DWARF to the @progbits while printing assembly and to assign SHT_MIPS_DWARF for @progbits sections named .debug_* if we encounter such section in an input assembly. [1] https://sourceware.org/binutils/docs/as/Section.html Differential Revision: https://reviews.llvm.org/D29719 llvm-svn: 297446
* Perform symbol binding for .symver versioned symbolsTeresa Johnson2017-03-092-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In a .symver assembler directive like: .symver name, name2@@nodename "name2@@nodename" should get the same symbol binding as "name". While the ELF object writer is updating the symbol binding for .symver aliases before emitting the object file, not doing so when the module inline assembly is handled by the RecordStreamer is causing the wrong behavior in *LTO mode. E.g. when "name" is global, "name2@@nodename" must also be marked as global. Otherwise, the symbol is skipped when iterating over the LTO InputFile symbols (InputFile::Symbol::shouldSkip). So, for example, when performing any *LTO via the gold-plugin, the versioned symbol definition is not recorded by the plugin and passed back to the linker. If the object was in an archive, and there were no other symbols needed from that object, the object would not be included in the final link and references to the versioned symbol are undefined. The llvm-lto2 tests added will give an error about an unused symbol resolution without the fix. Reviewers: rafael, pcc Reviewed By: pcc Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D30485 llvm-svn: 297332
* Silence a warning "hiding virtual function".Vassil Vassilev2017-03-061-0/+1
| | | | llvm-svn: 297018
* MC: De-duplicate the object streamer implementations of EmitFileDirective ↵Peter Collingbourne2017-03-036-25/+6
| | | | | | into MCObjectStreamer. NFCI. llvm-svn: 296912
* [DWARFv5] llvm-mc support for new unit header.Paul Robinson2017-02-281-5/+9
| | | | | | | | | This is for running the assembler with -g (to emit DWARF describing the assembler source). Differential Revision: http://reviews.llvm.org/D30475 llvm-svn: 296541
* [MC] Implement the COFF directives in MCNullStreamer.Dan Gohman2017-02-271-0/+4
| | | | | | This fixes -filetype=null errors introduced in r296403. llvm-svn: 296410
* [MC] Factor out non-COFF handling of COFF-specific directives.Dan Gohman2017-02-274-52/+12
| | | | | | | | | Instead of requiring every non-COFF MCObjectStreamer to implement the COFF hooks just to do an llvm_unreachable to say that they're not supported, do the llvm_unreachable in the default implementation, as suggested by rnk in https://reviews.llvm.org/D26722. llvm-svn: 296403
* [WebAssembly] Add some comments and tidy up whitespace.Dan Gohman2017-02-271-2/+3
| | | | llvm-svn: 296402
* [WebAssembly] Add support for using a wasm global for the stack pointer.Dan Gohman2017-02-241-0/+24
| | | | | | | This replaces the __stack_pointer variable which was allocated in linear memory. llvm-svn: 296201
* [WebAssembly] Basic support for Wasm object file encoding.Dan Gohman2017-02-244-10/+941
| | | | | | | | | With the "wasm32-unknown-unknown-wasm" triple, this allows writing out simple wasm object files, and is another step in a larger series toward migrating from ELF to general wasm object support. Note that this code and the binary format itself is still experimental. llvm-svn: 296190
* Disallow redefinition of section symbols.Evgeniy Stepanov2017-02-241-1/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D30235 llvm-svn: 296180
* Initialize MCContext::InlineSrcMgr in the constructor.Evgeniy Stepanov2017-02-241-2/+3
| | | | | | Found with ASan (and a local source change) on test/CodeGen/XCore/section-name.ll. llvm-svn: 296179
* [WebAssembly] Implement the wasm binary container header.Dan Gohman2017-02-221-1/+3
| | | | | | | Also, update the version number to 0x1, which is what engines are now expecting. llvm-svn: 295860
* [WebAssembly] Add skeleton MC support for the Wasm container formatDan Gohman2017-02-229-2/+587
| | | | | | | | | This just adds the basic skeleton for supporting a new object file format. All of the actual encoding will be implemented in followup patches. Differential Revision: https://reviews.llvm.org/D26722 llvm-svn: 295803
* SubtargetFeature: Cleanup; NFCMatthias Braun2017-02-211-65/+31
| | | | | | | | | - Fix doxygen comments - Remove duplicated comments - Remove section comments (which became wrong over time) - Use more `const` and references but less `auto` llvm-svn: 295687
* MC/COFF: Do not emit forward associative section referenceds.Rui Ueyama2017-02-171-26/+53
| | | | | | | | | | | | | | | | MSVC link.exe cannot handle associative sections that refer later sections in the section header. Technically, such COFF object doesn't violate the Microsoft COFF spec, as the spec doesn't say anything about that, but still we should avoid doing that to make it compatible with MS tools. This patch assigns smaller section numbers to non-associative sections and larger numbers to associative sections. This should resolve the compatibility issue. Differential Revision: https://reviews.llvm.org/D30080 llvm-svn: 295464
* Split WinCOFFObjectWriter::writeSection.Rui Ueyama2017-02-161-28/+39
| | | | llvm-svn: 295276
OpenPOWER on IntegriCloud