elfxx-loongarch.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* LoongArch-specific backend routines.
  2. Copyright (C) 2021-2022 Free Software Foundation, Inc.
  3. Contributed by Loongson Ltd.
  4. This file is part of BFD, the Binary File Descriptor library.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program 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
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; see the file COPYING3. If not,
  15. see <http://www.gnu.org/licenses/>. */
  16. #include "elf/common.h"
  17. #include "elf/internal.h"
  18. extern reloc_howto_type *
  19. loongarch_elf_rtype_to_howto (bfd *abfd, unsigned int r_type);
  20. extern reloc_howto_type *
  21. loongarch_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code);
  22. extern reloc_howto_type *
  23. loongarch_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name);
  24. bool loongarch_adjust_reloc_bitsfield (reloc_howto_type *howto, bfd_vma *fix_val);
  25. /* TRUE if this is a PLT reference to a local IFUNC. */
  26. #define PLT_LOCAL_IFUNC_P(INFO, H) \
  27. ((H)->dynindx == -1 \
  28. || ((bfd_link_executable (INFO) \
  29. || ELF_ST_VISIBILITY ((H)->other) != STV_DEFAULT) \
  30. && (H)->def_regular \
  31. && (H)->type == STT_GNU_IFUNC))