1/* Copyright (C) 2000-2022 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <https://www.gnu.org/licenses/>. */
17
18#include <stdlib.h>
19#include "vismod.h"
20
21int
22protlocal (void)
23{
24 return 0x40;
25}
26asm (".protected protlocal");
27
28
29int
30calllocal2 (void)
31{
32 return protlocal () + 0x100;
33}
34
35int
36(*getlocal2 (void)) (void)
37{
38 return protlocal;
39}
40
41int
42protinmod (void)
43{
44 return 0x4000;
45}
46asm (".protected protinmod");
47
48int
49callinmod2 (void)
50{
51 return protinmod () + 0x10000;
52}
53
54int
55(*getinmod2 (void)) (void)
56{
57 return protinmod;
58}
59
60int
61protitcpt (void)
62{
63 return 0x400000;
64}
65asm (".protected protitcpt");
66
67int
68callitcpt2 (void)
69{
70 return protitcpt () + 0x1000000;
71}
72
73int
74(*getitcpt2 (void)) (void)
75{
76 return protitcpt;
77}
78
79const char *protvarlocal = __FILE__;
80asm (".protected protvarlocal");
81
82const char **
83getvarlocal2 (void)
84{
85 return &protvarlocal;
86}
87
88const char *protvarinmod = __FILE__;
89asm (".protected protvarinmod");
90
91const char **
92getvarinmod2 (void)
93{
94 return &protvarinmod;
95}
96
97const char *protvaritcpt = __FILE__;
98asm (".protected protvaritcpt");
99
100const char **
101getvaritcpt2 (void)
102{
103 return &protvaritcpt;
104}
105
106/* We must never call these functions. */
107int
108callitcpt3 (void)
109{
110 abort ();
111}
112
113int
114(*getitcpt3 (void)) (void)
115{
116 abort ();
117}
118
119const char **
120getvaritcpt3 (void)
121{
122 abort ();
123}
124

source code of glibc/elf/vismod2.c