summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/ELF
Commit message (Collapse)AuthorAgeFilesLines
...
* DebugInfo: Avoid creating unnecessary/empty line tables and remove the ↵David Blaikie2014-04-011-1/+1
| | | | | | | | | | | | special case of '0' in DwarfCompileUnit::initStmtList by just always using a label difference This moves one case of raw text checking down into the MCStreamer interfaces in the form of a virtual function, even if we ultimately end up consolidating on the one-or-many line tables issue one day, this is nicer in the interim. This just generally streamlines a bunch of use cases into a common code path. llvm-svn: 205287
* DebugInfo: Emit relocation to debug_line section when emitting asm for asmDavid Blaikie2014-04-011-1/+21
| | | | | | | | | | | | | | I don't think this is reachable by any frontend (why would you transform asm to asm+debug info?) but it helps tidy up some of this code, avoid the weird special case of "emit the first CU, store the label, then emit the rest" in MCDwarfLineTable::Emit by instead having the DWARF-for-assembly case use the same codepath as DwarfDebug.cpp, by registering the label of the debug_line section, thus causing it to be emitted. (with a special case in asm output to just emit the label since asm output uses the .loc directives, etc, rather than the debug_loc directly) llvm-svn: 205286
* llvm/test/MC/ELF/nocompression.s: Loosen an expression to match "llvm-mc.EXE".NAKAMURA Takumi2014-03-301-1/+1
| | | | llvm-svn: 205148
* llvm-mc: Fix build breakage caused by r205050.Logan Chien2014-03-291-1/+1
| | | | | | | | | When LLVM is not built with zlib, nocompression.s will test for the error message. But this test case will cause breakage because the exit code is non-zero. This commit fix this issue by adding "not" to the command. llvm-svn: 205102
* Completely rewrite ELFObjectWriter::RecordRelocation.Rafael Espindola2014-03-295-9/+30
| | | | | | | | | | | | | | | | | | | I started trying to fix a small issue, but this code has seen a small fix too many. The old code was fairly convoluted. Some of the issues it had: * It failed to check if a symbol difference was in the some section when converting a relocation to pcrel. * It failed to check if the relocation was already pcrel. * The pcrel value computation was wrong in some cases (relocation-pc.s) * It was missing quiet a few cases where it should not convert symbol relocations to section relocations, leaving the backends to patch it up. * It would not propagate the fact that it had changed a relocation to pcrel, requiring a quiet nasty work around in ARM. * It was missing comments. llvm-svn: 205076
* Debug Compression: Avoid compression debug_frame for nowDavid Blaikie2014-03-281-1/+9
| | | | | | | | Turns out debug_frame does use multiple fragments, so it doesn't compress correctly with the current approach. Disable compressing it for now while I figure out what's the best solution for it. llvm-svn: 205059
* llvm-mc: error when -compress-debug-sections is requested and zlib is not linkedDavid Blaikie2014-03-281-0/+5
| | | | | | | | | | This is a bit of a stab in the dark, since I have zlib on my machine. Just going to bounce it off the bots & see if it sticks. Do we have some convention for negative REQUIRES: checks? Or do I just need to add a feature like I've done here? llvm-svn: 205050
* Only test compression when linked with zlib.David Blaikie2014-03-281-0/+2
| | | | | | | I'll implement error handling and a negative test in both llvm-mc and Clang soon. llvm-svn: 205016
* DebugInfo: Support for compressed debug info sectionsDavid Blaikie2014-03-271-0/+18
| | | | | | | | | | | | | | | | | | | 1) When creating a .debug_* section and instead create a .zdebug_ section. 2) When creating a fragment in a .zdebug_* section, make it a compressed fragment. 3) When computing the size of a compressed section, compress the data and use the size of the compressed data. 4) Emit the compressed bytes. Also, check that only if a section has a compressed fragment, then that is the only fragment in the section. Assert-fail if the fragment's data is modified after it is compressed. Initial review on llvm-commits by Eric Christopher and Rafael Espindola. llvm-svn: 204958
* Correctly propagates st_size.Rafael Espindola2014-03-271-5/+6
| | | | | | This also finally removes a bogus call to AliasedSymbol. llvm-svn: 204883
* Correctly detect if a symbol uses a reserved section index or not.Rafael Espindola2014-03-261-1/+23
| | | | | | | The logic was incorrect for variables, causing them to end up in the wrong section if the section had an index >= 0xff00. llvm-svn: 204771
* Create .symtab_shndxr only when needed.Rafael Espindola2014-03-253-158597/+214
| | | | | | | | | | | | | | | | | | | | | | | We need .symtab_shndxr if and only if a symbol references a section with an index >= 0xff00. The old code was trying to figure out if the section was needed ahead of time, making it a fairly dependent on the code actually writing the table. It was also somewhat conservative and would create the section in cases where it was not needed. If I remember correctly, the old structure was there so that the sections were created in the same order gas creates them. That was valuable when MC's support for ELF was new and we tested with elf-dump.py. This patch refactors the symbol table creation to another class and makes it obvious that .symtab_shndxr is really only created when we are about to output a reference to a section index >= 0xff00. While here, also improve the tests to use macros. One file is one section short of needing .symtab_shndxr, the second one has just the right number. llvm-svn: 204769
* Teach llvm-readobj to print human friendly description of reserved sections.Rafael Espindola2014-03-2418-50/+50
| | | | llvm-svn: 204584
* Add back tests that were reverted in r204203.Rafael Espindola2014-03-241-11/+56
| | | | | | They pass again with the fix in r204581. llvm-svn: 204582
* Propagate section from base to derived symbol.Rafael Espindola2014-03-242-9/+3
| | | | | | | | | | | | We were already propagating the section in a = b With this patch we also propagate it for a = b + 1 llvm-svn: 204581
* Propagate types from symbol to aliases.Rafael Espindola2014-03-231-0/+157
| | | | | | | | | | | | | | | | | | | | | | | This is similar, but not identical to what gas does. The logic in MC is to just compute the symbol table after parsing the entire file. GAS is mixed, given .type b, @object a = b b: .type b, @function It will propagate the change and make 'a' a function. Given .type b, @object b: a = b .type b, @function the type of 'a' is still object. Since we do the computation in the end, we produce a function in both cases. llvm-svn: 204555
* Fix the value computation inRafael Espindola2014-03-211-0/+27
| | | | | | | | | | sym_a: sym_d = sym_a + 1 This is the smallest fix I was able to extract from what got reverted in r204203. llvm-svn: 204527
* Look through variables when computing relocations.Rafael Espindola2014-03-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given bar = foo + 4 .long bar MC would eat the 4. GNU as includes it in the relocation. The rule seems to be that a variable that defines a symbol is used in the relocation and one that does not define a symbol is evaluated and the result included in the relocation. Fixing this unfortunately required some other changes: * Since the variable is now evaluated, it would prevent the ELF writer from noticing the weakref marker the elf streamer uses. This patch then replaces that with a VariantKind in MCSymbolRefExpr. * Using VariantKind then requires us to look past other VariantKind to see .weakref bar,foo call bar@PLT doing this also fixes zed = foo +2 call zed@PLT so that is a good thing. * Looking past VariantKind means that the relocation selection has to use the fixup instead of the target. This is a reboot of the previous fixes for MC. I will watch the sanitizer buildbot and wait for a build before adding back the previous fixes. llvm-svn: 204294
* Make the test harder by using a non-zero offset.Rafael Espindola2014-03-191-7/+7
| | | | llvm-svn: 204205
* Revert "Add back r203962, r204028 and r204059."Rafael Espindola2014-03-191-72/+0
| | | | | | This reverts commit r204178. llvm-svn: 204203
* Add back r203962, r204028 and r204059.Rafael Espindola2014-03-181-0/+72
| | | | | | | | This reverts commit r204137. This includes a fix for handling aliases of aliases. llvm-svn: 204178
* Revert r203962 and two revisions depending on it: r204028 and r204059.Alexander Kornienko2014-03-182-72/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The revision I'm reverting breaks handling of transitive aliases. This blocks us and breaks sanitizer bootstrap: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/2651 (and checked locally by Alexey). This revision is the result of: svn merge -r204059:204058 -r204028:204027 -r203962:203961 . + the regression test added to test/MC/ELF/alias.s Another way to reproduce the regression with clang: $ cat q.c void a1(); void a2() __attribute__((alias("a1"))); void a3() __attribute__((alias("a2"))); void a1() {} $ ~/work/llvm-build/bin/clang-3.5-good -c q.c && mv q.o good.o && \ ~/work/llvm-build/bin/clang-3.5-bad -c q.c && mv q.o bad.o && \ objdump -t good.o bad.o good.o: file format elf64-x86-64 SYMBOL TABLE: 0000000000000000 l df *ABS* 0000000000000000 q.c 0000000000000000 l d .text 0000000000000000 .text 0000000000000000 l d .data 0000000000000000 .data 0000000000000000 l d .bss 0000000000000000 .bss 0000000000000000 l d .comment 0000000000000000 .comment 0000000000000000 l d .note.GNU-stack 0000000000000000 .note.GNU-stack 0000000000000000 l d .eh_frame 0000000000000000 .eh_frame 0000000000000000 g F .text 0000000000000006 a1 0000000000000000 g F .text 0000000000000006 a2 0000000000000000 g F .text 0000000000000006 a3 bad.o: file format elf64-x86-64 SYMBOL TABLE: 0000000000000000 l df *ABS* 0000000000000000 q.c 0000000000000000 l d .text 0000000000000000 .text 0000000000000000 l d .data 0000000000000000 .data 0000000000000000 l d .bss 0000000000000000 .bss 0000000000000000 l d .comment 0000000000000000 .comment 0000000000000000 l d .note.GNU-stack 0000000000000000 .note.GNU-stack 0000000000000000 l d .eh_frame 0000000000000000 .eh_frame 0000000000000000 g F .text 0000000000000006 a1 0000000000000000 g F .text 0000000000000006 a2 0000000000000000 g .text 0000000000000000 a3 llvm-svn: 204137
* Consider the base pointer for setting the symbol type.Rafael Espindola2014-03-171-4/+18
| | | | | | | | | | | | | | This is really a consistency fix. Since given a = b we propagate the information, we should propagate it too given a = b + (1 - 1) Fixes pr19145. llvm-svn: 204028
* Correctly handle an ELF symbol defined with "a = b + expr".Rafael Espindola2014-03-141-0/+58
| | | | | | | | | We were marking the symbol as absolute instead of computing b's offset + the expression value. This fixes pr19126. llvm-svn: 203962
* Add support for assigning to . in AsmParser.Anders Waldenborg2014-02-171-0/+22
| | | | | | | | | This is implemented by handling assignments to the '.' pseudo symbol as ".org" directives. Differential Revision: http://llvm-reviews.chandlerc.com/D2625 llvm-svn: 201530
* Fix broken CHECK linesNico Rieck2014-02-161-1/+1
| | | | llvm-svn: 201479
* Support DWARF discriminators in object streamer.Diego Novillo2014-02-141-0/+61
| | | | | | | | | | | | | | | Summary: This adds support for emitting DWARF path discriminator values in the object streamer. It also changes the DWARF dumper to show discriminator values in the line table output. Reviewers: echristo CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2794 llvm-svn: 201427
* MC: Add support for .cfi_startproc simpleDavid Majnemer2014-01-271-4/+12
| | | | | | | | | | | | | This commit allows LLVM MC to process .cfi_startproc directives when they are followed by an additional `simple' identifier. This signals to elide the emission of target specific CFI instructions that would normally occur initially. This fixes PR16587. Differential Revision: http://llvm-reviews.chandlerc.com/D2624 llvm-svn: 200227
* Forgot to add testcase for r198590David Majnemer2014-01-211-0/+8
| | | | llvm-svn: 199765
* Force emit a relocation for @gnu_indirect_function symbols so that the indirectRoman Divacky2014-01-081-0/+16
| | | | | | resolution works. llvm-svn: 198780
* [x86] Support R_386_PC8, R_386_PC16 and R_X86_64_PC8David Woodhouse2014-01-082-0/+10
| | | | llvm-svn: 198763
* In the ELFWriter when writing aliased (.set) symbols dont blindlyRoman Divacky2014-01-071-0/+197
| | | | | | | | | | | | take type from the new symbol but merge them so that the type is never "downgraded". This is probably quite rare, except for IFUNC symbols which we used to misassemble, losing the IFUNC type. Fixes #18372. llvm-svn: 198706
* Correct word hyphenationsAlp Toker2013-12-051-1/+1
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities and contractions in nearby lines. llvm-svn: 196471
* Move llvm/test/MC/ELF/thumb-st_other.s to test/MC/ARM.NAKAMURA Takumi2013-12-051-19/+0
| | | | llvm-svn: 196457
* [mc] Fix ELF st_other flag.Logan Chien2013-12-051-0/+19
| | | | | | | | | | | | ELF_Other_Weakref and ELF_Other_ThumbFunc seems to be LLVM internal ELF symbol flags. These should not be emitted to object file. This commit defines ELF_STO_Shift for the target-defined flags for st_other, and increase the value of ELF_Other_Shift to 16. llvm-svn: 196440
* This commit adds some (but not all) of the x86-64 relocations that are notTom Roeder2013-10-301-6/+10
| | | | | | currently supported in the ELF object writer, along with a simple test case. llvm-svn: 193709
* Move the STT_FILE symbols out of the normal symbol table processing forJoerg Sonnenberger2013-10-291-0/+47
| | | | | | | ELF. They can overlap with the other symbols, e.g. if a source file "foo.c" contains a function "foo" with a static variable "c". llvm-svn: 193569
* MC: Support multiple sections with the same name in the same comdat groupDavid Blaikie2013-10-221-0/+41
| | | | | | Code review by Eric Christopher and Rafael Espindola. llvm-svn: 193209
* Emit DWARF line entries for all data in the instruction stream.Peter Collingbourne2013-10-201-6/+19
| | | | | | | r182712 attempted to do this, but it failed to handle data emitted via EmitBytes. llvm-svn: 193041
* MC asm parser: allow ?'s in symbol names, and handle @'s in names in MS asmHans Wennborg2013-10-182-0/+19
| | | | | | | | | | | | | | | | | | | | This is another (final?) stab at making us able to parse our own asm output on Windows. Symbols on Windows often contain @'s and ?'s in their names. Our asm parser didn't like this. ?'s were not allowed, and @'s were intepreted as trying to reference PLT/GOT/etc. We can't just add quotes around the bad names, since e.g. for MinGW, we use gas to assemble, and it doesn't like quotes in some places (notably in .def directives). This commit makes us allow ?'s in symbol names, and @'s in symbol names for MS assembly. Differential Revision: http://llvm-reviews.chandlerc.com/D1978 llvm-svn: 193000
* Implements parsing and emitting of .cfi_window_save in MC.Venkatraman Govindaraju2013-09-261-0/+51
| | | | llvm-svn: 191431
* X86: Use R_X86_64_TPOFF64 for FK_Data_8David Majnemer2013-09-221-0/+2
| | | | | | | | | | | | | | | | | | | Summary: LLVM would crash when trying to come up with a relocation type for assembly like: movabsq $V@TPOFF, %rax Instead, we say the relocation type is R_X86_64_TPOFF64. Fixes PR17274. Reviewers: dblaikie, nrieck, rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1717 llvm-svn: 191163
* ELF: Parse types in directives like binutils gasDavid Majnemer2013-09-212-1/+29
| | | | | | | | | | Allow binutils .type and .section directives to take the following forms: - @<type> - %<type> - "<type>" llvm-svn: 191134
* ELF: Add support for the exclude section bit for gas compat.Benjamin Kramer2013-09-151-4/+21
| | | | llvm-svn: 190769
* MC: Add support for '?' flags in .section directivesDavid Majnemer2013-09-151-1/+1
| | | | | | | | | | | | | | | | | | | Summary: The '?' flag uses the last section group if the last had a section group. We treat combining an explicit section group and the '?' as a hard error. This fixes PR17198. Reviewers: rafael, bkramer Reviewed By: bkramer CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1686 llvm-svn: 190768
* [tests] Cleanup initialization of test suffixes.Daniel Dunbar2013-08-161-2/+0
| | | | | | | | | | | | | | | | | - Instead of setting the suffixes in a bunch of places, just set one master list in the top-level config. We now only modify the suffix list in a few suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py). - Aside from removing the need for a bunch of lit.local.cfg files, this enables 4 tests that were inadvertently being skipped (one in Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been XFAILED). - This commit also fixes a bunch of config files to use config.root instead of older copy-pasted code. llvm-svn: 188513
* Check for $PWD in llvm::sys::current_path.Rafael Espindola2013-08-101-0/+10
| | | | | | | Some users (clang, libTooling) require this. After this patch we can remove the calls to getenv("PWD") from clang. llvm-svn: 188125
* Put ELF COMDAT relocations into the relevant COMDAT group.Tim Northover2013-07-102-1/+30
| | | | | | | | Patch from Игорь Пашев (I do hope we support utf-8 commit messages; I also hope he'll forgive me for transliterating it as Igor Pashev in case things go horribly wrong). llvm-svn: 186034
* Added the test missed from r185080.Serge Pavlov2013-07-011-0/+13
| | | | llvm-svn: 185316
* Integrate Assembler: Support X86_64_DTPOFF64 relocationsDavid Blaikie2013-06-281-1/+2
| | | | llvm-svn: 185131
OpenPOWER on IntegriCloud