Commit Graph

612 Commits

Author SHA1 Message Date
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
Chris Lattner
abf8f9cbb8 silence a vc2010 warning: " result of 32-bit shift implicitly converted to
64 bits (was 64-bit shift intended?)", pointed out by 'nobled' on llvmdev


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111148 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:35:20 +00:00
Daniel Dunbar
f1e29d4c21 MC/AsmParser: Push the burdon of emitting diagnostics about unmatched
instructions onto the target specific parser, which can do a better job.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 00:55:38 +00:00
Daniel Dunbar
3c14ca47fc llvm-mc: Add -show-inst-operands, for dumping the parsed instruction representation before matching.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 06:37:09 +00:00
Daniel Dunbar
b3cb696794 MCAsmParser: Add dump() hook to MCParsedAsmOperand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 06:37:04 +00:00
Daniel Dunbar
e25c6b95ce MC/AsmParser: Fix a bug in macro argument parsing, which was dropping
parentheses from argument lists.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110692 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 17:38:52 +00:00
Michael J. Spencer
b0f3b3e7de Revert "MC/MachO: Fix possible null pointer dereference."
This reverts commit 110575.

Target.isAbsolute() is true if SD would be null.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110683 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 16:00:49 +00:00
Kevin Enderby
b07ce60981 Next bit of support for the dwarf .file directive. This patch takes the
previously collected info from the .file directives and outputs the encoded
bytes for it.  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@110617 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 22:52:14 +00:00
Michael J. Spencer
c1f354dcb8 MC/MachO: Fix possible null pointer dereference.
Discovered by Microsoft Visual Studio 2010 Code Analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110575 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 15:28:05 +00:00
Michael J. Spencer
237f8fe5df MC: Fix symbol fragment offsets in COFF.
Patch by Cameron Esfahani!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 05:02:46 +00:00
Michael J. Spencer
a69494ee5e Revert "MC: Fix symbol fragment offsets in COFF."
This reverts commit r110100

Wrong path caps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 04:53:28 +00:00
Michael J. Spencer
ab3de49c48 MC: Add time travel support to COFF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 04:43:33 +00:00
Michael J. Spencer
ef1f8c3cc3 MC: Fix symbol fragment offsets in COFF.
Patch by Cameron Esfahani!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 04:43:24 +00:00
Daniel Dunbar
425f634917 Silence some -Asserts uninitialized variable warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-31 21:08:54 +00:00
Michael J. Spencer
e2195d8b35 Add relax all support to the COFF object streamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-31 06:22:29 +00:00
Daniel Dunbar
0ecdb6f3d8 MC: Initialize MCFragment::Offset, noticed by Cameron Esfahani.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109875 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 18:32:09 +00:00
Benjamin Kramer
1abcd06856 Plug the remaining MC leaks by giving MCObjectStreamer/MCAsmStreamer ownership of the TargetAsmBackend and the MCCodeEmitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 17:48:06 +00:00
Benjamin Kramer
3bce5adb32 Stop leaking std::strings in GetDwarfFile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 13:53:19 +00:00
Benjamin Kramer
808ecfce6a COFFObjectWriter: Don't leak COFFSymbols and COFFSections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109745 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 11:57:59 +00:00
Daniel Dunbar
56491303a6 MC: Destroy Macro instances.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109720 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 01:51:55 +00:00
Kevin Enderby
7cbf73a73f Added first bit of support for the dwarf .file directive. This patch collects
the info from the .file directive and makes file and directory tables that
will eventually be put out as part of the dwarf info in the output file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109651 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:55:35 +00:00
Daniel Dunbar
36880e704f MC: Put back the MCFragment vtable, so subclasses are destroyed properly (duh).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109649 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:28:45 +00:00
Douglas Gregor
fd2878c8d0 Fix format-specifier warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109391 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 03:55:44 +00:00