binutils-gdb/ld/testsuite/ld-x86-64/protected-func-1a.s
H.J. Lu b6b4298372 x86-64: Test protected function pointers
On x86-64, function pointers in executable for external funtions may be
resolved to their PLT entries in executable.  If it happens, function
pointers of protected funtions in shared libraries must be resolved to
the PLT entries in executable, not addresses of protected funtions in
shared libraries.

	PR ld/27973
	* testsuite/ld-x86-64/x86-64.exp: Run protected function tests.
	* testsuite/ld-x86-64/protected-func-1.h: New file.
	* testsuite/ld-x86-64/protected-func-1a.s: Likewise.
	* testsuite/ld-x86-64/protected-func-1b.c: Likewise.
2021-06-17 10:26:34 -07:00

49 lines
998 B
ArmAsm

.text
.p2align 4
.protected protected_func_1a
.globl protected_func_1a
.type protected_func_1a, @function
protected_func_1a:
.LFB0:
.cfi_startproc
movl $1, %eax
ret
.cfi_endproc
.LFE0:
.size protected_func_1a, .-protected_func_1a
.p2align 4
.protected protected_func_1b
.globl protected_func_1b
.type protected_func_1b, @function
protected_func_1b:
.LFB1:
.cfi_startproc
movl $2, %eax
ret
.cfi_endproc
.LFE1:
.size protected_func_1b, .-protected_func_1b
.p2align 4
.globl protected_func_1a_p
.type protected_func_1a_p, @function
protected_func_1a_p:
.LFB2:
.cfi_startproc
movq protected_func_1a@GOTPCREL(%rip), %rax
ret
.cfi_endproc
.LFE2:
.size protected_func_1a_p, .-protected_func_1a_p
.p2align 4
.globl protected_func_1b_p
.type protected_func_1b_p, @function
protected_func_1b_p:
.LFB3:
.cfi_startproc
movq protected_func_1b@GOTPCREL(%rip), %rax
ret
.cfi_endproc
.LFE3:
.size protected_func_1b_p, .-protected_func_1b_p
.section .note.GNU-stack,"",@progbits