(root)/
glibc-2.38/
elf/
vismod2.c
       1  /* Copyright (C) 2000-2023 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  
      21  int
      22  protlocal (void)
      23  {
      24    return 0x40;
      25  }
      26  asm (".protected protlocal");
      27  
      28  
      29  int
      30  calllocal2 (void)
      31  {
      32    return protlocal () + 0x100;
      33  }
      34  
      35  int
      36  (*getlocal2 (void)) (void)
      37  {
      38    return protlocal;
      39  }
      40  
      41  int
      42  protinmod (void)
      43  {
      44    return 0x4000;
      45  }
      46  asm (".protected protinmod");
      47  
      48  int
      49  callinmod2 (void)
      50  {
      51    return protinmod () + 0x10000;
      52  }
      53  
      54  int
      55  (*getinmod2 (void)) (void)
      56  {
      57    return protinmod;
      58  }
      59  
      60  int
      61  protitcpt (void)
      62  {
      63    return 0x400000;
      64  }
      65  asm (".protected protitcpt");
      66  
      67  int
      68  callitcpt2 (void)
      69  {
      70    return protitcpt () + 0x1000000;
      71  }
      72  
      73  int
      74  (*getitcpt2 (void)) (void)
      75  {
      76    return protitcpt;
      77  }
      78  
      79  const char *protvarlocal = __FILE__;
      80  asm (".protected protvarlocal");
      81  
      82  const char **
      83  getvarlocal2 (void)
      84  {
      85    return &protvarlocal;
      86  }
      87  
      88  const char *protvarinmod = __FILE__;
      89  asm (".protected protvarinmod");
      90  
      91  const char **
      92  getvarinmod2 (void)
      93  {
      94    return &protvarinmod;
      95  }
      96  
      97  const char *protvaritcpt = __FILE__;
      98  asm (".protected protvaritcpt");
      99  
     100  const char **
     101  getvaritcpt2 (void)
     102  {
     103    return &protvaritcpt;
     104  }
     105  
     106  /* We must never call these functions.  */
     107  int
     108  callitcpt3 (void)
     109  {
     110    abort ();
     111  }
     112  
     113  int
     114  (*getitcpt3 (void)) (void)
     115  {
     116    abort ();
     117  }
     118  
     119  const char **
     120  getvaritcpt3 (void)
     121  {
     122    abort ();
     123  }