Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-readobj] Impl GNU style printing of sections and relocations
Differential Revision: http://reviews.llvm.org/D17523 llvm-svn: 263561
- Loading branch information
Hemant Kulkarni
committed
Mar 15, 2016
1 parent
272de1e
commit c030f23
Showing
5 changed files
with
709 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
RUN: llvm-readobj -r %p/Inputs/relocs.obj.elf-i386 --elf-output-style=GNU \ | ||
RUN: | FileCheck %s -check-prefix ELF32 | ||
RUN: llvm-readobj -r %p/Inputs/relocs.obj.elf-x86_64 --elf-output-style=GNU \ | ||
RUN: | FileCheck %s -check-prefix ELF64 | ||
|
||
ELF32: Relocation section '.rel.text' at offset 0x318 contains 41 entries: | ||
ELF32-NEXT: Offset Info Type Sym. Value Symbol's Name | ||
ELF32-NEXT: 00000002 00000500 R_386_NONE 00000000 sym | ||
ELF32-NEXT: 00000008 00000501 R_386_32 00000000 sym | ||
ELF32-NEXT: 0000000e 00000502 R_386_PC32 00000000 sym | ||
ELF32-NEXT: 00000014 00000503 R_386_GOT32 00000000 sym | ||
ELF32-NEXT: 0000001a 00000504 R_386_PLT32 00000000 sym | ||
ELF32-NEXT: 00000020 00000505 R_386_COPY 00000000 sym | ||
ELF32-NEXT: 00000026 00000506 R_386_GLOB_DAT 00000000 sym | ||
ELF32-NEXT: 0000002c 00000507 R_386_JUMP_SLOT 00000000 sym | ||
ELF32-NEXT: 00000032 00000508 R_386_RELATIVE 00000000 sym | ||
ELF32-NEXT: 00000038 00000509 R_386_GOTOFF 00000000 sym | ||
|
||
ELF64: Relocation section '.rela.text' at offset 0x430 contains 38 entries: | ||
ELF64-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend | ||
ELF64-NEXT: 0000000000000003 0000000500000000 R_X86_64_NONE 0000000000000000 sym - 4 | ||
ELF64-NEXT: 000000000000000a 0000000500000001 R_X86_64_64 0000000000000000 sym - 4 | ||
ELF64-NEXT: 0000000000000011 0000000500000002 R_X86_64_PC32 0000000000000000 sym - 4 | ||
ELF64-NEXT: 0000000000000018 0000000500000003 R_X86_64_GOT32 0000000000000000 sym - 4 | ||
ELF64-NEXT: 000000000000001f 0000000500000004 R_X86_64_PLT32 0000000000000000 sym - 4 | ||
ELF64-NEXT: 0000000000000026 0000000500000005 R_X86_64_COPY 0000000000000000 sym - 4 | ||
ELF64-NEXT: 000000000000002d 0000000500000006 R_X86_64_GLOB_DAT 0000000000000000 sym - 4 | ||
ELF64-NEXT: 0000000000000034 0000000500000007 R_X86_64_JUMP_SLOT 0000000000000000 sym - 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
RUN: llvm-readobj -s %p/Inputs/relocs.obj.elf-i386 --elf-output-style=GNU \ | ||
RUN: | FileCheck %s -check-prefix ELF32 | ||
RUN: llvm-readobj -s %p/Inputs/relocs.obj.elf-x86_64 --elf-output-style=GNU \ | ||
RUN: | FileCheck %s -check-prefix ELF64 | ||
|
||
ELF32: Section Headers: | ||
ELF32-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al | ||
ELF32-NEXT: [ 0] NULL 00000000 000000 000000 00 0 0 0 | ||
ELF32-NEXT: [ 1] .text PROGBITS 00000000 000034 0000f6 00 AX 0 0 4 | ||
ELF32-NEXT: [ 2] .rel.text REL 00000000 000318 000148 08 6 1 4 | ||
ELF32-NEXT: [ 3] .data PROGBITS 00000000 00012c 000000 00 WA 0 0 4 | ||
ELF32-NEXT: [ 4] .bss NOBITS 00000000 00012c 000000 00 WA 0 0 4 | ||
ELF32-NEXT: [ 5] .shstrtab STRTAB 00000000 00012c 000030 00 0 0 1 | ||
ELF32-NEXT: [ 6] .symtab SYMTAB 00000000 00029c 000060 10 7 4 4 | ||
ELF32-NEXT: [ 7] .strtab STRTAB 00000000 0002fc 00001b 00 0 0 1 | ||
ELF32-NEXT: Key to Flags: | ||
ELF32-NEXT: W (write), A (alloc), X (execute), M (merge), S (strings), l (large) | ||
ELF32-NEXT: I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown) | ||
ELF32-NEXT: O (extra OS processing required) o (OS specific), p (processor specific) | ||
|
||
ELF64: There are 8 section headers, starting at offset 0x180: | ||
ELF64: Section Headers: | ||
ELF64-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al | ||
ELF64-NEXT: [ 0] NULL 0000000000000000 000000 000000 00 0 0 0 | ||
ELF64-NEXT: [ 1] .text PROGBITS 0000000000000000 000040 00010a 00 AX 0 0 4 | ||
ELF64-NEXT: [ 2] .rela.text RELA 0000000000000000 000430 000390 18 6 1 8 | ||
ELF64-NEXT: [ 3] .data PROGBITS 0000000000000000 00014c 000000 00 WA 0 0 4 | ||
ELF64-NEXT: [ 4] .bss NOBITS 0000000000000000 00014c 000000 00 WA 0 0 4 | ||
ELF64-NEXT: [ 5] .shstrtab STRTAB 0000000000000000 00014c 000031 00 0 0 1 | ||
ELF64-NEXT: [ 6] .symtab SYMTAB 0000000000000000 000380 000090 18 7 4 8 | ||
ELF64-NEXT: [ 7] .strtab STRTAB 0000000000000000 000410 00001b 00 0 0 1 | ||
ELF64-NEXT: Key to Flags: | ||
ELF64-NEXT: W (write), A (alloc), X (execute), M (merge), S (strings), l (large) | ||
ELF64-NEXT: I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown) | ||
ELF64-NEXT: O (extra OS processing required) o (OS specific), p (processor specific) |
Oops, something went wrong.