summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/ELF
Commit message (Collapse)AuthorAgeFilesLines
...
* [MC/DWARF] Generate multiple .debug_line entries for adjacent .loc directivesUlrich Weigand2013-06-191-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | The compiler occasionally generates multiple .loc directives in a row (at the same instruction address). These need to be transformed into multple actual .debug_line table entries, since they are used to signal certain information to the debugger (e.g. if the opening brace of a function body is on the same line as the declaration). The MCAsmStreamer version of EmitDwarfLocDirective handles this correctly by emitting a .loc directive every time it is called. However, the MCObjectStream version simply defaults to recording the information and emitting only a single table entry later, e.g. when EmitInstruction is called. This patch introduces a MCAsmStreamer::EmitDwarfLocDirective version that emits a line table entry for a .loc directive that may already be pending before recording the new directive. (This is similar to how this is handled in GNU as.) With this patch (and the code alignment factor patch) applied, I'm now getting identical DWARF .debug sections for all test-suite object files on PowerPC for the internal and the external assembler. llvm-svn: 184357
* Don't hide the first ELF symbol.Rafael Espindola2013-06-053-1/+28
| | | | | | | | The first symbol on ELF is dummy, but it has a defined content and readelf normally displays it. With this change llvm-readobj also displays it and we can check that llvm-mc output is correct according to the standard. llvm-svn: 183337
* Change how we iterate over relocations on ELF.Rafael Espindola2013-05-3030-102/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | For COFF and MachO, sections semantically have relocations that apply to them. That is not the case on ELF. In relocatable objects (.o), a section with relocations in ELF has offsets to another section where the relocations should be applied. In dynamic objects and executables, relocations don't have an offset, they have a virtual address. The section sh_info may or may not point to another section, but that is not actually used for resolving the relocations. This patch exposes that in the ObjectFile API. It has the following advantages: * Most (all?) clients can handle this more efficiently. They will normally walk all relocations, so doing an effort to iterate in a particular order doesn't save time. * llvm-readobj now prints relocations in the same way the native readelf does. * probably most important, relocations that don't point to any section are now visible. This is the case of relocations in the rela.dyn section. See the updated relocation-executable.test for example. llvm-svn: 182908
* Add support for DWARF line number table entries for values in the instructionCameron Zwarich2013-05-251-4/+10
| | | | | | stream. llvm-svn: 182712
* Add support for subsections to the ELF assembler. Fixes PR8717.Peter Collingbourne2013-04-171-0/+37
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D598 llvm-svn: 179725
* Replace coff-/elf-dump with llvm-readobjNico Rieck2013-04-1279-3091/+2828
| | | | llvm-svn: 179361
* Use a scheme closer to that of GNU as when deciding the type of aPeter Collingbourne2013-04-101-9/+44
| | | | | | | | symbol with multiple .type declarations. Differential Revision: http://llvm-reviews.chandlerc.com/D607 llvm-svn: 179184
* Implements low-level object file format specific output for COFF andEric Christopher2013-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ELF with support for: - File headers - Section headers + data - Relocations - Symbols - Unwind data (only COFF/Win64) The output format follows a few rules: - Values are almost always output one per line (as elf-dump/coff-dump already do). - Many values are translated to something readable (like enum names), with the raw value in parentheses. - Hex numbers are output in uppercase, prefixed with "0x". - Flags are sorted alphabetically. - Lists and groups are always delimited. Example output: ---------- snip ---------- Sections [ Section { Index: 1 Name: .text (5) Type: SHT_PROGBITS (0x1) Flags [ (0x6) SHF_ALLOC (0x2) SHF_EXECINSTR (0x4) ] Address: 0x0 Offset: 0x40 Size: 33 Link: 0 Info: 0 AddressAlignment: 16 EntrySize: 0 Relocations [ 0x6 R_386_32 .rodata.str1.1 0x0 0xB R_386_PC32 puts 0x0 0x12 R_386_32 .rodata.str1.1 0x0 0x17 R_386_PC32 puts 0x0 ] SectionData ( 0000: 83EC04C7 04240000 0000E8FC FFFFFFC7 |.....$..........| 0010: 04240600 0000E8FC FFFFFF31 C083C404 |.$.........1....| 0020: C3 |.| ) } ] ---------- snip ---------- Relocations and symbols can be output standalone or together with the section header as displayed in the example. This feature set supports all tests in test/MC/COFF and test/MC/ELF (and I suspect all additional tests using elf-dump), making elf-dump and coff-dump deprecated. Patch by Nico Rieck! llvm-svn: 178679
* Move test since it depends on the X86 backend.Rafael Espindola2013-03-281-11/+0
| | | | llvm-svn: 178249
* Revert "Updated ELF relocation test for .eh_frame section"Michael Gottesman2013-03-281-26/+4
| | | | | | | | This reverts commit c8d65364223a04b179958a50a4bf0f89b21dd7d2. This broke a bunch of the buildbots. llvm-svn: 178222
* Updated ELF relocation test for .eh_frame sectionJack Carter2013-03-271-4/+26
| | | | | | | | Made sure we were looking a correct section Added Mips32/64 as an extra check Updated llvm-objdump to generate symbolic info for Mips relocations llvm-svn: 178190
* Fix the FDE encoding to be relative on ELF.Rafael Espindola2013-03-151-0/+11
| | | | | | | | | | | | This is a very late complement to r130637 which fixed this on x86_64. Fixes pr15448. Since it looks like that every elf architecture uses this encoding when using cfi, make it the default for elf. Just exclude mips64el. It has a lovely .ll -> .o test (ef_frame.ll) that tests that nothing changes in the binary content of the .eh_frame produced by llc. Oblige it. llvm-svn: 177141
* We need a shndx if the number of sections breaks SHN_LORESERVE. This conditionNick Lewycky2013-03-091-0/+65281
| | | | | | for choosing to emit a shndx was simply testing the wrong variable. llvm-svn: 176762
* Rewrite a test to check actual output rather than intermediate implementationEli Bendersky2013-03-011-6/+6
| | | | | | | | | | | | | | | | detail. The was this test was written, it was relying on an implementation detail (fixups) and hence was very brittle (relying, among other things, on the exact ordering of statistics printed by MC). The test was rewritten to check a more observable output difference. While it doesn't cover 100% of the things the original test covered, it's a good practice to write regression tests this way. If we want to check that internal details and invariants hold, such tests should be expressed as unit tests. llvm-svn: 176377
* Now that llvm-dwarfdump supports flags to specify which DWARF section to dump,Eli Bendersky2013-01-251-1/+1
| | | | | | | use them in tests that run llvm-dwarfdump. This is in order to make tests as specific as possible. llvm-svn: 173498
* llvm/test/MC/ELF/comp-dir.s: Appease MSYS Bash.NAKAMURA Takumi2012-12-181-1/+1
| | | | llvm-svn: 170410
* Add a triple to this test -- it has to be an ELF platform...Chandler Carruth2012-12-171-1/+1
| | | | llvm-svn: 170374
* Prepare LLVM to fix PR14625, exposing a hook in MCContext to manage theChandler Carruth2012-12-171-0/+7
| | | | | | | | | | compilation directory. This defaults to the current working directory, just as it always has, but now an assembler can choose to override it with a custom directory. I've taught llvm-mc about this option and added a test case. llvm-svn: 170371
* Add a test for explicitly exercising the mc-relax-all flag.Eli Bendersky2012-12-101-0/+19
| | | | llvm-svn: 169764
* Add separate statistics for Data and Inst fragments emitted during relaxation.Eli Bendersky2012-12-071-4/+1
| | | | | | | Also fixes a test that was overly-sensitive to the exact order of statistics emitted. llvm-svn: 169619
* Add support for .cfi_register now that it is easy to extent the representationRafael Espindola2012-11-251-0/+42
| | | | | | | to support it. Original patch with the parsing and plumbing by the PaX team and Roman Divacky. I added the bits in MCDwarf.cpp and the test. llvm-svn: 168565
* Implement .cfi_undefined. Based on a patch from PaX team, updated byRafael Espindola2012-11-231-0/+41
| | | | | | Roman Divacky. I just added the testcase. llvm-svn: 168520
* Emit relocations from .debug_aranges to .debug_info for asm filesAlexey Samsonov2012-11-141-2/+42
| | | | llvm-svn: 167926
* MC: Overhaul handling of .lcommBenjamin Kramer2012-09-071-0/+21
| | | | | | | | | | | | | - Darwin lied about not supporting .lcomm and turned it into zerofill in the asm parser. Push the zerofill-conversion down into macho-specific code. - This makes the tri-state LCOMMType enum superfluous, there are no targets without .lcomm. - Do proper error reporting when trying to use .lcomm with alignment on a target that doesn't support it. - .comm and .lcomm alignment was parsed in bytes on COFF, should be power of 2. - Fixes PR13755 (.lcomm crashes on ELF). llvm-svn: 163395
* PR13754: llvm-mc/x86 crashes on .cfi directives without the % prefix for ↵Benjamin Kramer2012-09-071-0/+18
| | | | | | | | | registers. gas accepts this and it seems to be common enough to be worth supporting. This doesn't affect the parsing of reg operands outside of .cfi directives. llvm-svn: 163390
* Give this test an explicit triple.Nick Lewycky2012-08-121-1/+1
| | | | llvm-svn: 161740
* When emitting the PC range in an FDE, use the same data encoding for both endsNick Lewycky2012-08-121-0/+28
| | | | | | of the range. Fixes PR13581! llvm-svn: 161739
* ELF: Add support for the asm .version directive.Benjamin Kramer2012-05-121-0/+17
| | | | llvm-svn: 156712
* Continue cleanup of LIT, getting rid of the remaining artifacts from dejagnuEli Bendersky2012-03-251-8/+1
| | | | | | | | | | | | | | * Removed test/lib/llvm.exp - it is no longer needed * Deleted the dg.exp reading code from test/lit.cfg. There are no dg.exp files left in the test suite so this code is no longer required. test/lit.cfg is now much shorter and clearer * Removed a lot of duplicate code in lit.local.cfg files that need access to the root configuration, by adding a "root" attribute to the TestingConfig object. This attribute is dynamically computed to provide the same information as was previously provided by the custom getRoot functions. * Documented the config.root attribute in docs/CommandGuide/lit.pod llvm-svn: 153408
* In the ObjectFile interface, replace isInternal(), isAbsolute(), isGlobal(), ↵David Meyer2012-02-281-1/+1
| | | | | | and isWeak(), with a bitset of flags. llvm-svn: 151670
* On ELF, create relocations to the abbreviation and line sections when producingRafael Espindola2012-02-281-0/+70
| | | | | | | | | | debug info for assembly files. We were already doing the right thing when producing debug info for C/C++. ELF linkers don't know dwarf, so they depend on these relocations to produce valid dwarf output. llvm-svn: 151655
* Replace all instances of dg.exp file with lit.local.cfg, since all tests are ↵Eli Bendersky2012-02-162-5/+13
| | | | | | | | run with LIT now and now Dejagnu. dg.exp is no longer needed. Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches. llvm-svn: 150664
* For ELF, also call fixSymbolsInTLSFixups() on expressions passed to ↵David Meyer2012-02-152-2/+102
| | | | | | EmitValue (literal values). Previously only called on expressions in instructions. New test cases added to tls.s, tls-i386.s. Resolves PR11981. llvm-svn: 150582
* Add support for .cfi_signal_frame. Fixes pr11762.Rafael Espindola2012-01-231-0/+23
| | | | llvm-svn: 148733
* Implement cfi_restore. Patch by Brian Anderson!Rafael Espindola2011-12-291-0/+42
| | | | llvm-svn: 147356
* Implement .cfi_escape. Patch by Brian Anderson!Rafael Espindola2011-12-291-0/+42
| | | | llvm-svn: 147352
* Add support for gnu_indirect_function.Roman Divacky2011-12-121-0/+14
| | | | llvm-svn: 146377
* Handle expressions of the form _GLOBAL_OFFSET_TABLE_-symbol the same way gasRafael Espindola2011-12-101-1/+5
| | | | | | | | does. The _GLOBAL_OFFSET_TABLE_ is still magical in that we get a R_386_GOTPC, but it doesn't change the immediate in the same way as when the expression has no right hand side symbol. llvm-svn: 146311
* Handle reloc_signed_4byte in here. Not doing so was a regression from myRafael Espindola2011-12-091-0/+8
| | | | | | | previous commit. It is strange that we see it in 32 bits. We already have a fixme about it. llvm-svn: 146273
* Handle the case of the magical _GLOBAL_OFFSET_TABLE_ showing up in aRafael Espindola2011-12-091-0/+6
| | | | | | | | symbol difference. This matches gas behavior and fixes PR11513. We still don't handle _GLOBAL_OFFSET_TABLE_ in data sections. llvm-svn: 146238
* Apparently, sometimes llvm-nm doesn't put the undefined symbol at the top. TakeNick Lewycky2011-10-111-2/+1
| | | | | | | that into account and test for no U's showing up in the middle, which is what we really wanted to test for. llvm-svn: 141653
* Also create a shndx even if there are no symbols. This lets us testNick Lewycky2011-10-111-0/+93320
| | | | | | | .symtab_shndx reading and writing together, and finally we have a testcase for r141440. llvm-svn: 141641
* Fix the bitwidth of the remaining fields.Rafael Espindola2011-08-0448-496/+496
| | | | llvm-svn: 136884
* print st_shndx with the correct number of bits.Rafael Espindola2011-08-0423-80/+80
| | | | llvm-svn: 136880
* print st_other with the correct number of bits.Rafael Espindola2011-08-0423-82/+82
| | | | llvm-svn: 136877
* print st_type with the correct number of bits.Rafael Espindola2011-08-0425-92/+92
| | | | llvm-svn: 136875
* Print st_bind with the correct number of bits.Rafael Espindola2011-08-0428-95/+95
| | | | llvm-svn: 136874
* Print r_sym with the correct number of bits.Rafael Espindola2011-08-042-22/+22
| | | | llvm-svn: 136873
* Print r_type with the correct number of bits.Rafael Espindola2011-08-043-29/+29
| | | | llvm-svn: 136872
* Another counter goes decimal.Rafael Espindola2011-08-0424-89/+89
| | | | llvm-svn: 136871
OpenPOWER on IntegriCloud