Commit Graph

634 Commits

Author SHA1 Message Date
Benjamin Kramer
a9eadca2fd MCELF: Align symtab, relocation sections and section headers properly. Patch by Krister Wombell.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 16:11:52 +00:00
Bill Wendling
7d49f2b1bf Get rid of "passing signed into unsigned parameter" warning on PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 19:09:46 +00:00
Benjamin Kramer
1674b0b0e4 Add AsmParser support for the ELF .previous directive. Patch by Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 18:53:37 +00:00
Benjamin Kramer
230c274724 Allow MCSA_WeakRef in ELF. Patch by Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112834 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 17:18:32 +00:00
Devang Patel
b1fcfbe89b Fix .debug_range for linux. Patch by Krister Wombell.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112830 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 16:43:44 +00:00
Devang Patel
ae84d5b9ba Use absolute label for DW_AT_stmt_list if a target does not prefer offset here.
This patch was developed on top of original patch by Artur Pietrek.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112678 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 23:50:19 +00:00
Kevin Enderby
232ab949d5 This is the second of three patches to implement support for the .loc directive
and output the dwarf line number tables.  This takes the current loc info after
an instruction is assembled and saves the needed info into an object that has
vector and for each section.  These objects will be used for the final patch to 
build and emit the encoded dwarf line number tables.  Again for now this is only
in the Mach-O streamer but at some point will move to a more generic place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112668 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:55:11 +00:00
Benjamin Kramer
19dc7faf25 Allow creation of SHT_NULL sections, from Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112605 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 17:03:33 +00:00
Benjamin Kramer
6cc53be24c MCELF: The value of all common symbols is the offset from the start of the section. Patch by Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 17:20:17 +00:00
Benjamin Kramer
51799ddc7c The value is offset from the start of the section for non-common symbols, submitted by Jordan Gordeev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 12:00:16 +00:00
Benjamin Kramer
679d236117 Index external symbols by symbol table instead of parent section, by Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112472 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 11:59:29 +00:00
Benjamin Kramer
82a3171b72 Mark all common symbols external. This is not exactly correct but it lets apps
link for now and can be adjusted later. Patch by Roman Divacky.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112471 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 11:56:55 +00:00
Chris Lattner
b188a3789e squish dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112350 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28 03:21:03 +00:00
Benjamin Kramer
93ded7371f MCELF: Port EmitInstruction changes from MachO streamer. Patch by Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112260 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-27 10:40:51 +00:00
Benjamin Kramer
95c602ade3 MCELF: Always overwrite FixedValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112259 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-27 10:38:39 +00:00
Benjamin Kramer
4ba1b3074b MCELF: Fix a thinko of mine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112203 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 18:12:04 +00:00
Benjamin Kramer
63d37b9322 MCELF: Compensate for the addend on i386. Patch by Roman Divacky, with some cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112197 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 17:23:02 +00:00
Benjamin Kramer
7b83c26051 MCELF: Use precomputed symbol indices, patch by Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112079 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 20:09:43 +00:00
Michael J. Spencer
bf252bef67 MC: Fix inconsistant naming in COFF object writer. Patch by Cameron Esfahani.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112076 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 19:27:27 +00:00
Kevin Enderby
6d8f1a9a18 Change the parsing of .loc back to allow the LineNumber field to be optional as
it is with other assemblers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111967 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 21:14:47 +00:00
Michael J. Spencer
82c84fdd23 Fix COFF x86-64 relocations. PR7960.
Multiple symbol reloc handling part of the patch by Cameron Esfahani.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111963 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 21:04:52 +00:00
Kevin Enderby
c1840b3da2 First bit of support for the dwarf .loc directive. This patch updates the
needed parsing for the .loc directive and saves the current info from that
into the context.  The next patch will take the current loc info after an
instruction is assembled and save that info into a vector for each section for
use to build the line number tables.  The patch after that will encode the info
from those vectors into the output file as the dwarf line tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 20:32:42 +00:00
Daniel Dunbar
e17edff28f MC/AsmParser: Change ParseExpression to use ParseIdentifier(), to support
dollars in identifiers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111946 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 19:13:42 +00:00
Daniel Dunbar
1f1b865c40 MC/Parser: Accept leading dollar signs in identifiers.
- Implemented by manually splicing the tokens. If this turns out to be
   problematically platform specific, a more elegant solution would be to
   implement some context dependent lexing support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111934 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 18:12:12 +00:00
Benjamin Kramer
2f6e0e68a4 Relocate against parent if the symbol is not in section or it's a common symbol, from Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111925 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 17:34:39 +00:00
Chris Lattner
a78c67e9bb fix rdar://7997827 - Accept and ignore LL and ULL suffixes on integer literals.
Also fix 0b010 syntax to actually work while we're at it :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111876 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 00:43:25 +00:00
Benjamin Kramer
c522f6e70b Fix thinko. Having no tests is great ...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111848 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 21:32:00 +00:00
Benjamin Kramer
36c6dc22bc Reduce code duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111846 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 21:23:52 +00:00
Benjamin Kramer
0b6cbfe04c ELFObjectWriter: Run ComputeSymbolTable before recording relocations. This way we can use the information it has computed and don't have to recompute the same stuff over and over again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111844 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 21:19:37 +00:00
Benjamin Kramer
bcf2db60dd Add the symbol offset to the relocation value when we relocate against section. By Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111824 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 19:05:46 +00:00
Benjamin Kramer
30dc1ee78a Use the proper relocation section + cleanup, from Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111819 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 18:24:20 +00:00
Michael J. Spencer
69c59218dc Revert part of my last commit. the mingw32 build bot doesn't seem to like it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111793 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 05:25:23 +00:00
Michael J. Spencer
3464cec4d8 Workaround broken jump tables on x86-64 COFF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111792 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 04:45:37 +00:00
Michael J. Spencer
da0bfcdaf9 MC: Add partial x86-64 support to COFF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111728 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 05:58:13 +00:00
Benjamin Kramer
44cbde85ba MCELF: Count the section orders properly. Patch by Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111517 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 13:44:49 +00:00
Daniel Dunbar
c983b20661 MC/ELF: Allow null values in virtual sections, ELF doesn't use special
directives for putting contents in .bss, for example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111376 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 18:22:37 +00:00
Benjamin Kramer
81cfb8529b Remove dead code. Fixes a GCC warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111271 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 19:45:05 +00:00
Benjamin Kramer
e5b57347e9 Sketch i386 relocations handling, from Roman Divacky.
Hello world builds & runs now on i386/ELF with -integrated-as.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111264 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 18:20:28 +00:00
Benjamin Kramer
299fbe3a5a Use the correct entry size for relocation entries, from Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111259 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 17:56:13 +00:00
Benjamin Kramer
377a572d9b Differentiate between RELA and REL relocations, from Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111252 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 17:30:07 +00:00
Benjamin Kramer
eb97677764 One baby step towards i386 ELF, from Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111247 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 17:02:29 +00:00
Benjamin Kramer
172d7d6a12 Try to silence a overeager GCC warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111214 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 00:33:24 +00:00
Benjamin Kramer
368ae7e4ec A round of minor cleanups for ELFObjectWriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111213 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 00:00:46 +00:00
Benjamin Kramer
1f8aa7bf08 Silence warnings and simplify code. Eliminate a 32/64 bit portability issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111201 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 23:00:12 +00:00
Eli Friedman
a44fa2473a Fixes for generation of ELF relocations. Patch by Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111183 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 21:17:09 +00:00
Eli Friedman
f8020a3978 Fix a few warnings in and detabify MCELFStreamer and ELFObjectWriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111175 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 19:15:06 +00:00
Matt Fleming
3565a06ebf Add ELF ObjectWriter and Streamer support.
I forgot to add these files in commit 111172.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111174 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 18:57:57 +00:00
Matt Fleming
6b2e257e74 Add ELF ObjectWriter and Streamer support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111172 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 18:35:43 +00:00
Matt Fleming
a8bf473fb1 Layout helper function.
Introduce a helper method to add a section to the end of a layout. This
will be used by the ELF ObjectWriter code to add the metadata sections
(symbol table, etc) to the end of an object file.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111171 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 18:35:06 +00:00
Matt Fleming
6c8b3d2f1f Record a symbol's size which is needed for ELF symbol tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 18:34:31 +00:00