Commit | Line | Data |
---|---|---|
db232882 KR |
1 | /* BFD back-end data structures for ELF files. |
2 | Copyright (C) 1992, 1993 Free Software Foundation, Inc. | |
3 | Written by Cygnus Support. | |
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 2 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; if not, write to the Free Software | |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
20 | ||
21 | #ifndef _LIBELF_H_ | |
22 | #define _LIBELF_H_ 1 | |
23 | ||
81187b54 KR |
24 | #include "elf/common.h" |
25 | #include "elf/internal.h" | |
26 | #include "elf/external.h" | |
27 | ||
db232882 KR |
28 | typedef struct |
29 | { | |
30 | asymbol symbol; | |
31 | Elf_Internal_Sym internal_elf_sym; | |
32 | Elf_External_Sym native_elf_sym; | |
33 | /* these are used for the generation of .stabX symbols (?) */ | |
34 | short desc; | |
35 | unsigned char type; | |
36 | char other; | |
37 | } elf_symbol_type; | |
38 | ||
81187b54 KR |
39 | struct elf_backend_data { |
40 | void (*elf_info_to_howto) PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); | |
41 | enum bfd_architecture arch; | |
db232882 | 42 | |
8e40bcd8 KR |
43 | /* @@ I really don't think this should be here. I don't know what |
44 | global_sym is supposed to be used for, but I doubt it's something | |
45 | that would be considered global, e.g., if you've got a program | |
46 | reading and writing many BFDs. My hunch is that it's specific to | |
47 | the output BFD. If not, put a comment here explaining why. */ | |
db232882 | 48 | elf_symbol_type *global_sym; |
81187b54 KR |
49 | }; |
50 | ||
51 | extern bfd_target *elf_object_p PARAMS ((bfd *)); | |
52 | extern bfd_target *elf_core_file_p PARAMS ((bfd *)); | |
53 | extern boolean elf_mkobject PARAMS ((bfd *)); | |
54 | extern boolean elf_write_object_contents PARAMS ((bfd *)); | |
55 | extern char *elf_core_file_failing_command PARAMS ((bfd *)); | |
56 | extern int elf_core_file_failing_signal PARAMS ((bfd *)); | |
57 | extern boolean elf_core_file_matches_executable_p PARAMS ((bfd *, bfd *)); | |
58 | extern boolean elf_set_section_contents PARAMS ((bfd *, sec_ptr, PTR, | |
59 | file_ptr, bfd_size_type)); | |
60 | extern unsigned int elf_get_symtab_upper_bound PARAMS ((bfd *)); | |
61 | extern unsigned int elf_get_symtab PARAMS ((bfd *, asymbol **)); | |
62 | extern unsigned int elf_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr)); | |
63 | extern unsigned int elf_canonicalize_reloc PARAMS ((bfd *, sec_ptr, | |
64 | arelent **, asymbol **)); | |
65 | extern asymbol *elf_make_empty_symbol PARAMS ((bfd *)); | |
66 | extern void elf_print_symbol PARAMS ((bfd *, PTR, asymbol *, | |
67 | bfd_print_symbol_type)); | |
68 | extern alent *elf_get_lineno PARAMS ((bfd *, asymbol *)); | |
69 | extern boolean elf_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, | |
70 | unsigned long)); | |
71 | extern boolean elf_find_nearest_line PARAMS ((bfd *, asection *, asymbol **, | |
72 | bfd_vma, CONST char **, | |
73 | CONST char **, unsigned int *)); | |
74 | extern int elf_sizeof_headers PARAMS ((bfd *, boolean)); | |
75 | ||
76 | /* If the target doesn't have reloc handling written yet: */ | |
77 | extern void elf_no_info_to_howto PARAMS ((bfd *, arelent *, | |
78 | Elf_Internal_Rela *)); | |
db232882 KR |
79 | |
80 | #endif /* _LIBELF_H_ */ |