1 |
/* BFD back-end data structures for NLM (NetWare Loadable Modules) files. |
/* BFD back-end data structures for NLM (NetWare Loadable Modules) files. |
2 |
Copyright 1993, 1994, 2001 Free Software Foundation, Inc. |
Copyright 1993, 1994, 2001, 2002, 2003 Free Software Foundation, Inc. |
3 |
Written by Cygnus Support. |
Written by Cygnus Support. |
4 |
|
|
5 |
This file is part of BFD, the Binary File Descriptor library. |
This file is part of BFD, the Binary File Descriptor library. |
52 |
struct nlm_relent *relocs; |
struct nlm_relent *relocs; |
53 |
} nlmNAME(symbol_type); |
} nlmNAME(symbol_type); |
54 |
|
|
55 |
extern boolean nlm_mkobject PARAMS ((bfd *)); |
extern bfd_boolean nlm_mkobject |
56 |
extern boolean nlm_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, |
PARAMS ((bfd *)); |
57 |
unsigned long)); |
extern bfd_boolean nlm_set_arch_mach |
58 |
|
PARAMS ((bfd *, enum bfd_architecture, unsigned long)); |
59 |
|
|
60 |
extern void nlmNAME(get_symbol_info) |
extern void nlmNAME(get_symbol_info) |
61 |
PARAMS ((bfd *, asymbol *, symbol_info *)); |
PARAMS ((bfd *, asymbol *, symbol_info *)); |
62 |
extern long nlmNAME(get_symtab_upper_bound) |
extern long nlmNAME(get_symtab_upper_bound) |
63 |
PARAMS ((bfd *)); |
PARAMS ((bfd *)); |
64 |
extern long nlmNAME(get_symtab) |
extern long nlmNAME(canonicalize_symtab) |
65 |
PARAMS ((bfd *, asymbol **)); |
PARAMS ((bfd *, asymbol **)); |
66 |
extern asymbol *nlmNAME(make_empty_symbol) |
extern asymbol *nlmNAME(make_empty_symbol) |
67 |
PARAMS ((bfd *)); |
PARAMS ((bfd *)); |
68 |
extern void nlmNAME(print_symbol) |
extern void nlmNAME(print_symbol) |
69 |
PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); |
PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); |
70 |
extern long nlmNAME(get_reloc_upper_bound) |
extern long nlmNAME(get_reloc_upper_bound) |
71 |
PARAMS ((bfd *, asection *)); |
PARAMS ((bfd *, asection *)); |
72 |
extern long nlmNAME(canonicalize_reloc) |
extern long nlmNAME(canonicalize_reloc) |
73 |
PARAMS ((bfd *, asection *, arelent **, asymbol **)); |
PARAMS ((bfd *, asection *, arelent **, asymbol **)); |
74 |
extern const bfd_target *nlmNAME(object_p) |
extern const bfd_target *nlmNAME(object_p) |
75 |
PARAMS ((bfd *)); |
PARAMS ((bfd *)); |
76 |
extern boolean nlmNAME(set_arch_mach) |
extern bfd_boolean nlmNAME(set_arch_mach) |
77 |
PARAMS ((bfd *, enum bfd_architecture, unsigned long)); |
PARAMS ((bfd *, enum bfd_architecture, unsigned long)); |
78 |
extern boolean nlmNAME(set_section_contents) |
extern bfd_boolean nlmNAME(set_section_contents) |
79 |
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); |
PARAMS ((bfd *, asection *, const PTR, file_ptr, bfd_size_type)); |
80 |
extern boolean nlmNAME(write_object_contents) |
extern bfd_boolean nlmNAME(write_object_contents) |
81 |
PARAMS ((bfd *)); |
PARAMS ((bfd *)); |
82 |
|
|
83 |
/* Some private data is stashed away for future use using the tdata pointer |
/* Some private data is stashed away for future use using the tdata pointer |
84 |
in the bfd structure. */ |
in the bfd structure. */ |
166 |
/* Some NLM formats do not use the uninitialized data section, so |
/* Some NLM formats do not use the uninitialized data section, so |
167 |
all uninitialized data must be put into the regular data section |
all uninitialized data must be put into the regular data section |
168 |
instead. */ |
instead. */ |
169 |
boolean no_uninitialized_data; |
bfd_boolean no_uninitialized_data; |
170 |
/* Some NLM formats have a prefix on the file. If this function is |
/* Some NLM formats have a prefix on the file. If this function is |
171 |
not NULL, it will be called by nlm_object_p. It should return |
not NULL, it will be called by nlm_object_p. It should return |
172 |
true if this file could match this format, and it should leave |
TRUE if this file could match this format, and it should leave |
173 |
the BFD such that a bfd_bread will pick up the fixed header. */ |
the BFD such that a bfd_bread will pick up the fixed header. */ |
174 |
boolean (*nlm_backend_object_p) PARAMS ((bfd *)); |
bfd_boolean (*nlm_backend_object_p) PARAMS ((bfd *)); |
175 |
/* Write out the prefix. This function may be NULL. This must |
/* Write out the prefix. This function may be NULL. This must |
176 |
write out the same number of bytes as is in the field |
write out the same number of bytes as is in the field |
177 |
optional_prefix_size. */ |
optional_prefix_size. */ |
178 |
boolean (*nlm_write_prefix) PARAMS ((bfd *)); |
bfd_boolean (*nlm_write_prefix) PARAMS ((bfd *)); |
179 |
/* Read a relocation fixup from abfd. The reloc information is |
/* Read a relocation fixup from abfd. The reloc information is |
180 |
machine specific. The second argument is the symbol if this is |
machine specific. The second argument is the symbol if this is |
181 |
an import, or NULL if this is a reloc fixup. This function |
an import, or NULL if this is a reloc fixup. This function |
183 |
belongs in, and the fourth argument to the reloc itself; it does |
belongs in, and the fourth argument to the reloc itself; it does |
184 |
not need to fill in the sym_ptr_ptr field for a reloc against an |
not need to fill in the sym_ptr_ptr field for a reloc against an |
185 |
import symbol. */ |
import symbol. */ |
186 |
boolean (*nlm_read_reloc) PARAMS ((bfd *, nlmNAME(symbol_type) *, |
bfd_boolean (*nlm_read_reloc) |
187 |
asection **, arelent *)); |
PARAMS ((bfd *, nlmNAME(symbol_type) *, asection **, arelent *)); |
188 |
/* To make objcopy to an i386 NLM work, the i386 backend needs a |
/* To make objcopy to an i386 NLM work, the i386 backend needs a |
189 |
chance to work over the relocs. This is a bit icky. */ |
chance to work over the relocs. This is a bit icky. */ |
190 |
boolean (*nlm_mangle_relocs) PARAMS ((bfd *, asection *, PTR data, |
bfd_boolean (*nlm_mangle_relocs) |
191 |
bfd_vma offset, |
PARAMS ((bfd *, asection *, const PTR data, bfd_vma offset, |
192 |
bfd_size_type count)); |
bfd_size_type count)); |
193 |
/* Read an import record from abfd. It would be nice if this |
/* Read an import record from abfd. It would be nice if this |
194 |
were in a machine-dependent format, but it doesn't seem to be. */ |
were in a machine-dependent format, but it doesn't seem to be. */ |
195 |
boolean (*nlm_read_import) PARAMS ((bfd *, nlmNAME(symbol_type) *)); |
bfd_boolean (*nlm_read_import) PARAMS ((bfd *, nlmNAME(symbol_type) *)); |
196 |
/* Write an import record to abfd. */ |
/* Write an import record to abfd. */ |
197 |
boolean (*nlm_write_import) PARAMS ((bfd *, asection *, arelent *)); |
bfd_boolean (*nlm_write_import) PARAMS ((bfd *, asection *, arelent *)); |
198 |
/* Set the section for a public symbol. This may be NULL, in which |
/* Set the section for a public symbol. This may be NULL, in which |
199 |
case a default method will be used. */ |
case a default method will be used. */ |
200 |
boolean (*nlm_set_public_section) PARAMS ((bfd *, nlmNAME(symbol_type) *)); |
bfd_boolean (*nlm_set_public_section) |
201 |
|
PARAMS ((bfd *, nlmNAME(symbol_type) *)); |
202 |
/* Get the offset to write out for a public symbol. This may be |
/* Get the offset to write out for a public symbol. This may be |
203 |
NULL, in which case a default method will be used. */ |
NULL, in which case a default method will be used. */ |
204 |
bfd_vma (*nlm_get_public_offset) PARAMS ((bfd *, asymbol *)); |
bfd_vma (*nlm_get_public_offset) PARAMS ((bfd *, asymbol *)); |
205 |
/* Swap the fixed header in and out */ |
/* Swap the fixed header in and out */ |
206 |
void (*nlm_swap_fhdr_in) PARAMS ((bfd *, |
void (*nlm_swap_fhdr_in) |
207 |
PTR, |
PARAMS ((bfd *, PTR, Nlm_Internal_Fixed_Header *)); |
208 |
Nlm_Internal_Fixed_Header *)); |
void (*nlm_swap_fhdr_out) |
209 |
void (*nlm_swap_fhdr_out) PARAMS ((bfd *, |
PARAMS ((bfd *, struct nlm_internal_fixed_header *, PTR)); |
|
struct nlm_internal_fixed_header *, |
|
|
PTR)); |
|
210 |
/* Write out an external reference. */ |
/* Write out an external reference. */ |
211 |
boolean (*nlm_write_external) PARAMS ((bfd *, bfd_size_type, |
bfd_boolean (*nlm_write_external) |
212 |
asymbol *, |
PARAMS ((bfd *, bfd_size_type, asymbol *, struct reloc_and_sec *)); |
213 |
struct reloc_and_sec *)); |
bfd_boolean (*nlm_write_export) PARAMS ((bfd *, asymbol *, bfd_vma)); |
|
boolean (*nlm_write_export) PARAMS ((bfd *, asymbol *, bfd_vma)); |
|
214 |
}; |
}; |
215 |
|
|
216 |
#define nlm_backend(bfd) \ |
#define nlm_backend(bfd) \ |