3 #include "protected-data-1.h"
5 int protected_data_1b
= 3;
12 /* Check if we get the same address for the protected data symbol. */
13 if (&protected_data_1a
!= protected_data_1a_p ())
15 puts ("'protected_data_1a' in main and shared library doesn't have same address");
19 protected_data_1a
= -1;
20 if (check_protected_data_1a (-1))
22 puts ("'protected_data_1a' in main and shared library doesn't have same value");
26 set_protected_data_1a (-3);
27 if (protected_data_1a
!= -3)
29 puts ("'protected_data_1a' in main and shared library doesn't have same value");
33 /* Check if we get the different addresses for the protected data
35 if (&protected_data_1b
== protected_data_1b_p ())
37 puts ("'protected_data_1b' in main and shared library has same address");
41 protected_data_1b
= -10;
42 if (check_protected_data_1b (2))
44 puts ("'protected_data_1b' in main and shared library has same address");
48 set_protected_data_1b (-30);
49 if (protected_data_1b
!= -10)
51 puts ("'protected_data_1b' in main and shared library has same address");