* defs.h [!FOPEN_RB]: Include "fopen-bin.h" instead of
[deliverable/binutils-gdb.git] / bfd / elf64-gen.c
CommitLineData
252b5132 1/* Generic support for 64-bit ELF
4ad4eba5
AM
2 Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004
3 Free Software Foundation, Inc.
252b5132
RH
4
5This file is part of BFD, the Binary File Descriptor library.
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program; if not, write to the Free Software
19Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20
21#include "bfd.h"
22#include "sysdep.h"
23#include "libbfd.h"
24#include "elf-bfd.h"
25
26/* This does not include any relocation information, but should be
27 good enough for GDB or objdump to read the file. */
28
29static reloc_howto_type dummy =
30 HOWTO (0, /* type */
31 0, /* rightshift */
32 0, /* size (0 = byte, 1 = short, 2 = long) */
33 0, /* bitsize */
b34976b6 34 FALSE, /* pc_relative */
252b5132
RH
35 0, /* bitpos */
36 complain_overflow_dont, /* complain_on_overflow */
37 NULL, /* special_function */
38 "UNKNOWN", /* name */
b34976b6 39 FALSE, /* partial_inplace */
252b5132
RH
40 0, /* src_mask */
41 0, /* dst_mask */
b34976b6 42 FALSE); /* pcrel_offset */
252b5132 43
814fa6ab 44static void elf_generic_info_to_howto
947216bf 45 PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
814fa6ab 46static void elf_generic_info_to_howto_rel
947216bf 47 PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
b34976b6 48static bfd_boolean elf64_generic_link_add_symbols
814fa6ab
AM
49 PARAMS ((bfd *, struct bfd_link_info *));
50
252b5132
RH
51static void
52elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc)
56fc028e 53 bfd *abfd ATTRIBUTE_UNUSED;
252b5132 54 arelent *bfd_reloc;
947216bf 55 Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED;
252b5132
RH
56{
57 bfd_reloc->howto = &dummy;
58}
59
60static void
61elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
56fc028e 62 bfd *abfd ATTRIBUTE_UNUSED;
252b5132 63 arelent *bfd_reloc;
947216bf 64 Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED;
252b5132
RH
65{
66 bfd_reloc->howto = &dummy;
67}
68
b34976b6 69static bfd_boolean
eb4a6e4f
L
70elf64_generic_link_add_symbols (abfd, info)
71 bfd *abfd;
b9d88996 72 struct bfd_link_info *info;
eb4a6e4f
L
73{
74 asection *o;
75
76 /* Check if there are any relocations. */
77 for (o = abfd->sections; o != NULL; o = o->next)
78 if ((o->flags & SEC_RELOC) != 0)
79 {
80 Elf_Internal_Ehdr *ehdrp;
81
82 ehdrp = elf_elfheader (abfd);
d003868e
AM
83 (*_bfd_error_handler) (_("%B: Relocations in generic ELF (EM: %d)"),
84 abfd, ehdrp->e_machine);
eb4a6e4f
L
85
86 bfd_set_error (bfd_error_wrong_format);
b34976b6 87 return FALSE;
eb4a6e4f
L
88 }
89
4ad4eba5 90 return bfd_elf_link_add_symbols (abfd, info);
eb4a6e4f
L
91}
92
252b5132
RH
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
79e5982f 99#define ELF_MAXPAGESIZE 0x1
252b5132 100#define bfd_elf64_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
eb4a6e4f 101#define bfd_elf64_bfd_link_add_symbols elf64_generic_link_add_symbols
252b5132
RH
102#define elf_info_to_howto elf_generic_info_to_howto
103#define elf_info_to_howto_rel elf_generic_info_to_howto_rel
104
105#include "elf64-target.h"
This page took 0.261944 seconds and 4 git commands to generate.