Last active
July 1, 2019 17:41
More concise disassembly of https://gist.github.com/nickdesaulniers/395129e75d9f7afe028db832145594d8
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
; $ objdump -d -r -j __jump_table arch/x86/kernel/cpu/mtrr/generic.o | |
arch/x86/kernel/cpu/mtrr/generic.o: file format elf64-x86-64 | |
Disassembly of section __jump_table: | |
0000000000000000 <__jump_table>: | |
... | |
10: R_X86_64_PC32 .text+0x3f9 | |
14: R_X86_64_PC32 .text+0x400 | |
18: R_X86_64_PC64 __tracepoint_read_msr+0x8 | |
20: R_X86_64_PC32 .text+0x434 | |
24: R_X86_64_PC32 .text+0x400 | |
28: R_X86_64_PC64 __tracepoint_read_msr+0x8 | |
... |
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
; $ gdb -batch -ex "file arch/x86/kernel/cpu/mtrr/generic.o" -ex "disassemble get_fixed_ranges" | |
Dump of assembler code for function get_fixed_ranges: | |
... | |
0x00000000000003f9 <+89>: nopl 0x0(%rax,%rax,1) | |
0x00000000000003fe <+94>: jmp 0x40f <get_fixed_ranges+111> | |
0x0000000000000400 <+96>: mov $0x258,%edi | |
0x0000000000000405 <+101>: mov %rbx,%rsi | |
0x0000000000000408 <+104>: xor %edx,%edx | |
0x000000000000040a <+106>: callq 0x40f <get_fixed_ranges+111> | |
0x000000000000040f <+111>: mov %r14d,0x0(%rip) # 0x416 <get_fixed_ranges+118> | |
0x0000000000000416 <+118>: shr $0x20,%rbx | |
0x000000000000041a <+122>: mov %ebx,0x0(%rip) # 0x420 <get_fixed_ranges+128> | |
0x0000000000000420 <+128>: mov $0x259,%ecx | |
0x0000000000000425 <+133>: rdmsr | |
0x0000000000000427 <+135>: mov %rax,%r14 | |
0x000000000000042a <+138>: mov %rdx,%rbx | |
0x000000000000042d <+141>: shl $0x20,%rbx | |
0x0000000000000431 <+145>: or %rax,%rbx | |
0x0000000000000434 <+148>: nopl 0x0(%rax,%rax,1) | |
0x0000000000000439 <+153>: jmp 0x44a <get_fixed_ranges+170> | |
0x000000000000043b <+155>: mov $0x259,%edi | |
0x0000000000000440 <+160>: mov %rbx,%rsi | |
0x0000000000000443 <+163>: xor %edx,%edx | |
0x0000000000000445 <+165>: callq 0x44a <get_fixed_ranges+170> | |
0x000000000000044a <+170>: mov %r14d,0x0(%rip) # 0x451 <get_fixed_ranges+177> | |
... |
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
$ make CC=clang | |
... | |
arch/x86/kernel/cpu/mtrr/generic.o: warning: objtool: get_fixed_ranges()+0x9b: unreachable instruction | |
$ python -c 'print(hex(0x3a0 + 0x9b))' | |
0x43b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment