* configure.in (*-*-netware, i[34]86-*-netware): New configs.
[external/binutils.git] / bfd / libnlm.h
1 /* BFD back-end data structures for NLM (NetWare Loadable Modules) files.
2    Copyright (C) 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 _LIBNLM_H_
22 #define _LIBNLM_H_ 1
23
24 #include "nlm/common.h"
25 #include "nlm/internal.h"
26 #include "nlm/external.h"
27
28 /* If size isn't specified as 64 or 32, NAME macro should fail.  */
29 #ifndef NAME
30 #  if ARCH_SIZE==64
31 #    define NAME(x,y) CAT4(x,64,_,y)
32 #  endif
33 #  if ARCH_SIZE==32
34 #    define NAME(x,y) CAT4(x,32,_,y)
35 #  endif
36 #endif
37
38 #define NlmNAME(X)      NAME(Nlm,X)
39 #define nlmNAME(X)      NAME(nlm,X)
40
41 typedef struct
42 {
43   asymbol symbol;
44 } nlm32_symbol_type;
45
46 typedef struct
47 {
48   asymbol symbol;
49 } nlm64_symbol_type;
50
51 #define bfd_nlm32_mkobject              bfd_nlm_mkobject
52 #define bfd_nlm64_mkobject              bfd_nlm_mkobject
53 #define nlm_mkobject                    bfd_nlm_mkobject
54 extern boolean bfd_nlm_mkobject PARAMS ((bfd *));
55
56 extern void bfd_nlm32_get_symbol_info
57   PARAMS ((bfd *, asymbol *, symbol_info *));
58 extern unsigned int bfd_nlm32_get_symtab_upper_bound PARAMS ((bfd *));
59 extern unsigned int bfd_nlm64_get_symtab_upper_bound PARAMS ((bfd *));
60 extern unsigned int bfd_nlm32_get_symtab PARAMS ((bfd *, asymbol **));
61 extern unsigned int bfd_nlm64_get_symtab PARAMS ((bfd *, asymbol **));
62 extern asymbol *bfd_nlm32_make_empty_symbol PARAMS ((bfd *));
63 extern asymbol *bfd_nlm64_make_empty_symbol PARAMS ((bfd *));
64 extern bfd_target *bfd_nlm32_object_p PARAMS ((bfd *));
65 extern bfd_target *bfd_nlm64_object_p PARAMS ((bfd *));
66 extern boolean bfd_nlm32_set_arch_mach
67   PARAMS ((bfd *, enum bfd_architecture, unsigned long));
68 extern boolean bfd_nlm64_set_arch_mach
69   PARAMS ((bfd *, enum bfd_architecture, unsigned long));
70
71 /* Some private data is stashed away for future use using the tdata pointer
72    in the bfd structure.  */
73
74 struct nlm_obj_tdata
75 {
76   /* Actual data, but ref like ptr */
77   Nlm_Internal_Fixed_Header     nlm_fixed_header[1];
78   Nlm_Internal_Variable_Header  nlm_variable_header[1];
79   Nlm_Internal_Version_Header   nlm_version_header[1];
80   Nlm_Internal_Copyright_Header nlm_copyright_header[1];
81   Nlm_Internal_Extended_Header  nlm_extended_header[1];
82   Nlm_Internal_Custom_Header    nlm_custom_header[1];
83 };
84
85 #define nlm_tdata(bfd)                  ((bfd) -> tdata.nlm_obj_data)
86 #define nlm_fixed_header(bfd)           (nlm_tdata(bfd) -> nlm_fixed_header)
87 #define nlm_variable_header(bfd)        (nlm_tdata(bfd) -> nlm_variable_header)
88 #define nlm_version_header(bfd)         (nlm_tdata(bfd) -> nlm_version_header)
89 #define nlm_copyright_header(bfd)       (nlm_tdata(bfd) -> nlm_copyright_header)
90 #define nlm_extended_header(bfd)        (nlm_tdata(bfd) -> nlm_extended_header)
91 #define nlm_custom_header(bfd)          (nlm_tdata(bfd) -> nlm_custom_header)
92
93 /* The NLM code, data, and uninitialized sections have no names defined
94    in the NLM, but bfd wants to give them names, so use the traditional
95    UNIX names.  */
96
97 #define NLM_CODE_NAME                   ".text"
98 #define NLM_INITIALIZED_DATA_NAME       ".data"
99 #define NLM_UNINITIALIZED_DATA_NAME     ".bss"
100
101 #endif /* _LIBNLM_H_ */