UNIX Command
$cat hello.c
#include
main()
{
int d;
scanf("%d",d);
printf("%d",d);
}
$gcc hello.c
$ulimit -c unlimited
$./a.out
3
Segmentation fault (core dumped)
$readelf -s core
$readelf -a core
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: CORE (Core file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x0
Start of program headers: 64 (bytes into file)
Start of section headers: 0 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 17
Size of section headers: 0 (bytes)
Number of section headers: 0
Section header string table index: 0
There are no sections in this file.
There are no sections to group in this file.
Program Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flags Align
NOTE 0x00000000000003f8 0x0000000000000000 0x0000000000000000
0x0000000000000558 0x0000000000000000 0
LOAD 0x0000000000001000 0x0000000000400000 0x0000000000000000
0x0000000000001000 0x0000000000001000 R E 1000
LOAD 0x0000000000002000 0x0000000000600000 0x0000000000000000
0x0000000000001000 0x0000000000001000 RW 1000
LOAD 0x0000000000003000 0x00007f1e480c7000 0x0000000000000000
0x0000000000001000 0x000000000017a000 R E 1000
LOAD 0x0000000000004000 0x00007f1e48241000 0x0000000000000000
0x0000000000000000 0x0000000000200000 1000
LOAD 0x0000000000004000 0x00007f1e48441000 0x0000000000000000
0x0000000000004000 0x0000000000004000 R 1000
LOAD 0x0000000000008000 0x00007f1e48445000 0x0000000000000000
0x0000000000001000 0x0000000000001000 RW 1000
LOAD 0x0000000000009000 0x00007f1e48446000 0x0000000000000000
0x0000000000005000 0x0000000000005000 RW 1000
LOAD 0x000000000000e000 0x00007f1e4844b000 0x0000000000000000
0x0000000000001000 0x000000000001f000 R E 1000
LOAD 0x000000000000f000 0x00007f1e48643000 0x0000000000000000
0x0000000000003000 0x0000000000003000 RW 1000
LOAD 0x0000000000012000 0x00007f1e48667000 0x0000000000000000
0x0000000000003000 0x0000000000003000 RW 1000
LOAD 0x0000000000015000 0x00007f1e4866a000 0x0000000000000000
0x0000000000001000 0x0000000000001000 R 1000
LOAD 0x0000000000016000 0x00007f1e4866b000 0x0000000000000000
0x0000000000001000 0x0000000000001000 RW 1000
LOAD 0x0000000000017000 0x00007f1e4866c000 0x0000000000000000
0x0000000000001000 0x0000000000001000 RW 1000
LOAD 0x0000000000018000 0x00007fff27f53000 0x0000000000000000
0x0000000000022000 0x0000000000022000 RW 1000
LOAD 0x000000000003a000 0x00007fff27fff000 0x0000000000000000
0x0000000000001000 0x0000000000001000 R E 1000
LOAD 0x000000000003b000 0xffffffffff600000 0x0000000000000000
0x0000000000000000 0x0000000000001000 R E 1000
There is no dynamic section in this file.
There are no relocations in this file.
There are no unwind sections in this file.
No version information found in this file.
Notes at offset 0x000003f8 with length 0x00000558:
Owner Data size Description
CORE 0x00000150 NT_PRSTATUS (prstatus structure)
CORE 0x00000088 NT_PRPSINFO (prpsinfo structure)
CORE 0x00000130 NT_AUXV (auxiliary vector)
CORE 0x00000200 NT_FPREGSET (floating point registers)
$
UNIX Explanation
readelf displays information about one or more ELF format object
files. The options control what particular information to display.
elffile... are the object files to be examined. 32-bit and 64-bit
ELF files are supported, as are archives containing ELF files.
This program performs a similar function to objdump but it goes
into more detail and it exists independently of the BFD library, so
if there is a bug in BFD then readelf will not be affected.