X86: Add tests for static function pointer
* testsuite/ld-i386/no-plt-check1a.S (check): Test static function pointer. * testsuite/ld-i386/no-plt-check1b.S (check): Likewise. * testsuite/ld-x86-64/no-plt-check1.S (check): Likewise. * testsuite/ld-i386/no-plt-extern1a.S (func_p): New. Static function pointer. * testsuite/ld-i386/no-plt-extern1b.S (func_p): Likewise. * testsuite/ld-x86-64/no-plt-extern1.S (func_p): Likewise. * testsuite/ld-i386/no-plt-1a.dd: Updated. * testsuite/ld-i386/no-plt-1b.dd: Likewise. * testsuite/ld-i386/no-plt-1c.dd: Likewise. * testsuite/ld-i386/no-plt-1d.dd: Likewise. * testsuite/ld-i386/no-plt-1e.dd: Likewise. * testsuite/ld-i386/no-plt-1f.dd: Likewise. * testsuite/ld-i386/no-plt-1g.dd: Likewise. * testsuite/ld-i386/no-plt-1h.dd: Likewise. * testsuite/ld-i386/no-plt-1i.dd: Likewise. * testsuite/ld-i386/no-plt-1j.dd: Likewise. * testsuite/ld-x86-64/no-plt-1a.dd: Likewise. * testsuite/ld-x86-64/no-plt-1b.dd: Likewise. * testsuite/ld-x86-64/no-plt-1c.dd: Likewise. * testsuite/ld-x86-64/no-plt-1d.dd: Likewise. * testsuite/ld-x86-64/no-plt-1e.dd: Likewise. * testsuite/ld-x86-64/no-plt-1f.dd: Likewise. * testsuite/ld-x86-64/no-plt-1g.dd: Likewise.
This commit is contained in:
parent
3ee6e4fbec
commit
3a4b0e0f96
28
ld/ChangeLog
28
ld/ChangeLog
@ -1,3 +1,31 @@
|
||||
2016-06-15 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* testsuite/ld-i386/no-plt-check1a.S (check): Test static
|
||||
function pointer.
|
||||
* testsuite/ld-i386/no-plt-check1b.S (check): Likewise.
|
||||
* testsuite/ld-x86-64/no-plt-check1.S (check): Likewise.
|
||||
* testsuite/ld-i386/no-plt-extern1a.S (func_p): New. Static
|
||||
function pointer.
|
||||
* testsuite/ld-i386/no-plt-extern1b.S (func_p): Likewise.
|
||||
* testsuite/ld-x86-64/no-plt-extern1.S (func_p): Likewise.
|
||||
* testsuite/ld-i386/no-plt-1a.dd: Updated.
|
||||
* testsuite/ld-i386/no-plt-1b.dd: Likewise.
|
||||
* testsuite/ld-i386/no-plt-1c.dd: Likewise.
|
||||
* testsuite/ld-i386/no-plt-1d.dd: Likewise.
|
||||
* testsuite/ld-i386/no-plt-1e.dd: Likewise.
|
||||
* testsuite/ld-i386/no-plt-1f.dd: Likewise.
|
||||
* testsuite/ld-i386/no-plt-1g.dd: Likewise.
|
||||
* testsuite/ld-i386/no-plt-1h.dd: Likewise.
|
||||
* testsuite/ld-i386/no-plt-1i.dd: Likewise.
|
||||
* testsuite/ld-i386/no-plt-1j.dd: Likewise.
|
||||
* testsuite/ld-x86-64/no-plt-1a.dd: Likewise.
|
||||
* testsuite/ld-x86-64/no-plt-1b.dd: Likewise.
|
||||
* testsuite/ld-x86-64/no-plt-1c.dd: Likewise.
|
||||
* testsuite/ld-x86-64/no-plt-1d.dd: Likewise.
|
||||
* testsuite/ld-x86-64/no-plt-1e.dd: Likewise.
|
||||
* testsuite/ld-x86-64/no-plt-1f.dd: Likewise.
|
||||
* testsuite/ld-x86-64/no-plt-1g.dd: Likewise.
|
||||
|
||||
2016-06-14 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
|
||||
|
||||
PR ld/20254
|
||||
|
@ -13,6 +13,9 @@ Disassembly of section .text:
|
||||
+[a-f0-9]+: 83 ec 08 sub \$0x8,%esp
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <get_func>
|
||||
+[a-f0-9]+: 81 f8 ([0-9a-f]{2} ){4}[ ]+cmp +\$0x[0-9a-f]+,%eax
|
||||
+[a-f0-9]+: 75 39 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: c7 c2 ([0-9a-f]{2} ){4}[ ]+mov +\$0x[a-f0-9]+,%edx
|
||||
+[a-f0-9]+: 39 02 cmp %eax,\(%edx\)
|
||||
+[a-f0-9]+: 75 2f jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <func>
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -13,6 +13,9 @@ Disassembly of section .text:
|
||||
+[a-f0-9]+: 83 ec 08 sub \$0x8,%esp
|
||||
+[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\)
|
||||
+[a-f0-9]+: 3b 83 ([0-9a-f]{2} ){4}[ ]+cmp +-0x[a-f0-9]+\(%ebx\),%eax
|
||||
+[a-f0-9]+: 75 39 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 8b 93 ([0-9a-f]{2} ){4}[ ]+mov +-0x[0-9a-f]+\(%ebx\),%edx
|
||||
+[a-f0-9]+: 39 02 cmp %eax,\(%edx\)
|
||||
+[a-f0-9]+: 75 2f jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\)
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -13,6 +13,9 @@ Disassembly of section .text:
|
||||
+[a-f0-9]+: 83 ec 08 sub \$0x8,%esp
|
||||
+[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\)
|
||||
+[a-f0-9]+: 81 f8 ([0-9a-f]{2} ){4}[ ]+cmp +\$0x[0-9a-f]+,%eax
|
||||
+[a-f0-9]+: 75 39 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 8b 93 ([0-9a-f]{2} ){4}[ ]+mov +-0x[0-9a-f]+\(%ebx\),%edx
|
||||
+[a-f0-9]+: 39 02 cmp %eax,\(%edx\)
|
||||
+[a-f0-9]+: 75 2f jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <func>
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -13,6 +13,9 @@ Disassembly of section .text:
|
||||
+[a-f0-9]+: 83 ec 08 sub \$0x8,%esp
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <get_func>
|
||||
+[a-f0-9]+: 81 f8 ([0-9a-f]{2} ){4}[ ]+cmp +\$0x[0-9a-f]+,%eax
|
||||
+[a-f0-9]+: 75 39 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: c7 c2 ([0-9a-f]{2} ){4}[ ]+mov +\$0x[a-f0-9]+,%edx
|
||||
+[a-f0-9]+: 39 02 cmp %eax,\(%edx\)
|
||||
+[a-f0-9]+: 75 2f jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <func>
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -13,6 +13,9 @@ Disassembly of section .text:
|
||||
+[a-f0-9]+: 83 ec 08 sub \$0x8,%esp
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <get_func>
|
||||
+[a-f0-9]+: 3b 83 ([0-9a-f]{2} ){4}[ ]+cmp +-0x[a-f0-9]+\(%ebx\),%eax
|
||||
+[a-f0-9]+: 75 39 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 8d 93 ([0-9a-f]{2} ){4}[ ]+lea +0x[a-f0-9]+\(%ebx\),%edx
|
||||
+[a-f0-9]+: 39 02 cmp %eax,\(%edx\)
|
||||
+[a-f0-9]+: 75 2f jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <func>
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -13,6 +13,9 @@ Disassembly of section .text:
|
||||
+[a-f0-9]+: 83 ec 08 sub \$0x8,%esp
|
||||
+[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\)
|
||||
+[a-f0-9]+: 3b 83 ([0-9a-f]{2} ){4}[ ]+cmp +-0x[a-f0-9]+\(%ebx\),%eax
|
||||
+[a-f0-9]+: 75 39 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 8b 93 ([0-9a-f]{2} ){4}[ ]+mov +-0x[0-9a-f]+\(%ebx\),%edx
|
||||
+[a-f0-9]+: 39 02 cmp %eax,\(%edx\)
|
||||
+[a-f0-9]+: 75 2f jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\)
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -13,6 +13,9 @@ Disassembly of section .text:
|
||||
+[a-f0-9]+: 83 ec 08 sub \$0x8,%esp
|
||||
+[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\)
|
||||
+[a-f0-9]+: 3b 83 ([0-9a-f]{2} ){4}[ ]+cmp +-0x[a-f0-9]+\(%ebx\),%eax
|
||||
+[a-f0-9]+: 75 39 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 8b 93 ([0-9a-f]{2} ){4}[ ]+mov +-0x[0-9a-f]+\(%ebx\),%edx
|
||||
+[a-f0-9]+: 39 02 cmp %eax,\(%edx\)
|
||||
+[a-f0-9]+: 75 2f jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <func>
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -9,7 +9,10 @@ Disassembly of section .text:
|
||||
[0-9a-f]+ <check>:
|
||||
+[a-f0-9]+: 83 ec 0c sub \$0xc,%esp
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <get_func>
|
||||
+[a-f0-9]+: 81 f8 ([0-9a-f]{2} ){4}[ ]+cmp +\$0x[0-9a-f]+,%eax
|
||||
+[a-f0-9]+: c7 c2 ([0-9a-f]{2} ){4}[ ]+mov +\$0x[a-f0-9]+,%edx
|
||||
+[a-f0-9]+: 39 d0 cmp %edx,%eax
|
||||
+[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 39 15 ([0-9a-f]{2} ){4}[ ]+cmp +%edx,0x[0-9a-f]+
|
||||
+[a-f0-9]+: 75 2c jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <func>
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -9,7 +9,10 @@ Disassembly of section .text:
|
||||
[0-9a-f]+ <check>:
|
||||
+[a-f0-9]+: 83 ec 0c sub \$0xc,%esp
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <get_func>
|
||||
+[a-f0-9]+: 3b 05 ([0-9a-f]{2} ){4}[ ]+cmp +0x[0-9a-f]+,%eax
|
||||
+[a-f0-9]+: 8b 15 ([0-9a-f]{2} ){4}[ ]+mov +0x[a-f0-9]+,%edx
|
||||
+[a-f0-9]+: 39 d0 cmp %edx,%eax
|
||||
+[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 39 15 ([0-9a-f]{2} ){4}[ ]+cmp +%edx,0x[0-9a-f]+
|
||||
+[a-f0-9]+: 75 2c jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: ff 15 ([0-9a-f]{2} ){4}[ ]+call +\*0x[0-9a-f]+
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -9,7 +9,10 @@ Disassembly of section .text:
|
||||
[0-9a-f]+ <check>:
|
||||
+[a-f0-9]+: 83 ec 0c sub \$0xc,%esp
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <get_func>
|
||||
+[a-f0-9]+: 81 f8 ([0-9a-f]{2} ){4}[ ]+cmp +\$0x[0-9a-f]+,%eax
|
||||
+[a-f0-9]+: c7 c2 ([0-9a-f]{2} ){4}[ ]+mov +\$0x[a-f0-9]+,%edx
|
||||
+[a-f0-9]+: 39 d0 cmp %edx,%eax
|
||||
+[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 39 15 ([0-9a-f]{2} ){4}[ ]+cmp +%edx,0x[0-9a-f]+
|
||||
+[a-f0-9]+: 75 2c jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <func>
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -13,6 +13,9 @@ check:
|
||||
call *get_func@GOT(%ebx)
|
||||
cmpl func@GOT(%ebx), %eax
|
||||
jne .L3
|
||||
movl func_p@GOT(%ebx), %edx
|
||||
cmpl %eax, (%edx)
|
||||
jne .L3
|
||||
call *func@GOT(%ebx)
|
||||
cmpl $305419896, %eax
|
||||
jne .L3
|
||||
|
@ -8,7 +8,10 @@
|
||||
check:
|
||||
subl $12, %esp
|
||||
call *get_func@GOT
|
||||
cmpl func@GOT, %eax
|
||||
movl func@GOT, %edx
|
||||
cmpl %edx, %eax
|
||||
jne .L3
|
||||
cmpl %edx, func_p
|
||||
jne .L3
|
||||
call *func@GOT
|
||||
cmpl $305419896, %eax
|
||||
@ -24,5 +27,4 @@ check:
|
||||
.L3:
|
||||
call *abort@GOT
|
||||
.size check, .-check
|
||||
.text
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
|
@ -16,6 +16,13 @@ call_func:
|
||||
addl $_GLOBAL_OFFSET_TABLE_, %eax
|
||||
jmp *func@GOT(%eax)
|
||||
.size call_func, .-call_func
|
||||
.globl func_p
|
||||
.section .data.rel,"aw",@progbits
|
||||
.align 4
|
||||
.type func_p, @object
|
||||
.size func_p, 4
|
||||
func_p:
|
||||
.long func
|
||||
.section .text.__x86.get_pc_thunk.ax,"axG",@progbits,__x86.get_pc_thunk.ax,comdat
|
||||
.globl __x86.get_pc_thunk.ax
|
||||
.hidden __x86.get_pc_thunk.ax
|
||||
|
@ -12,5 +12,11 @@ get_func:
|
||||
call_func:
|
||||
jmp *func@GOT
|
||||
.size call_func, .-call_func
|
||||
.section .text.unlikely
|
||||
.globl func_p
|
||||
.data
|
||||
.align 4
|
||||
.type func_p, @object
|
||||
.size func_p, 4
|
||||
func_p:
|
||||
.long func
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
|
@ -10,6 +10,8 @@ Disassembly of section .text:
|
||||
+[a-f0-9]+: 48 83 ec 08 sub \$0x8,%rsp
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 callq [0-9a-f]+ <get_func>
|
||||
+[a-f0-9]+: 48 81 f8 ([0-9a-f]{2} ){4}[ ]+cmp \$0x[0-9a-f]+,%rax
|
||||
+[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 4(0|8) 39 05 ([0-9a-f]{2} ){4}[ ]+(rex |)cmp +%(e|r)ax,0x[0-9a-f]+\(%rip\) +# [a-f0-9]+ <func_p>
|
||||
+[a-f0-9]+: 75 2b jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 callq [0-9a-f]+ <func>
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -10,6 +10,8 @@ Disassembly of section .text:
|
||||
+[a-f0-9]+: 48 83 ec 08 sub \$0x8,%rsp
|
||||
+[a-f0-9]+: ff 15 ([0-9a-f]{2} ){4}[ ]+callq \*0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <_DYNAMIC\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 48 3b 05 ([0-9a-f]{2} ){4}[ ]+cmp 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 4(0|8) 39 05 ([0-9a-f]{2} ){4}[ ]+(rex |)cmp +%(e|r)ax,0x[0-9a-f]+\(%rip\) +# [a-f0-9]+ <.*>
|
||||
+[a-f0-9]+: 75 2b jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: ff 15 ([0-9a-f]{2} ){4}[ ]+callq \*0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <_DYNAMIC\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -10,6 +10,8 @@ Disassembly of section .text:
|
||||
+[a-f0-9]+: 48 83 ec 08 sub \$0x8,%rsp
|
||||
+[a-f0-9]+: ff 15 ([0-9a-f]{2} ){4}[ ]+callq \*0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <_DYNAMIC\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 48 81 f8 ([0-9a-f]{2} ){4}[ ]+cmp \$0x[0-9a-f]+,%rax
|
||||
+[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 4(0|8) 39 05 ([0-9a-f]{2} ){4}[ ]+(rex |)cmp +%(e|r)ax,0x[0-9a-f]+\(%rip\) +# [a-f0-9]+ <.*>
|
||||
+[a-f0-9]+: 75 2b jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 callq [0-9a-f]+ <func>
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -10,6 +10,8 @@ Disassembly of section .text:
|
||||
+[a-f0-9]+: 48 83 ec 08 sub \$0x8,%rsp
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 callq [0-9a-f]+ <get_func>
|
||||
+[a-f0-9]+: 48 81 f8 ([0-9a-f]{2} ){4}[ ]+cmp \$0x[0-9a-f]+,%rax
|
||||
+[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 4(0|8) 39 05 ([0-9a-f]{2} ){4}[ ]+(rex |)cmp +%(e|r)ax,0x[0-9a-f]+\(%rip\) +# [a-f0-9]+ <func_p>
|
||||
+[a-f0-9]+: 75 2b jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 callq [0-9a-f]+ <func>
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -10,6 +10,8 @@ Disassembly of section .text:
|
||||
+[a-f0-9]+: 48 83 ec 08 sub \$0x8,%rsp
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 callq [0-9a-f]+ <get_func>
|
||||
+[a-f0-9]+: 48 3b 05 ([0-9a-f]{2} ){4}[ ]+cmp 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 4(0|8) 39 05 ([0-9a-f]{2} ){4}[ ]+(rex |)cmp +%(e|r)ax,0x[0-9a-f]+\(%rip\) +# [a-f0-9]+ <func_p>
|
||||
+[a-f0-9]+: 75 2b jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 callq [0-9a-f]+ <func>
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -10,6 +10,8 @@ Disassembly of section .text:
|
||||
+[a-f0-9]+: 48 83 ec 08 sub \$0x8,%rsp
|
||||
+[a-f0-9]+: ff 15 ([0-9a-f]{2} ){4}[ ]+callq \*0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <_DYNAMIC\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 48 3b 05 ([0-9a-f]{2} ){4}[ ]+cmp 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 4(0|8) 39 05 ([0-9a-f]{2} ){4}[ ]+(rex |)cmp +%(e|r)ax,0x[0-9a-f]+\(%rip\) +# [a-f0-9]+ <.*>
|
||||
+[a-f0-9]+: 75 2b jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: ff 15 ([0-9a-f]{2} ){4}[ ]+callq \*0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <_DYNAMIC\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -10,6 +10,8 @@ Disassembly of section .text:
|
||||
+[a-f0-9]+: 48 83 ec 08 sub \$0x8,%rsp
|
||||
+[a-f0-9]+: ff 15 ([0-9a-f]{2} ){4}[ ]+callq \*0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <_DYNAMIC\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 48 3b 05 ([0-9a-f]{2} ){4}[ ]+cmp 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 4(0|8) 39 05 ([0-9a-f]{2} ){4}[ ]+(rex |)cmp +%(e|r)ax,0x[0-9a-f]+\(%rip\) +# [a-f0-9]+ <.*>
|
||||
+[a-f0-9]+: 75 2b jne [0-9a-f]+ <check\+0x[0-9a-f]+>
|
||||
+[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 callq [0-9a-f]+ <func>
|
||||
+[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax
|
||||
|
@ -10,6 +10,13 @@ check:
|
||||
call *get_func@GOTPCREL(%rip)
|
||||
cmpq func@GOTPCREL(%rip), %rax
|
||||
jne .L3
|
||||
#ifdef __LP64__
|
||||
cmpq %rax, func_p(%rip)
|
||||
#else
|
||||
rex
|
||||
cmpl %eax, func_p(%rip)
|
||||
#endif
|
||||
jne .L3
|
||||
call *func@GOTPCREL(%rip)
|
||||
cmpl $305419896, %eax
|
||||
jne .L3
|
||||
|
@ -12,4 +12,17 @@ get_func:
|
||||
call_func:
|
||||
jmp *func@GOTPCREL(%rip)
|
||||
.size call_func, .-call_func
|
||||
.globl func_p
|
||||
.section .data.rel,"aw",@progbits
|
||||
.type func_p, @object
|
||||
func_p:
|
||||
#ifdef __LP64__
|
||||
.align 8
|
||||
.size func_p, 8
|
||||
.quad func
|
||||
#else
|
||||
.align 4
|
||||
.size func_p, 4
|
||||
.long func
|
||||
#endif
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
|
Loading…
x
Reference in New Issue
Block a user