1 /* Generic support for 64-bit ELF
2 Copyright (C) 1993-2017 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Descriptor library.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
26 /* This does not include any relocation information, but should be
27 good enough for GDB or objdump to read the file. */
29 static reloc_howto_type dummy
=
32 0, /* size (0 = byte, 1 = short, 2 = long) */
34 FALSE
, /* pc_relative */
36 complain_overflow_dont
, /* complain_on_overflow */
37 NULL
, /* special_function */
39 FALSE
, /* partial_inplace */
42 FALSE
); /* pcrel_offset */
45 elf_generic_info_to_howto (bfd
*abfd ATTRIBUTE_UNUSED
,
47 Elf_Internal_Rela
*elf_reloc ATTRIBUTE_UNUSED
)
49 bfd_reloc
->howto
= &dummy
;
53 elf_generic_info_to_howto_rel (bfd
*abfd ATTRIBUTE_UNUSED
,
55 Elf_Internal_Rela
*elf_reloc ATTRIBUTE_UNUSED
)
57 bfd_reloc
->howto
= &dummy
;
61 check_for_relocs (bfd
* abfd
, asection
* o
, void * failed
)
63 if ((o
->flags
& SEC_RELOC
) != 0)
65 Elf_Internal_Ehdr
*ehdrp
;
67 ehdrp
= elf_elfheader (abfd
);
68 /* xgettext:c-format */
69 _bfd_error_handler (_("%B: Relocations in generic ELF (EM: %d)"),
70 abfd
, ehdrp
->e_machine
);
72 bfd_set_error (bfd_error_wrong_format
);
73 * (bfd_boolean
*) failed
= TRUE
;
78 elf64_generic_link_add_symbols (bfd
*abfd
, struct bfd_link_info
*info
)
80 bfd_boolean failed
= FALSE
;
82 /* Check if there are any relocations. */
83 bfd_map_over_sections (abfd
, check_for_relocs
, & failed
);
87 return bfd_elf_link_add_symbols (abfd
, info
);
90 #define TARGET_LITTLE_SYM elf64_le_vec
91 #define TARGET_LITTLE_NAME "elf64-little"
92 #define TARGET_BIG_SYM elf64_be_vec
93 #define TARGET_BIG_NAME "elf64-big"
94 #define ELF_ARCH bfd_arch_unknown
95 #define ELF_MACHINE_CODE EM_NONE
96 #define ELF_MAXPAGESIZE 0x1
97 #define bfd_elf64_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
98 #define bfd_elf64_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
99 #define bfd_elf64_bfd_link_add_symbols elf64_generic_link_add_symbols
100 #define elf_info_to_howto elf_generic_info_to_howto
101 #define elf_info_to_howto_rel elf_generic_info_to_howto_rel
103 #include "elf64-target.h"