Skip to content

Instantly share code, notes, and snippets.

@jiridanek
Last active May 14, 2020 13:06
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 jiridanek/c1171bdcd59e6ce499255176e8211e8c to your computer and use it in GitHub Desktop.
Save jiridanek/c1171bdcd59e6ce499255176e8211e8c to your computer and use it in GitHub Desktop.
$ objdump -d -s -j .plt -j .got.plt /lib/aarch64-linux-gnu/libc-2.31.so
/lib/aarch64-linux-gnu/libc-2.31.so: file format elf64-littleaarch64
Contents of section .plt:
23aa0 f07bbfa9 300a00f0 11fe47f9 10e23f91 .{..0.....G...?.
23ab0 20021fd6 1f2003d5 1f2003d5 1f2003d5 .... ... ... ..
23ac0 500a0090 110240f9 10020091 20021fd6 P.....@..... ...
23ad0 500a0090 110640f9 10220091 20021fd6 P.....@..".. ...
23ae0 500a0090 110a40f9 10420091 20021fd6 P.....@..B.. ...
23af0 500a0090 110e40f9 10620091 20021fd6 P.....@..b.. ...
23b00 500a0090 111240f9 10820091 20021fd6 P.....@..... ...
23b10 500a0090 111640f9 10a20091 20021fd6 P.....@..... ...
23b20 500a0090 111a40f9 10c20091 20021fd6 P.....@..... ...
23b30 500a0090 111e40f9 10e20091 20021fd6 P.....@..... ...
23b40 500a0090 112240f9 10020191 20021fd6 P...."@..... ...
23b50 500a0090 112640f9 10220191 20021fd6 P....&@..".. ...
23b60 500a0090 112a40f9 10420191 20021fd6 P....*@..B.. ...
23b70 500a0090 112e40f9 10620191 20021fd6 P.....@..b.. ...
23b80 500a0090 113240f9 10820191 20021fd6 P....2@..... ...
Contents of section .got.plt:
16afe8 00000000 00000000 00000000 00000000 ................
16aff8 00000000 00000000 a03a0200 00000000 .........:......
16b008 a03a0200 00000000 a03a0200 00000000 .:.......:......
16b018 a03a0200 00000000 a03a0200 00000000 .:.......:......
16b028 a03a0200 00000000 a03a0200 00000000 .:.......:......
16b038 a03a0200 00000000 a03a0200 00000000 .:.......:......
16b048 a03a0200 00000000 a03a0200 00000000 .:.......:......
16b058 a03a0200 00000000 a03a0200 00000000 .:.......:......
Disassembly of section .plt:
0000000000023aa0 <realloc@plt-0x20>:
23aa0: a9bf7bf0 stp x16, x30, [sp, #-16]!
23aa4: f0000a30 adrp x16, 16a000 <sys_sigabbrev@@GLIBC_2.17+0x170>
23aa8: f947fe11 ldr x17, [x16, #4088]
23aac: 913fe210 add x16, x16, #0xff8
23ab0: d61f0220 br x17
23ab4: d503201f nop
23ab8: d503201f nop
23abc: d503201f nop
0000000000023ac0 <realloc@plt>:
23ac0: 90000a50 adrp x16, 16b000 <realloc@@GLIBC_2.17+0xee278>
23ac4: f9400211 ldr x17, [x16]
23ac8: 91000210 add x16, x16, #0x0
23acc: d61f0220 br x17
0000000000023ad0 <__libpthread_freeres@plt>:
23ad0: 90000a50 adrp x16, 16b000 <realloc@@GLIBC_2.17+0xee278>
23ad4: f9400611 ldr x17, [x16, #8]
23ad8: 91002210 add x16, x16, #0x8
23adc: d61f0220 br x17
0000000000023ae0 <malloc@plt>:
23ae0: 90000a50 adrp x16, 16b000 <realloc@@GLIBC_2.17+0xee278>
23ae4: f9400a11 ldr x17, [x16, #16]
23ae8: 91004210 add x16, x16, #0x10
23aec: d61f0220 br x17
0000000000023af0 <memalign@plt>:
23af0: 90000a50 adrp x16, 16b000 <realloc@@GLIBC_2.17+0xee278>
23af4: f9400e11 ldr x17, [x16, #24]
23af8: 91006210 add x16, x16, #0x18
23afc: d61f0220 br x17
0000000000023b00 <_dl_exception_create@plt>:
23b00: 90000a50 adrp x16, 16b000 <realloc@@GLIBC_2.17+0xee278>
23b04: f9401211 ldr x17, [x16, #32]
23b08: 91008210 add x16, x16, #0x20
23b0c: d61f0220 br x17
0000000000023b10 <__tunable_get_val@plt>:
23b10: 90000a50 adrp x16, 16b000 <realloc@@GLIBC_2.17+0xee278>
23b14: f9401611 ldr x17, [x16, #40]
23b18: 9100a210 add x16, x16, #0x28
23b1c: d61f0220 br x17
0000000000023b20 <_dl_find_dso_for_object@plt>:
23b20: 90000a50 adrp x16, 16b000 <realloc@@GLIBC_2.17+0xee278>
23b24: f9401a11 ldr x17, [x16, #48]
23b28: 9100c210 add x16, x16, #0x30
23b2c: d61f0220 br x17
0000000000023b30 <calloc@plt>:
23b30: 90000a50 adrp x16, 16b000 <realloc@@GLIBC_2.17+0xee278>
23b34: f9401e11 ldr x17, [x16, #56]
23b38: 9100e210 add x16, x16, #0x38
23b3c: d61f0220 br x17
0000000000023b40 <__libdl_freeres@plt>:
23b40: 90000a50 adrp x16, 16b000 <realloc@@GLIBC_2.17+0xee278>
23b44: f9402211 ldr x17, [x16, #64]
23b48: 91010210 add x16, x16, #0x40
23b4c: d61f0220 br x17
0000000000023b50 <free@plt>:
23b50: 90000a50 adrp x16, 16b000 <realloc@@GLIBC_2.17+0xee278>
23b54: f9402611 ldr x17, [x16, #72]
23b58: 91012210 add x16, x16, #0x48
23b5c: d61f0220 br x17
0000000000023b60 <__tls_get_addr@plt>:
23b60: 90000a50 adrp x16, 16b000 <realloc@@GLIBC_2.17+0xee278>
23b64: f9402a11 ldr x17, [x16, #80]
23b68: 91014210 add x16, x16, #0x50
23b6c: d61f0220 br x17
0000000000023b70 <*ABS*+0x81be0@plt>:
23b70: 90000a50 adrp x16, 16b000 <realloc@@GLIBC_2.17+0xee278>
23b74: f9402e11 ldr x17, [x16, #88]
23b78: 91016210 add x16, x16, #0x58
23b7c: d61f0220 br x17
0000000000023b80 <*ABS*+0x80a10@plt>:
23b80: 90000a50 adrp x16, 16b000 <realloc@@GLIBC_2.17+0xee278>
23b84: f9403211 ldr x17, [x16, #96]
23b88: 91018210 add x16, x16, #0x60
23b8c: d61f0220 br x17
Disassembly of section .got.plt:
000000000016afe8 <.got.plt>:
...
16b000: 00023aa0 .word 0x00023aa0
16b004: 00000000 .word 0x00000000
16b008: 00023aa0 .word 0x00023aa0
16b00c: 00000000 .word 0x00000000
16b010: 00023aa0 .word 0x00023aa0
16b014: 00000000 .word 0x00000000
16b018: 00023aa0 .word 0x00023aa0
16b01c: 00000000 .word 0x00000000
16b020: 00023aa0 .word 0x00023aa0
16b024: 00000000 .word 0x00000000
16b028: 00023aa0 .word 0x00023aa0
16b02c: 00000000 .word 0x00000000
16b030: 00023aa0 .word 0x00023aa0
16b034: 00000000 .word 0x00000000
16b038: 00023aa0 .word 0x00023aa0
16b03c: 00000000 .word 0x00000000
16b040: 00023aa0 .word 0x00023aa0
16b044: 00000000 .word 0x00000000
16b048: 00023aa0 .word 0x00023aa0
16b04c: 00000000 .word 0x00000000
16b050: 00023aa0 .word 0x00023aa0
16b054: 00000000 .word 0x00000000
16b058: 00023aa0 .word 0x00023aa0
16b05c: 00000000 .word 0x00000000
16b060: 00023aa0 .word 0x00023aa0
16b064: 00000000 .word 0x00000000
$ objdump -d /lib/aarch64-linux-gnu/libc-2.31.so | grep 0000000000023fa8 -A 50
0000000000023fa8 <__libc_start_main@@GLIBC_2.17>:
23fa8: a9ab7bfd stp x29, x30, [sp, #-336]!
23fac: f0000a24 adrp x4, 16a000 <sys_sigabbrev@@GLIBC_2.17+0x170>
23fb0: 910003fd mov x29, sp
23fb4: f9479084 ldr x4, [x4, #3872]
23fb8: a90153f3 stp x19, x20, [sp, #16]
23fbc: aa0303f3 mov x19, x3
23fc0: a9025bf5 stp x21, x22, [sp, #32]
23fc4: a90363f7 stp x23, x24, [sp, #48]
23fc8: f90023f9 str x25, [sp, #64]
23fcc: f9002fe2 str x2, [sp, #88]
23fd0: b90067e1 str w1, [sp, #100]
23fd4: 52800001 mov w1, #0x0 // #0
23fd8: f90037e0 str x0, [sp, #104]
23fdc: aa0503e0 mov x0, x5
23fe0: b4000084 cbz x4, 23ff0 <__libc_start_main@@GLIBC_2.17+0x48>
23fe4: b9400081 ldr w1, [x4]
23fe8: 7100003f cmp w1, #0x0
23fec: 1a9f17e1 cset w1, eq // eq = none
23ff0: 90000a42 adrp x2, 16b000 <realloc@@GLIBC_2.17+0xee278>
23ff4: b9006841 str w1, [x2, #104]
23ff8: b4000080 cbz x0, 24008 <__libc_start_main@@GLIBC_2.17+0x60>
23ffc: d2800002 mov x2, #0x0 // #0
24000: d2800001 mov x1, #0x0 // #0
24004: 940056fd bl 39bf8 <__cxa_atexit@@GLIBC_2.17>
24008: d0000a22 adrp x2, 16a000 <sys_sigabbrev@@GLIBC_2.17+0x170>
2400c: f9470042 ldr x2, [x2, #3584]
24010: b9400040 ldr w0, [x2]
24014: 121f0014 and w20, w0, #0x2
24018: 370803e0 tbnz w0, #1, 24094 <__libc_start_main@@GLIBC_2.17+0xec>
2401c: b40000f3 cbz x19, 24038 <__libc_start_main@@GLIBC_2.17+0x90>
24020: d0000a22 adrp x2, 16a000 <sys_sigabbrev@@GLIBC_2.17+0x170>
24024: b94067e0 ldr w0, [sp, #100]
24028: f9402fe1 ldr x1, [sp, #88]
2402c: f9472c42 ldr x2, [x2, #3672]
24030: f9400042 ldr x2, [x2]
24034: d63f0260 blr x19
24038: d0000a20 adrp x0, 16a000 <sys_sigabbrev@@GLIBC_2.17+0x170>
2403c: f9470000 ldr x0, [x0, #3584]
24040: b9426801 ldr w1, [x0, #616]
24044: 35000641 cbnz w1, 2410c <__libc_start_main@@GLIBC_2.17+0x164>
24048: 35000934 cbnz w20, 2416c <__libc_start_main@@GLIBC_2.17+0x1c4>
2404c: 9101e3e0 add x0, sp, #0x78
24050: 94004b28 bl 36cf0 <_setjmp@@GLIBC_2.17>
24054: 35000300 cbnz w0, 240b4 <__libc_start_main@@GLIBC_2.17+0x10c>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment