(root)/
glibc-2.38/
sysdeps/
generic/
dl-symbol-redir-ifunc.h
       1  /* Symbol rediretion for loader/static initialization code.
       2     Copyright (C) 2022-2023 Free Software Foundation, Inc.
       3     This file is part of the GNU C Library.
       4  
       5     The GNU C Library is free software; you can redistribute it and/or
       6     modify it under the terms of the GNU Lesser General Public
       7     License as published by the Free Software Foundation; either
       8     version 2.1 of the License, or (at your option) any later version.
       9  
      10     The GNU C Library is distributed in the hope that it will be useful,
      11     but WITHOUT ANY WARRANTY; without even the implied warranty of
      12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      13     Lesser General Public License for more details.
      14  
      15     You should have received a copy of the GNU Lesser General Public
      16     License along with the GNU C Library; if not, see
      17     <https://www.gnu.org/licenses/>.  */
      18  
      19  #ifndef _DL_IFUNC_GENERIC_H
      20  #define _DL_IFUNC_GENERIC_H
      21  
      22  /* The compiler might optimize loops or other constructs to library calls even
      23     in freestanding mode.  Although it is safe in most scenarios, on program
      24     loading and static startup, iFUNC resolution might require other dynamic
      25     relocation that are not yet done.
      26  
      27     Instead of adding per-file compiler flags to avoid the libcall generation,
      28     this header defines generic symbols that will be routed instead of the
      29     default symbols name.
      30  
      31     Each port can then make the required redirection to the expected generic
      32     implementation if the symbol is provided as iFUNC, with a global definition
      33     such as:
      34  
      35       asm ("memset = __memset_generic");
      36   */
      37  
      38  #endif