daily update
[binutils.git] / bfd / elf64-gen.c
blob590456ccbf65f3ebbf9f85f45cdd062710f5b2bd
1 /* Generic support for 64-bit ELF
2 Copyright 1993, 1995, 1998, 1999, 2001, 2002 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20 #include "bfd.h"
21 #include "sysdep.h"
22 #include "libbfd.h"
23 #include "elf-bfd.h"
25 /* This does not include any relocation information, but should be
26 good enough for GDB or objdump to read the file. */
28 static reloc_howto_type dummy =
29 HOWTO (0, /* type */
30 0, /* rightshift */
31 0, /* size (0 = byte, 1 = short, 2 = long) */
32 0, /* bitsize */
33 FALSE, /* pc_relative */
34 0, /* bitpos */
35 complain_overflow_dont, /* complain_on_overflow */
36 NULL, /* special_function */
37 "UNKNOWN", /* name */
38 FALSE, /* partial_inplace */
39 0, /* src_mask */
40 0, /* dst_mask */
41 FALSE); /* pcrel_offset */
43 static void elf_generic_info_to_howto
44 PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
45 static void elf_generic_info_to_howto_rel
46 PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
47 static bfd_boolean elf64_generic_link_add_symbols
48 PARAMS ((bfd *, struct bfd_link_info *));
50 static void
51 elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc)
52 bfd *abfd ATTRIBUTE_UNUSED;
53 arelent *bfd_reloc;
54 Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED;
56 bfd_reloc->howto = &dummy;
59 static void
60 elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
61 bfd *abfd ATTRIBUTE_UNUSED;
62 arelent *bfd_reloc;
63 Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED;
65 bfd_reloc->howto = &dummy;
68 static bfd_boolean
69 elf64_generic_link_add_symbols (abfd, info)
70 bfd *abfd;
71 struct bfd_link_info *info;
73 asection *o;
75 /* Check if there are any relocations. */
76 for (o = abfd->sections; o != NULL; o = o->next)
77 if ((o->flags & SEC_RELOC) != 0)
79 Elf_Internal_Ehdr *ehdrp;
81 ehdrp = elf_elfheader (abfd);
82 (*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"),
83 bfd_archive_filename (abfd),
84 ehdrp->e_machine);
86 bfd_set_error (bfd_error_wrong_format);
87 return FALSE;
90 return bfd_elf64_bfd_link_add_symbols (abfd, info);
93 #define TARGET_LITTLE_SYM bfd_elf64_little_generic_vec
94 #define TARGET_LITTLE_NAME "elf64-little"
95 #define TARGET_BIG_SYM bfd_elf64_big_generic_vec
96 #define TARGET_BIG_NAME "elf64-big"
97 #define ELF_ARCH bfd_arch_unknown
98 #define ELF_MACHINE_CODE EM_NONE
99 #define ELF_MAXPAGESIZE 0x1
100 #define bfd_elf64_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
101 #define bfd_elf64_bfd_link_add_symbols elf64_generic_link_add_symbols
102 #define elf_info_to_howto elf_generic_info_to_howto
103 #define elf_info_to_howto_rel elf_generic_info_to_howto_rel
105 #include "elf64-target.h"