Projet_SETI_RISC-V/riscv-gnu-toolchain/gdb/ld/testsuite/ld-x86-64/protected-func-1b.c

36 lines
672 B
C
Raw Normal View History

2023-03-06 14:48:14 +01:00
#include <stdio.h>
#include "protected-func-1.h"
int
protected_func_1b (void)
{
return 3;
}
int
main (void)
{
int res = 0;
/* Check if we get the same address for the protected function symbol. */
if (protected_func_1a != protected_func_1a_p ())
{
puts ("'protected_func_1a' in main and shared library doesn't have same address");
res = 1;
}
/* Check if we get the different addresses for the protected function
symbol. */
if (protected_func_1b == protected_func_1b_p ())
{
puts ("'protected_func_1b' in main and shared library has same address");
res = 1;
}
if (!res)
puts ("PASS");
return res;
}