Skip to content

Instantly share code, notes, and snippets.

@AmaanC
Created June 8, 2018 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AmaanC/4e1aaa2cbdda974b93c5a3e1eac5318a to your computer and use it in GitHub Desktop.
Save AmaanC/4e1aaa2cbdda974b93c5a3e1eac5318a to your computer and use it in GitHub Desktop.
(gdb) info file
Symbols from "/media/commonhdd/repos/rtems/b-x86_64-boot_card-efi/x86_64-rtems5/c/amd64/testsuites/samples/hello.exe".
Local exec file:
`/media/commonhdd/repos/rtems/b-x86_64-boot_card-efi/x86_64-rtems5/c/amd64/testsuites/samples/hello.exe', file type elf64-x86-64.
Entry point: 0x3000
0x00000000 - 0x00000344 is .hash
...
(gdb) disas _start
Dump of assembler code for function _text:
0x00003000 <+0>: sub $0x8,%rsp
0x00003004 <+4>: push %rcx
0x00003005 <+5>: push %rdx
0x00003006 <+6>: lea -0x300d(%rip),%rdi # 0x0
0x0000300d <+13>: lea 0x9fec(%rip),%rsi # 0xd000
0x00003014 <+20>: pop %rcx
0x00003015 <+21>: pop %rdx
0x00003016 <+22>: push %rcx
0x00003017 <+23>: push %rdx
0x00003018 <+24>: callq 0x3030 <_relocate>
0x0000301d <+29>: pop %rdi
0x0000301e <+30>: pop %rsi
0x0000301f <+31>: callq 0x8736 <efi_main>
0x00003024 <+36>: add $0x8,%rsp
End of assembler dump.
(gdb) disas efi_main
Dump of assembler code for function efi_main:
0x00008736 <+0>: push %rbp
0x00008737 <+1>: mov %rsp,%rbp
0x0000873a <+4>: sub $0x10,%rsp
0x0000873e <+8>: mov %rdi,-0x8(%rbp)
0x00008742 <+12>: mov %rsi,-0x10(%rbp)
0x00008746 <+16>: mov -0x10(%rbp),%rdx
0x0000874a <+20>: mov -0x8(%rbp),%rax
0x0000874e <+24>: mov %rdx,%rsi
0x00008751 <+27>: mov %rax,%rdi
0x00008754 <+30>: callq 0x3230 <InitializeLib>
0x00008759 <+35>: lea 0x18d0(%rip),%rdi # 0xa030
0x00008760 <+42>: mov $0x0,%eax
0x00008765 <+47>: callq 0x5340 <Print>
0x0000876a <+52>: mov $0x0,%eax
0x0000876f <+57>: callq 0x877b <boot_card>
0x00008774 <+62>: mov $0x0,%eax
0x00008779 <+67>: leaveq
0x0000877a <+68>: retq
End of assembler dump.
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment