Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gcc -ffunction-sections -fdata-sections -Wl,-gc-sections asd.c
- #include <stdio.h>
- void __attribute__((noinline)) my_function (void)
- {
- printf ("Hello world\n");
- }
- int main()
- {
- my_function();
- return 0;
- }
- ELF Header:
- Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
- Class: ELF32
- Data: 2's complement, little endian
- Version: 1 (current)
- OS/ABI: UNIX - System V
- ABI Version: 0
- Type: EXEC (Executable file)
- Machine: Intel 80386
- Version: 0x1
- Entry point address: 0x80482d0
- Start of program headers: 52 (bytes into file)
- Start of section headers: 4588 (bytes into file)
- Flags: 0x0
- Size of this header: 52 (bytes)
- Size of program headers: 32 (bytes)
- Number of program headers: 8
- Size of section headers: 40 (bytes)
- Number of section headers: 28
- Section header string table index: 25
- Section Headers:
- [Nr] Name Type Addr Off Size ES Flg Lk Inf Al
- [ 0] NULL 00000000 000000 000000 00 0 0 0
- [ 1] .interp PROGBITS 08048134 000134 000013 00 A 0 0 1
- [ 2] .hash HASH 08048148 000148 000028 04 A 4 0 4
- [ 3] .gnu.hash GNU_HASH 08048170 000170 000020 04 A 4 0 4
- [ 4] .dynsym DYNSYM 08048190 000190 000050 10 A 5 1 4
- [ 5] .dynstr STRTAB 080481e0 0001e0 00004a 00 A 0 0 1
- [ 6] .gnu.version VERSYM 0804822a 00022a 00000a 02 A 4 0 2
- [ 7] .gnu.version_r VERNEED 08048234 000234 000020 00 A 5 1 4
- [ 8] .rel.dyn REL 08048254 000254 000008 08 A 4 0 4
- [ 9] .rel.plt REL 0804825c 00025c 000018 08 A 4 11 4
- [10] .init PROGBITS 08048274 000274 000017 00 AX 0 0 4
- [11] .plt PROGBITS 0804828c 00028c 000040 04 AX 0 0 4
- [12] .text PROGBITS 080482d0 0002d0 000168 00 AX 0 0 16
- [13] .fini PROGBITS 08048438 000438 00001c 00 AX 0 0 4
- [14] .rodata PROGBITS 08048454 000454 000010 00 A 0 0 4
- [15] .eh_frame PROGBITS 08048464 000464 000004 00 A 0 0 4
- [16] .ctors PROGBITS 08049f0c 000f0c 000008 00 WA 0 0 4
- [17] .dtors PROGBITS 08049f14 000f14 000008 00 WA 0 0 4
- [18] .jcr PROGBITS 08049f1c 000f1c 000004 00 WA 0 0 4
- [19] .dynamic DYNAMIC 08049f20 000f20 0000d0 08 WA 5 0 4
- [20] .got PROGBITS 08049ff0 000ff0 000004 04 WA 0 0 4
- [21] .got.plt PROGBITS 08049ff4 000ff4 000018 04 WA 0 0 4
- [22] .data PROGBITS 0804a00c 00100c 000008 00 WA 0 0 4
- [23] .bss NOBITS 0804a014 001014 000004 00 WA 0 0 4
- [24] .comment PROGBITS 00000000 001014 000109 00 0 0 1
- [25] .shstrtab STRTAB 00000000 00111d 0000cd 00 0 0 1
- [26] .symtab SYMTAB 00000000 00164c 0002f0 10 27 30 4
- [27] .strtab STRTAB 00000000 00193c 000129 00 0 0 1
- Key to Flags:
- W (write), A (alloc), X (execute), M (merge), S (strings)
- I (info), L (link order), G (group), x (unknown)
- O (extra OS processing required) o (OS specific), p (processor specific)
- Program Headers:
- Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
- PHDR 0x000034 0x08048034 0x08048034 0x00100 0x00100 R E 0x4
- INTERP 0x000134 0x08048134 0x08048134 0x00013 0x00013 R 0x1
- [Requesting program interpreter: /lib/ld-linux.so.2]
- LOAD 0x000000 0x08048000 0x08048000 0x00468 0x00468 R E 0x1000
- LOAD 0x000f0c 0x08049f0c 0x08049f0c 0x00108 0x0010c RW 0x1000
- DYNAMIC 0x000f20 0x08049f20 0x08049f20 0x000d0 0x000d0 RW 0x4
- GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x4
- GNU_RELRO 0x000f0c 0x08049f0c 0x08049f0c 0x000f4 0x000f4 R 0x1
- PAX_FLAGS 0x000000 0x00000000 0x00000000 0x00000 0x00000 0x4
- Section to Segment mapping:
- Segment Sections...
- 00
- 01 .interp
- 02 .interp .hash .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .eh_frame
- 03 .ctors .dtors .jcr .dynamic .got .got.plt .data .bss
- 04 .dynamic
- 05
- 06 .ctors .dtors .jcr .dynamic .got
- 07
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement