]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - bfd/elfxx-loongarch.h
LoongArch: bfd: Add support for linker relaxation.
[thirdparty/binutils-gdb.git] / bfd / elfxx-loongarch.h
CommitLineData
e214f8db 1/* LoongArch-specific backend routines.
d87bef3a 2 Copyright (C) 2021-2023 Free Software Foundation, Inc.
e214f8db 3 Contributed by Loongson Ltd.
4
5 This file is part of BFD, the Binary File Descriptor library.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; see the file COPYING3. If not,
19 see <http://www.gnu.org/licenses/>. */
20
21#include "elf/common.h"
22#include "elf/internal.h"
23
24extern reloc_howto_type *
25loongarch_elf_rtype_to_howto (bfd *abfd, unsigned int r_type);
26
27extern reloc_howto_type *
28loongarch_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code);
29
30extern reloc_howto_type *
31loongarch_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name);
748594bc 32
6d13722a 33extern bfd_reloc_code_real_type
34loongarch_larch_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
35 const char *l_r_name);
36
1b6fccd2 37bool
38loongarch_adjust_reloc_bitsfield (bfd *, reloc_howto_type *, bfd_vma *);
39void
40bfd_elf32_loongarch_set_data_segment_info (struct bfd_link_info *, int *);
41void
42bfd_elf64_loongarch_set_data_segment_info (struct bfd_link_info *, int *);
43
44bfd_byte *
45loongarch_write_unsigned_leb128 (bfd_byte *p, unsigned int len, bfd_vma value);
d218dba3 46
47/* TRUE if this is a PLT reference to a local IFUNC. */
48#define PLT_LOCAL_IFUNC_P(INFO, H) \
49 ((H)->dynindx == -1 \
50 || ((bfd_link_executable (INFO) \
51 || ELF_ST_VISIBILITY ((H)->other) != STV_DEFAULT) \
52 && (H)->def_regular \
53 && (H)->type == STT_GNU_IFUNC))