Advertisement
Guest User

Untitled

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