Blame sysdeps/mips/elf_machine_sym_no_match.h

Packit Service 4aadd4
/* MIPS-specific handling of undefined symbols.
Packit Service 4aadd4
   Copyright (C) 2008-2020 Free Software Foundation, Inc.
Packit Service 4aadd4
   This file is part of the GNU C Library.
Packit Service 4aadd4
Packit Service 4aadd4
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 4aadd4
   modify it under the terms of the GNU Lesser General Public
Packit Service 4aadd4
   License as published by the Free Software Foundation; either
Packit Service 4aadd4
   version 2.1 of the License, or (at your option) any later version.
Packit Service 4aadd4
Packit Service 4aadd4
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 4aadd4
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 4aadd4
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 4aadd4
   Lesser General Public License for more details.
Packit Service 4aadd4
Packit Service 4aadd4
   You should have received a copy of the GNU Lesser General Public
Packit Service 4aadd4
   License along with the GNU C Library; if not, see
Packit Service 4aadd4
   <https://www.gnu.org/licenses/>.  */
Packit Service 4aadd4
Packit Service 4aadd4
#ifndef _ELF_MACHINE_SYM_NO_MATCH_H
Packit Service 4aadd4
#define _ELF_MACHINE_SYM_NO_MATCH_H
Packit Service 4aadd4
Packit Service 4aadd4
#include <link.h>
Packit Service 4aadd4
#include <stdbool.h>
Packit Service 4aadd4
Packit Service 4aadd4
/* The semantics of zero/non-zero values of undefined symbols differs
Packit Service 4aadd4
   depending on whether the non-PIC ABI is in use.  Under the non-PIC
Packit Service 4aadd4
   ABI, a non-zero value indicates that there is an address reference
Packit Service 4aadd4
   to the symbol and thus it must always be resolved (except when
Packit Service 4aadd4
   resolving a jump slot relocation) to the PLT entry whose address is
Packit Service 4aadd4
   provided as the symbol's value; a zero value indicates that this
Packit Service 4aadd4
   canonical-address behaviour is not required.  Yet under the classic
Packit Service 4aadd4
   MIPS psABI, a zero value indicates that there is an address
Packit Service 4aadd4
   reference to the function and the dynamic linker must resolve the
Packit Service 4aadd4
   symbol immediately upon loading.  To avoid conflict, symbols for
Packit Service 4aadd4
   which the dynamic linker must assume the non-PIC ABI semantics are
Packit Service 4aadd4
   marked with the STO_MIPS_PLT flag.  */
Packit Service 4aadd4
static inline bool
Packit Service 4aadd4
elf_machine_sym_no_match (const ElfW(Sym) *sym)
Packit Service 4aadd4
{
Packit Service 4aadd4
  return sym->st_shndx == SHN_UNDEF && !(sym->st_other & STO_MIPS_PLT);
Packit Service 4aadd4
}
Packit Service 4aadd4
Packit Service 4aadd4
#endif /* _ELF_MACHINE_SYM_NO_MATCH_H */