Commit Graph

148 Commits

Author SHA1 Message Date
Hemant Kulkarni
962167f0e2 [llvm-readobj] Impl GNU style symbols printing
Implements "readelf -sW and readelf -DsW"

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263952 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 17:18:23 +00:00
Hemant Kulkarni
a7904d39a8 [llvm-readobj] Impl GNU style printing of sections and relocations
Differential Revision: http://reviews.llvm.org/D17523

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263561 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-15 17:25:31 +00:00
Hemant Kulkarni
e57aee0af8 [llvm-readobj] Enable GNU style section group print
Differential Revision: http://reviews.llvm.org/D17822

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263050 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-09 19:16:13 +00:00
Jacques Pienaar
e0accec873 [lanai] Add ELF enum value and relocations.
Add ELF enum value and relocations for Lanai backed.

General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend" (http://lists.llvm.org/pipermail/llvm-dev/2016-February/095118.html).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262394 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 21:21:42 +00:00
Hemant Kulkarni
70c478d920 Reverts change r261907 and r261918
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261927 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-25 20:47:07 +00:00
Hemant Kulkarni
ce1dab33de [llvm-readobj] Enable GNU style sections and relocations printing
http://reviews.llvm.org/D17523

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-25 18:02:00 +00:00
Rafael Espindola
ed783357b0 This reverts commit r260488 and r260489.
Original messages:
    Revert "[readobj] Handle ELF files with no section table or with no program headers."
    Revert "[readobj] Dump DT_JMPREL relocations when outputting dynamic relocations."

r260489 depends on r260488 and among other issues r260488 deleted error
handling code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260962 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 14:17:48 +00:00
Michael J. Spencer
9be04e4c36 [readobj] Dump DT_JMPREL relocations when outputting dynamic relocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260489 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 04:59:53 +00:00
Michael J. Spencer
f8cdb803c2 [readobj] Handle ELF files with no section table or with no program headers.
This adds support for finding the dynamic table and dynamic symbol table via
the section table or the program header table. If there's no section table an
attempt is made to figure out the length of the dynamic symbol table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260488 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 04:59:45 +00:00
Hemant Kulkarni
54f4d3a066 [llvm-readobj] Option to emit readelf like output
New option --elf-output-style=LLVM or GNU
Enables -file-headers in readelf style when elf-output-style=GNU

Differential revision: http://reviews.llvm.org/D14128

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 20:40:55 +00:00
Hemant Kulkarni
dc8e8f2ccc Revert "[llvm-readobj] Option to emit readelf like output"
This reverts commit a58765909660a7195b32e0cc8c7476168b913750.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260397 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:21:01 +00:00
Hemant Kulkarni
fce97aeb2d [llvm-readobj] Option to emit readelf like output
New option --elf-output-style=LLVM or GNU
Enables -file-headers in readelf style when elf-output-style=GNU

Differential revision: http://reviews.llvm.org/D14128

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260391 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:51:28 +00:00
Simon Atanasyan
30b32053a4 [llvm-readobj][ELF] Show MIPS GOT content when there is another zero-sized section at the same address
It is possible to have .got section and one or more zero-sized section
at the same address. This patch first checks that GOT (or GOT PLT)
section should have non-zero size using corresponding dynamic tags. Then
it looks up not empty section at the specified address.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260245 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 18:45:35 +00:00
Hemant Kulkarni
8822b47f7c [llvm-readobj] Add -elf-section-groups option
Adds a way to inspect SHT_GROUP sections in ELF objects.
Displays signature, member sections of these sections.

Differential revision: http://reviews.llvm.org/D16555

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258845 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 19:46:39 +00:00
Bradley Smith
36313d3496 [ARM] Add DSP build attribute and extension targeting
This patch was originally committed as r257885, but was reverted due to windows
failures. The cause of these failures has been fixed under r258677, hence
re-committing the original patch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258683 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 11:26:11 +00:00
Simon Atanasyan
8ae8a5ef79 [llvm-readobj][ELF] Teach llvm-readobj to show arch specific ELF section's flags
Some architecture specific ELF section flags might have the same value
(for example SHF_X86_64_LARGE and SHF_HEX_GPREL) and we have to check
machine architectures to select an appropriate set of possible flags.

The patch selects architecture specific flags into separate arrays
`ElfxxxSectionFlags` and combines `ElfSectionFlags` and `ElfxxxSectionFlags`
before pass to the `StreamWriter::printFlags()` method.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 19:15:18 +00:00
George Rimar
f351177eec Fixed CRLF->LF line endings from r257914. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257990 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-16 10:38:32 +00:00
Davide Italiano
bac7fb4eb0 [llvm-readobj] Dump DT_RELACOUNT correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257988 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-16 06:06:36 +00:00
Reid Kleckner
d68684845c [codeview] Handle multiple frame descriptions in readobj
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257943 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15 22:09:13 +00:00
Reid Kleckner
257c031f51 # This is a combination of 2 commits.
# The first commit's message is:

Revert "[ARM] Add DSP build attribute and extension targeting"

This reverts commit b11cc50c0b.

# This is the 2nd commit message:

Revert "[ARM] Add new system registers to ARMv8-M Baseline/Mainline"

This reverts commit 837d08454e.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15 18:31:29 +00:00
George Rimar
acc082d720 Recommit r257912
Added forgotten ELFDumper.cpp to commit.

Initial commit message:
[llvm-readobj] Add support for TLSDESC_PLT and TLSDESC_GOT dynamic section tags to the llvm-readobj.

If module uses uses lazy TLSDESC relocations it should define DT_TLSDESC_PLT and DT_TLSDESC_GOT entries.
They were unknown for llvm-readobj before this patch.

Differential revision: http://reviews.llvm.org/D16224


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257914 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15 18:21:34 +00:00
George Rimar
54a937dc75 Revert r257912 - forgot to commit one file.
Initial commit message:
[llvm-readobj] Add support for TLSDESC_PLT and TLSDESC_GOT dynamic section tags to the llvm-readobj.

If module uses uses lazy TLSDESC relocations it should define DT_TLSDESC_PLT and DT_TLSDESC_GOT entries.
They were unknown for llvm-readobj before this patch.

Differential revision: http://reviews.llvm.org/D16224
----
Added : /llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table-so.aarch64
Modified : /llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table.c
Modified : /llvm/trunk/test/tools/llvm-readobj/dynamic.test




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15 18:19:06 +00:00
George Rimar
7a211194ca [llvm-readobj] Add support for TLSDESC_PLT and TLSDESC_GOT dynamic section tags to the llvm-readobj.
If module uses uses lazy TLSDESC relocations it should define DT_TLSDESC_PLT and DT_TLSDESC_GOT entries.
They were unknown for llvm-readobj before this patch.

Differential revision: http://reviews.llvm.org/D16224

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257912 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15 18:13:59 +00:00
Bradley Smith
b11cc50c0b [ARM] Add DSP build attribute and extension targeting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257885 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15 10:28:25 +00:00
Reid Kleckner
51e1c69050 [codeview] Translate file table offsets to filenames and print them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257846 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15 00:11:21 +00:00
Reid Kleckner
c2046c01da [codeview] Dump CodeView inlinee lines subsection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257790 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14 19:20:17 +00:00
Reid Kleckner
fb30f09c13 [readobj] Expand CodeView dumping functionality
This rewrites and expands the existing codeview dumping functionality in
llvm-readobj using techniques similar to those in lib/Object. This defines a
number of new records and enums useful for reading memory mapped codeview
sections in COFF objects.

The dumper is intended as a testing tool for LLVM as it grows more codeview
output capabilities.

Reviewers: majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257658 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 19:32:35 +00:00
David Majnemer
812af1efba [CodeView] Improve the line table dumper
This change has us print out fields we didn't previously understand.  To
improve readability, we now group column information with it's
respective line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257552 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 01:05:16 +00:00
Reid Kleckner
f2829c933c [llvm-readobj] s/FunctionName/LinkageName/ for codeview dumping
The symbol being printed in this field comes from the main symbol table,
not 0xF1 subsection. Use LinkageName to make that a lot clearer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255596 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15 01:23:55 +00:00
Davide Italiano
c813f4ca03 [llvm-readobj] Teach ELFDumper about symbol versioning.
Differential Revision:	 http://reviews.llvm.org/D13824


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250575 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-16 23:19:01 +00:00
Davide Italiano
600b09339d [llvm-readobj/ELF] Dump DT_VERDEF/DT_VERDEFNUM correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250464 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-15 22:04:55 +00:00
Igor Kudrin
c2fd5af986 [llvm-readobj/ELF] fix: add correct test inputs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250292 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-14 12:21:30 +00:00
Igor Kudrin
4598154b64 [llvm-readobj/ELF] Print GNU Hash section
Add a new command line switch, -gnu-hash-table, to print the content of that section.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250291 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-14 12:11:50 +00:00
Alexandros Lamprineas
966b579475 Added missing test for [ARM] AttributeParser. Check that build attribute
Tag_Advanced_SIMD_arch is set correctly when targeting v8.1-a NEON.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249304 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 12:13:29 +00:00
Davide Italiano
919b448c2e [llvm-readobj] Fix another "time of check to time of use bug".
It seems there's more copy-paste between tools than needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247954 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-17 22:29:58 +00:00
Davide Italiano
70b9edea77 [llvm-readobj] MachO -- correctly dump section field 'Reserved3'
Before we incorrectly ignored it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246556 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-01 16:29:02 +00:00
Rui Ueyama
5c1fa7fc49 Object: Fix COFF import file's symbols.
If a symbol is marked as "data", the symbol should be exported
with __imp_ prefix. Previously, the symbol was exported as-is.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246532 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-01 06:01:53 +00:00
Rui Ueyama
c2aa1793ed llvm-readobj: Dump more info for COFF import libraries.
This patch teaches llvm-readobj to print out COFF import file header fields.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246291 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 10:27:50 +00:00
Rui Ueyama
40e22518fc Re-apply r246276 - Object: Teach llvm-ar to create symbol table for COFF short import files
This patch includes a fix for a llvm-readobj test. With this patch, 
the tool does no longer print out COFF headers for the short import
file, but that's probably desirable because the header for the short
import file is dummy.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246283 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-28 07:40:30 +00:00
Tom Stellard
9baa291a86 ELF: Add AMDGPU specific defintions
Reviewers: rafael

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244303 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 01:35:24 +00:00
Simon Atanasyan
e35d602838 [Mips] Support DT_MIPS_RLD_MAP_REL dynamic section tag in the llvm-readobj
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243833 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-01 12:02:02 +00:00
Simon Atanasyan
13c5e09c6e [llvm-readobj] Print MIPS PLT table
Now the -mips-plt-got prints both MIPS GOT and PLT tables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241836 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-09 18:23:10 +00:00
David Majnemer
b1d6ad18ba [CodeView] Add support for emitting column information
Column information is present in CodeView when the line table subsection
has bit 0 set to 1 in it's flags field.  The column information is
represented as a pair of 16-bit quantities: a starting and ending
column.  This information is present at the end of the chunk, after all
the line-PC pairs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241764 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-09 00:19:51 +00:00
Rafael Espindola
28b186f3cc Improve the --expand-relocs handling of MachO.
In a relocation target can take 3 basic forms

* A r_value in scattered relocations.
* A symbol in external relocations.
* A section is non-external relocations.

Have the dump reflect that. With this change we go from

CHECK-NEXT:       Extern: 0
CHECK-NEXT:       Type: X86_64_RELOC_SUBTRACTOR (5)
CHECK-NEXT:       Symbol: 0x2
CHECK-NEXT:       Scattered: 0

To just

// CHECK-NEXT:       Type: X86_64_RELOC_SUBTRACTOR (5)
// CHECK-NEXT:       Section: __data (2)

Since the relocation is with a section, we print the seciton name and don't
need to say that it is not scattered or external.

Someone motivated can add further special cases for things like
ARM64_RELOC_ADDEND and ARM_RELOC_PAIR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240073 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 22:38:20 +00:00
Rafael Espindola
50cef0052f Pass --expand-relocs to a few more tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240069 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 22:12:47 +00:00
Simon Atanasyan
3bcfd461f6 [llvm-readobj] Print MIPS .reginfo section content
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239856 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-16 21:47:43 +00:00
Rafael Espindola
201a551929 Fix the interpretation of a 0 st_name.
The ELF spec is very clear:

-----------------------------------------------------------------------------
If the value is non-zero, it represents a string table index that gives the
symbol name. Otherwise, the symbol table entry has no name.
--------------------------------------------------------------------------

In particular, a st_name of 0 most certainly doesn't mean that the symbol has
the same name as the section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238899 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-03 05:14:22 +00:00
Davide Italiano
a651b2236f Clarify how the binary file checked in was generated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238665 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-30 22:43:36 +00:00
Davide Italiano
41a6e6a698 [llvm-readobj/ELF] Teach how to decode DF_1_XXX flags
llvm-readobj -dynamic-table output.
Before:
0x000000006FFFFFFB unknown

After:
0x000000006FFFFFFB FLAGS_1 NOW ORIGIN

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238151 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-25 19:12:18 +00:00
Simon Atanasyan
975307cc50 [llvm-readobj] Teach llvm-readobj to print PT_MIPS_ABIFLAGS program header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237451 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-15 15:59:22 +00:00