Commit Graph

300 Commits

Author SHA1 Message Date
Charlie Turner
56101e1cc5 Test all <build attribute, value> pairs.
Add more tests to make sure the encoding/decoding of build attributes works
correctly for all permissible values of build attributes. For cases where there
are an infinite number of such values, a representative subset has been settled
for.

Change-Id: I2643c9624c211b2d56405306e16eec2d487bc5d6

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222917 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-28 11:14:47 +00:00
Charlie Turner
72ba1af89c Stop uppercasing build attribute data.
The string data for string-valued build attributes were being unconditionally
uppercased. There is no mention in the ARM ABI addenda about case conventions,
so it's technically implementation defined as to whether the data are
capitialised in some way or not. However, there are good reasons not to
captialise the data.

  * It's less work.
  * Some vendors may legitimately have case-sensitive checks for these
    attributes which would fail on LLVM generated object files.
  * There could be locale issues with uppercasing.

The original reasons for uppercasing appear to have stemmed from an
old codesourcery toolchain behaviour, see

http://comments.gmane.org/gmane.comp.compilers.llvm.cvs/87133

This patch makes the object file emitted no longer captialise string
data, it encodes as seen in the assembly source.

Change-Id: Ibe20dd6e60d2773d57ff72a78470839033aa5538

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222882 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-27 12:13:56 +00:00
Will Newton
87a2f3751c Update AArch64 ELF relocations to ABI 1.0
This mostly entails adding relocations, however there are a couple of
changes to existing relocations:

1. R_AARCH64_NONE is defined to be zero rather than 256

R_AARCH64_NONE has been defined to be zero for a long time elsewhere
e.g. binutils and glibc since the submission of the AArch64 port in
2012 so this is required for compatibility.

2. R_AARCH64_TLSDESC_ADR_PAGE renamed to R_AARCH64_TLSDESC_ADR_PAGE21

I don't think there is any way for relocation names to leak out of LLVM
so this should not break anything.

Tested with check-all with no regressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222821 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-26 10:49:18 +00:00
Will Newton
e98441590b Update ARM ELF relocations to ABI 2.09
Add R_ARM_IRELATIVE.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222817 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-26 10:36:03 +00:00
Rafael Espindola
823f3d2e34 This test requires asserts because of -stats.
Sorry about that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222788 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-25 20:56:56 +00:00
Rafael Espindola
2fbbd7a369 gold plugin: call llvm_shutdown so that -stats works.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222787 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-25 20:52:49 +00:00
David Majnemer
c3da97ac99 Forgot to add a file for r222734
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222736 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-25 07:45:56 +00:00
David Majnemer
333c9584a7 COFF: Add another test for r222124
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222734 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-25 07:42:36 +00:00
Rafael Espindola
f1ca1d4bc3 Add a disable-output option to the gold plugin.
This corresponds to the opt option and is handy for profiling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222687 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-24 21:18:14 +00:00
Jyoti Allur
dc0b300304 [ELF] Prevent ARM ELF object writer from generating deprecated relocation code R_ARM_PLT32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222414 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-20 05:58:11 +00:00
David Majnemer
9dda78ff11 Add a test for r221870
bad-relocs.obj.coff-i386 has a relocation whose symbol index is outside
the symbol table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222413 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-20 05:32:10 +00:00
Rui Ueyama
3977e2f696 llvm-readobj: fix off-by-one error in COFFDumper
It printed out base relocation table header as table entry.
This patch also makes llvm-readobj to not skip ABSOLUTE entries
becuase it was confusing.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222299 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-19 02:07:10 +00:00
Rui Ueyama
6272b8c4be llvm-readobj: teach it how to dump COFF base relocation table
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222289 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-19 00:18:07 +00:00
David Majnemer
f0e7ccce9e llvm-readobj: Don't print the Characteristics field as the Subsystem
We claimed that we were printing the Subystem field when we were
actually printing the Characteristics field.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222216 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-18 02:45:28 +00:00
David Majnemer
a18e46cbc9 Object, COFF: Tighten the object file parser
We were a little lax in a few areas:
- We pretended that import libraries were like any old COFF file, they
  are not.  In fact, they aren't really COFF files at all, we should
  probably grow some specialized functionality to handle them smarter.
- Our symbol iterators were more than happy to attempt to go past the
  end of the symbol table if you had a symbol with a bad list of
  auxiliary symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222124 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-17 11:17:17 +00:00
Frederic Riss
b06648fe56 Implement MachODumper::printFileHeaders
Patch by Chilledheart.

Differential Revision: http://reviews.llvm.org/D6163

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222115 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-17 01:34:15 +00:00
Kevin Enderby
61ab3a1cc5 Add the code and test cases for 64-bit ARM to llvm-objdump’s Mach-O symbolizer.
FYI, removed the unused MCInstrAnalysis as it does not exist for 64-bit ARM and
was causing a “couldn't initialize disassembler for target” error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222045 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-14 21:52:18 +00:00
Rui Ueyama
08f70b58cb llvm-readobj: Print out address table when dumping COFF delay-import table
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221855 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-13 03:22:54 +00:00
Timur Iskhodzhanov
629ba0ac0d [COFF] Make it clearer that the symbols subsection holds function display name rather than just name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221812 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-12 20:10:09 +00:00
Rafael Espindola
e4e7ad3101 Fix the test.
It was broken since r221708.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221783 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-12 14:23:04 +00:00
Colin LeMahieu
6d093fd78a [llvm-mc] Fixing case where if a file ended with non-newline whitespace or a comma it would access invalid memory.
Cleaned up parse loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221707 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-11 21:03:09 +00:00
David Majnemer
1dd631fe02 llvm-objdump: Skip empty sections when dumping contents
Empty sections are just noise when using objdump.
This is similar to what binutils does.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221680 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-11 09:58:25 +00:00
Manuel Klimek
dd848e93cc Was convinced in commit comments that requiring a specific python version is the wrong approach; reverting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221679 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-11 08:53:18 +00:00
Manuel Klimek
d8d51ffe26 Mark test using python as REQUIRES: python27.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221598 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-10 15:29:29 +00:00
NAKAMURA Takumi
7ad3ceb478 llvm/test/tools/llvm-symbolizer/ppc64.test: Avoid subshell.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221526 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-07 14:50:10 +00:00
Jay Foad
222fcc59cb llvm-symbolizer: teach it about PowerPC64 ELF function descriptors
Summary:
Teach llvm-symbolizer about PowerPC64 ELF function descriptors. Symbols in the .opd section point to function descriptors, the first word of which is a pointer to the real function. For the purposes of symbolizing we pretend that the symbol points directly to the function.

This is enough to get decent function names in stack traces for unoptimized binaries, which fixes the sanitizer print-stack-trace test on PowerPC64 Linux.

Reviewers: kcc, willschm, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6110

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221514 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-07 09:08:39 +00:00
Kevin Enderby
3b80486e3a Plumb in the ARM thumb symbolizer in llvm-objdump’s Mach-O disassembler and
add the code and test cases for 32-bit ARM symbolizer.

Also fixed the printing of data in code as it was not using the table correctly
and needed to fix one of the test cases too.

This will break lld’s test/mach-o/arm-interworking-movw.yaml till the tweak
for that is made. Which I’ll be committing immediately after this commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221470 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-06 19:00:13 +00:00
David Majnemer
4787059b2f llvm-readobj: Add support for dumping the DOS header in PE files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221333 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-05 06:24:35 +00:00
Kevin Enderby
a25032214d Add the code and test cases for 32-bit Intel to llvm-objdump’s Mach-O symbolizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221211 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04 00:43:16 +00:00
David Majnemer
9460376a4d Forgot to add input file for test added in r221133
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221134 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03 07:58:16 +00:00
David Majnemer
5dc81d5a76 llvm-vtabledump: Handle Itanium VTables
Add support in the vtable dumper for the Itanium ABI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221133 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03 07:23:25 +00:00
Diego Novillo
9657de5f22 Add show and merge tools for sample PGO profiles.
Summary:
This patch extends the 'show' and 'merge' commands in llvm-profdata to handle
sample PGO formats. Using the 'merge' command it is now possible to convert
one sample PGO format to another.

The only format that is currently not working is 'gcc'. I still need to
implement support for it in lib/ProfileData.

The changes in the sample profile support classes are needed for the
merge operation.

Reviewers: bogner

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6065

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221032 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 00:56:55 +00:00
Rafael Espindola
d07e7ecd85 Enable the slp vectorizer in the gold plugin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220887 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-30 00:38:54 +00:00
Rafael Espindola
74ded7c790 Enable the loop vectorizer in the gold plugin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220886 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-30 00:11:24 +00:00
Rafael Espindola
25016f9d2e Replace also-emit-llvm with save-temps.
The also-emit-llvm option only supported getting the IR before optimizations.
This patch replaces it with a more generic save-temps option that saves the IR
both before and after optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220885 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-29 23:54:45 +00:00
NAKAMURA Takumi
68a70cdbfb macho-symbolized-disassembly.test: Don't check C++ demangler unconditionally.
For example, MS PSDK is not expected to have <cxxabi.h>.
You should introduce the new feature in lit.cfg corresponding to HAVE_CXXABI_H if you would like to test demangler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220840 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-29 08:08:21 +00:00
Kevin Enderby
17380c7afa Update llvm-objdump’s Mach-O symbolizer code to demangle C++ names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220833 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-28 23:39:46 +00:00
Timur Iskhodzhanov
13535f412a PR21189: Teach llvm-readobj to dump bits of COFF symbol subsections required to debug using VS2012+
Reviewed at http://reviews.llvm.org/D5755
Thanks to Andrey Guskov for his help investigating this!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220526 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 22:25:31 +00:00
Kevin Enderby
a1afbd6421 Update llvm-objdump’s Mach-O symbolizer code for Objective-C references.
This prints disassembly comments for Objective-C references to CFStrings,
Selectors, Classes and method calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220500 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 19:37:31 +00:00
Nick Kledzik
5357e3ae1b [llvm-objdump] don't test timestamp dump as that is time zone dependent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220123 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-18 02:28:01 +00:00
Nick Kledzik
e0b3f29da9 [llvm-objdump] enhance test case for mach-o -private-headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220120 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-18 01:50:55 +00:00
Nick Kledzik
50ede1623d [llvm-objdump] Fix mach-o binding decompression error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220119 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-18 01:21:02 +00:00
Alexander Potapenko
0fea775e5c [llvm-symbolizer] Introduce the -dsym-hint option.
llvm-symbolizer will consult one of the .dSYM paths passed via -dsym-hint
if it fails to find the .dSYM bundle at the default location.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220004 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-17 00:50:19 +00:00
Nick Kledzik
1a0afd82b1 [llvm-objdump] Update error message and add test case for mach-o file with bad library ordinals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219746 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 23:29:38 +00:00
Timur Iskhodzhanov
1dc437cb45 Add VS2012-generated test inputs for test/tools/llvm-readobj/codeview-linetables.test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219621 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 17:03:13 +00:00
Rui Ueyama
f3c82a592d llvm-readobj: add test for r219228
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219274 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-08 02:06:11 +00:00
Rafael Espindola
61c4e41480 gold plugin: Handle gold selecting a linkonce GV when a weak is present.
The plugin API doesn't have the notion of linkonce, only weak. It is up to the
plugin to figure out if a symbol used only for the symbol table can be dropped.
In particular, it has to avoid dropping a linkonce_odr selected by gold if there
is also a weak_odr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219188 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 04:06:13 +00:00
Rafael Espindola
4f17a54bfa gold plugin: create internal replacement with original linkage first.
The call to copyAttributesFrom will copy the visibility, which might assert
if it were to produce something invalid like "internal hidden". We avoid it
by first creating the replacement with the original linkage and then setting
it to internal affter the call to copyAttributesFrom.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219184 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 03:19:55 +00:00
Rafael Espindola
3ddd4fa0dd gold plugin: Remap function arguments when creating a replacement function.
When creating an internal function replacement for use in an alias we were
not remapping the argument uses in the instructions to point to the new
arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219177 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 00:47:38 +00:00
Timur Iskhodzhanov
3e3908e2c7 Fix dumping codeview line tables when there are multiple debug sections
Codeview line tables for functions in different sections refer to a common
STRING_TABLE_SUBSECTION for filenames.
This happens when building with -Gy or with inline functions with MSVC.

Original patch by Jeff Muizelaar!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219125 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 16:59:44 +00:00