]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - bfd/nlm-target.h
Fix ld --just-symbols
[thirdparty/binutils-gdb.git] / bfd / nlm-target.h
CommitLineData
252b5132 1/* Target definitions for 32/64-bit NLM (NetWare Loadable Module)
e2d34d7d
DJ
2 Copyright 1993, 1994, 1998, 1999, 2000, 2001, 2002
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#define nlm_core_file_p _bfd_dummy_target
22
23#define nlm_get_symtab_upper_bound nlmNAME(get_symtab_upper_bound)
24#define nlm_get_symtab nlmNAME(get_symtab)
25#define nlm_make_empty_symbol nlmNAME(make_empty_symbol)
26#define nlm_print_symbol nlmNAME(print_symbol)
27#define nlm_get_symbol_info nlmNAME(get_symbol_info)
28#define nlm_bfd_is_local_label_name bfd_generic_is_local_label_name
29#define nlm_get_lineno _bfd_nosymbols_get_lineno
30#define nlm_find_nearest_line _bfd_nosymbols_find_nearest_line
31#define nlm_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
32#define nlm_read_minisymbols _bfd_generic_read_minisymbols
33#define nlm_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
34
35#define nlm_get_reloc_upper_bound nlmNAME(get_reloc_upper_bound)
36#define nlm_canonicalize_reloc nlmNAME(canonicalize_reloc)
37#define nlm_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
38
39#define nlm_set_section_contents nlmNAME(set_section_contents)
40
41#define nlm_sizeof_headers _bfd_nolink_sizeof_headers
42#define nlm_bfd_get_relocated_section_contents \
43 bfd_generic_get_relocated_section_contents
44#define nlm_bfd_relax_section bfd_generic_relax_section
45#define nlm_bfd_gc_sections bfd_generic_gc_sections
8550eb6e 46#define nlm_bfd_merge_sections bfd_generic_merge_sections
252b5132 47#define nlm_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
e2d34d7d 48#define nlm_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
252b5132 49#define nlm_bfd_link_add_symbols _bfd_generic_link_add_symbols
2d653fc7 50#define nlm_bfd_link_just_syms _bfd_generic_link_just_syms
252b5132
RH
51#define nlm_bfd_final_link _bfd_generic_final_link
52#define nlm_bfd_link_split_section _bfd_generic_link_split_section
53
54/* This structure contains everything that BFD knows about a target.
55 It includes things like its byte order, name, what routines to call
56 to do various operations, etc. Every BFD points to a target structure
57 with its "xvec" member.
58
59 There are two such structures here: one for big-endian machines and
60 one for little-endian machines. */
61
c3c89269
NC
62/* Forward declaration for use when initialising alternative_target field. */
63#ifdef TARGET_LITTLE_SYM
64extern const bfd_target TARGET_LITTLE_SYM;
65#endif
252b5132
RH
66
67#ifdef TARGET_BIG_SYM
68const bfd_target TARGET_BIG_SYM =
69{
70 /* name: identify kind of target */
71 TARGET_BIG_NAME,
72
73 /* flavour: general indication about file */
74 bfd_target_nlm_flavour,
75
76 /* byteorder: data is big endian */
77 BFD_ENDIAN_BIG,
78
79 /* header_byteorder: header is also big endian */
80 BFD_ENDIAN_BIG,
81
82 /* object_flags: mask of all file flags */
83 (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS
84 | WP_TEXT),
1518639e 85
252b5132
RH
86 /* section_flags: mask of all section flags */
87 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
1518639e 88 SEC_CODE | SEC_DATA),
252b5132
RH
89
90 /* leading_symbol_char: is the first char of a user symbol
91 predictable, and if so what is it */
92 0,
93
94 /* ar_pad_char: pad character for filenames within an archive header
95 FIXME: this really has nothing to do with NLM, this is a characteristic
96 of the archiver and/or os and should be independently tunable */
97 '/',
98
99 /* ar_max_namelen: maximum number of characters in an archive header
100 FIXME: this really has nothing to do with NLM, this is a characteristic
101 of the archiver and should be independently tunable. This value is
102 a WAG (wild a** guess) */
103 15,
104
105 /* Routines to byte-swap various sized integers from the data sections */
106 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
107 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
108 bfd_getb16, bfd_getb_signed_16, bfd_putb16,
109
110 /* Routines to byte-swap various sized integers from the file headers */
111 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
112 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
113 bfd_getb16, bfd_getb_signed_16, bfd_putb16,
114
115 /* bfd_check_format: check the format of a file being read */
116 { _bfd_dummy_target, /* unknown format */
117 nlmNAME(object_p), /* assembler/linker output (object file) */
118 bfd_generic_archive_p, /* an archive */
119 nlm_core_file_p /* a core file */
120 },
121
122 /* bfd_set_format: set the format of a file being written */
123 { bfd_false,
124 nlm_mkobject,
125 _bfd_generic_mkarchive,
126 bfd_false
127 },
128
129 /* bfd_write_contents: write cached information into a file being written */
130 { bfd_false,
131 nlmNAME(write_object_contents),
132 _bfd_write_archive_contents,
133 bfd_false
134 },
135
136 /* Initialize a jump table with the standard macro. All names start with
137 "nlm" */
138 BFD_JUMP_TABLE_GENERIC (_bfd_generic),
139 BFD_JUMP_TABLE_COPY (_bfd_generic),
140 BFD_JUMP_TABLE_CORE (_bfd_nocore),
141 BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
142 BFD_JUMP_TABLE_SYMBOLS (nlm),
143 BFD_JUMP_TABLE_RELOCS (nlm),
144 BFD_JUMP_TABLE_WRITE (nlm),
145 BFD_JUMP_TABLE_LINK (nlm),
146 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
147
c3c89269
NC
148 /* Alternative endian target. */
149#ifdef TARGET_LITTLE_SYM
150 & TARGET_LITTLE_SYM,
151#else
152 NULL,
153#endif
1518639e 154
252b5132
RH
155 /* backend_data: */
156 (PTR) TARGET_BACKEND_DATA
157};
158#endif
159
160#ifdef TARGET_LITTLE_SYM
161const bfd_target TARGET_LITTLE_SYM =
162{
163 /* name: identify kind of target */
164 TARGET_LITTLE_NAME,
165
166 /* flavour: general indication about file */
167 bfd_target_nlm_flavour,
168
169 /* byteorder: data is little endian */
170 BFD_ENDIAN_LITTLE,
171
172 /* header_byteorder: header is also little endian */
173 BFD_ENDIAN_LITTLE,
174
175 /* object_flags: mask of all file flags */
176 (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS
177 | WP_TEXT),
1518639e 178
252b5132
RH
179 /* section_flags: mask of all section flags */
180 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
1518639e 181 SEC_DATA),
252b5132
RH
182
183 /* leading_symbol_char: is the first char of a user symbol
184 predictable, and if so what is it */
185 0,
186
187 /* ar_pad_char: pad character for filenames within an archive header
188 FIXME: this really has nothing to do with NLM, this is a characteristic
189 of the archiver and/or os and should be independently tunable */
190 '/',
191
192 /* ar_max_namelen: maximum number of characters in an archive header
193 FIXME: this really has nothing to do with NLM, this is a characteristic
194 of the archiver and should be independently tunable. This value is
195 a WAG (wild a** guess) */
196 15,
197
198 /* Routines to byte-swap various sized integers from the data sections */
199 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
200 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
201 bfd_getl16, bfd_getl_signed_16, bfd_putl16,
202
203 /* Routines to byte-swap various sized integers from the file headers */
204 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
205 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
206 bfd_getl16, bfd_getl_signed_16, bfd_putl16,
207
208 /* bfd_check_format: check the format of a file being read */
209 { _bfd_dummy_target, /* unknown format */
210 nlmNAME(object_p), /* assembler/linker output (object file) */
211 bfd_generic_archive_p, /* an archive */
212 nlm_core_file_p /* a core file */
213 },
214
215 /* bfd_set_format: set the format of a file being written */
216 { bfd_false,
217 nlm_mkobject,
218 _bfd_generic_mkarchive,
219 bfd_false
220 },
221
222 /* bfd_write_contents: write cached information into a file being written */
223 { bfd_false,
224 nlmNAME(write_object_contents),
225 _bfd_write_archive_contents,
226 bfd_false
227 },
228
229 /* Initialize a jump table with the standard macro. All names start with
230 "nlm" */
231 BFD_JUMP_TABLE_GENERIC (_bfd_generic),
232 BFD_JUMP_TABLE_COPY (_bfd_generic),
233 BFD_JUMP_TABLE_CORE (_bfd_nocore),
234 BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
235 BFD_JUMP_TABLE_SYMBOLS (nlm),
236 BFD_JUMP_TABLE_RELOCS (nlm),
237 BFD_JUMP_TABLE_WRITE (nlm),
238 BFD_JUMP_TABLE_LINK (nlm),
239 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
240
c3c89269
NC
241 /* Alternative endian target. */
242#ifdef TARGET_BIG_SYM
243 & TARGET_BIG_SYM,
244#else
245 NULL,
246#endif
1518639e 247
252b5132
RH
248 /* backend_data: */
249 (PTR) TARGET_BACKEND_DATA
250};
251#endif