Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | /* vms.c -- BFD back-end for VAX (openVMS/VAX) and |
2 | EVAX (openVMS/Alpha) files. | |
72adc230 | 3 | Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 |
7898deda | 4 | Free Software Foundation, Inc. |
252b5132 RH |
5 | |
6 | Written by Klaus K"ampf (kkaempf@rmi.de) | |
7 | ||
8 | This program is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 2 of the License, or | |
11 | (at your option) any later version. | |
12 | ||
13 | This program is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
19 | along with this program; if not, write to the Free Software | |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
21 | ||
22 | #include "bfd.h" | |
23 | #include "sysdep.h" | |
24 | #include "bfdlink.h" | |
25 | #include "libbfd.h" | |
26 | ||
27 | #include "vms.h" | |
28 | ||
b34976b6 AM |
29 | static bfd_boolean vms_initialize |
30 | PARAMS ((bfd *)); | |
5f771d47 | 31 | static unsigned int priv_section_count; |
b34976b6 AM |
32 | static bfd_boolean fill_section_ptr |
33 | PARAMS ((struct bfd_hash_entry *, PTR)); | |
34 | static bfd_boolean vms_fixup_sections | |
35 | PARAMS ((bfd *)); | |
36 | static bfd_boolean copy_symbols | |
37 | PARAMS ((struct bfd_hash_entry *, PTR)); | |
252b5132 RH |
38 | static bfd_reloc_status_type reloc_nil |
39 | PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); | |
b34976b6 AM |
40 | static const struct bfd_target *vms_object_p |
41 | PARAMS ((bfd *abfd)); | |
42 | static const struct bfd_target *vms_archive_p | |
43 | PARAMS ((bfd *abfd)); | |
44 | static bfd_boolean vms_mkobject | |
45 | PARAMS ((bfd *abfd)); | |
46 | static bfd_boolean vms_write_object_contents | |
47 | PARAMS ((bfd *abfd)); | |
48 | static bfd_boolean vms_close_and_cleanup | |
49 | PARAMS ((bfd *abfd)); | |
50 | static bfd_boolean vms_bfd_free_cached_info | |
51 | PARAMS ((bfd *abfd)); | |
52 | static bfd_boolean vms_new_section_hook | |
53 | PARAMS ((bfd *abfd, asection *section)); | |
54 | static bfd_boolean vms_get_section_contents | |
252b5132 RH |
55 | PARAMS ((bfd *abfd, asection *section, PTR x1, file_ptr x2, |
56 | bfd_size_type x3)); | |
b34976b6 | 57 | static bfd_boolean vms_get_section_contents_in_window |
252b5132 RH |
58 | PARAMS ((bfd *abfd, asection *section, bfd_window *w, file_ptr offset, |
59 | bfd_size_type count)); | |
b34976b6 AM |
60 | static bfd_boolean vms_bfd_copy_private_bfd_data |
61 | PARAMS ((bfd *src, bfd *dest)); | |
62 | static bfd_boolean vms_bfd_copy_private_section_data | |
252b5132 | 63 | PARAMS ((bfd *srcbfd, asection *srcsec, bfd *dstbfd, asection *dstsec)); |
b34976b6 | 64 | static bfd_boolean vms_bfd_copy_private_symbol_data |
252b5132 | 65 | PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym)); |
b34976b6 | 66 | static bfd_boolean vms_bfd_print_private_bfd_data |
252b5132 | 67 | PARAMS ((bfd *abfd, void *file)); |
b34976b6 AM |
68 | static char *vms_core_file_failing_command |
69 | PARAMS ((bfd *abfd)); | |
70 | static int vms_core_file_failing_signal | |
71 | PARAMS ((bfd *abfd)); | |
72 | static bfd_boolean vms_core_file_matches_executable_p | |
252b5132 | 73 | PARAMS ((bfd *abfd, bfd *bbfd)); |
b34976b6 AM |
74 | static bfd_boolean vms_slurp_armap |
75 | PARAMS ((bfd *abfd)); | |
76 | static bfd_boolean vms_slurp_extended_name_table | |
77 | PARAMS ((bfd *abfd)); | |
78 | static bfd_boolean vms_construct_extended_name_table | |
252b5132 RH |
79 | PARAMS ((bfd *abfd, char **tabloc, bfd_size_type *tablen, |
80 | const char **name)); | |
81 | static void vms_truncate_arname | |
dc810e39 | 82 | PARAMS ((bfd *abfd, const char *pathname, char *arhdr)); |
b34976b6 | 83 | static bfd_boolean vms_write_armap |
252b5132 RH |
84 | PARAMS ((bfd *arch, unsigned int elength, struct orl *map, |
85 | unsigned int orl_count, int stridx)); | |
b34976b6 AM |
86 | static PTR vms_read_ar_hdr |
87 | PARAMS ((bfd *abfd)); | |
88 | static bfd *vms_get_elt_at_index | |
89 | PARAMS ((bfd *abfd, symindex index)); | |
90 | static bfd *vms_openr_next_archived_file | |
91 | PARAMS ((bfd *arch, bfd *prev)); | |
92 | static bfd_boolean vms_update_armap_timestamp | |
93 | PARAMS ((bfd *abfd)); | |
94 | static int vms_generic_stat_arch_elt | |
95 | PARAMS ((bfd *, struct stat *)); | |
96 | static long vms_get_symtab_upper_bound | |
97 | PARAMS ((bfd *abfd)); | |
6cee3f79 | 98 | static long vms_canonicalize_symtab |
b34976b6 | 99 | PARAMS ((bfd *abfd, asymbol **symbols)); |
252b5132 RH |
100 | static void vms_print_symbol |
101 | PARAMS ((bfd *abfd, PTR file, asymbol *symbol, bfd_print_symbol_type how)); | |
102 | static void vms_get_symbol_info | |
103 | PARAMS ((bfd *abfd, asymbol *symbol, symbol_info *ret)); | |
b34976b6 AM |
104 | static bfd_boolean vms_bfd_is_local_label_name |
105 | PARAMS ((bfd *abfd, const char *)); | |
106 | static alent *vms_get_lineno | |
107 | PARAMS ((bfd *abfd, asymbol *symbol)); | |
108 | static bfd_boolean vms_find_nearest_line | |
252b5132 RH |
109 | PARAMS ((bfd *abfd, asection *section, asymbol **symbols, bfd_vma offset, |
110 | const char **file, const char **func, unsigned int *line)); | |
111 | static asymbol *vms_bfd_make_debug_symbol | |
112 | PARAMS ((bfd *abfd, void *ptr, unsigned long size)); | |
113 | static long vms_read_minisymbols | |
b34976b6 AM |
114 | PARAMS ((bfd *abfd, bfd_boolean dynamic, PTR *minisymsp, |
115 | unsigned int *sizep)); | |
252b5132 | 116 | static asymbol *vms_minisymbol_to_symbol |
b34976b6 AM |
117 | PARAMS ((bfd *abfd, bfd_boolean dynamic, const PTR minisym, asymbol *sym)); |
118 | static long vms_get_reloc_upper_bound | |
119 | PARAMS ((bfd *abfd, asection *sect)); | |
252b5132 RH |
120 | static long vms_canonicalize_reloc |
121 | PARAMS ((bfd *abfd, asection *srcsec, arelent **location, | |
122 | asymbol **symbols)); | |
123 | static const struct reloc_howto_struct *vms_bfd_reloc_type_lookup | |
124 | PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); | |
b34976b6 | 125 | static bfd_boolean vms_set_arch_mach |
252b5132 | 126 | PARAMS ((bfd *abfd, enum bfd_architecture arch, unsigned long mach)); |
b34976b6 | 127 | static bfd_boolean vms_set_section_contents |
0f867abe | 128 | PARAMS ((bfd *abfd, asection *section, const PTR location, file_ptr offset, |
252b5132 | 129 | bfd_size_type count)); |
b34976b6 AM |
130 | static int vms_sizeof_headers |
131 | PARAMS ((bfd *abfd, bfd_boolean reloc)); | |
252b5132 RH |
132 | static bfd_byte *vms_bfd_get_relocated_section_contents |
133 | PARAMS ((bfd *abfd, struct bfd_link_info *link_info, | |
134 | struct bfd_link_order *link_order, bfd_byte *data, | |
1049f94e | 135 | bfd_boolean relocatable, asymbol **symbols)); |
b34976b6 | 136 | static bfd_boolean vms_bfd_relax_section |
252b5132 | 137 | PARAMS ((bfd *abfd, asection *section, struct bfd_link_info *link_info, |
b34976b6 AM |
138 | bfd_boolean *again)); |
139 | static bfd_boolean vms_bfd_gc_sections | |
252b5132 | 140 | PARAMS ((bfd *abfd, struct bfd_link_info *link_info)); |
b34976b6 | 141 | static bfd_boolean vms_bfd_merge_sections |
8550eb6e | 142 | PARAMS ((bfd *abfd, struct bfd_link_info *link_info)); |
252b5132 RH |
143 | static struct bfd_link_hash_table *vms_bfd_link_hash_table_create |
144 | PARAMS ((bfd *abfd)); | |
e2d34d7d DJ |
145 | static void vms_bfd_link_hash_table_free |
146 | PARAMS ((struct bfd_link_hash_table *hash)); | |
b34976b6 | 147 | static bfd_boolean vms_bfd_link_add_symbols |
252b5132 | 148 | PARAMS ((bfd *abfd, struct bfd_link_info *link_info)); |
b34976b6 | 149 | static bfd_boolean vms_bfd_final_link |
252b5132 | 150 | PARAMS ((bfd *abfd, struct bfd_link_info *link_info)); |
b34976b6 | 151 | static bfd_boolean vms_bfd_link_split_section |
252b5132 | 152 | PARAMS ((bfd *abfd, asection *section)); |
b34976b6 AM |
153 | static long vms_get_dynamic_symtab_upper_bound |
154 | PARAMS ((bfd *abfd)); | |
252b5132 RH |
155 | static long vms_canonicalize_dynamic_symtab |
156 | PARAMS ((bfd *abfd, asymbol **symbols)); | |
4c45e5c9 | 157 | #define vms_get_synthetic_symtab _bfd_nodynamic_get_synthetic_symtab |
b34976b6 AM |
158 | static long vms_get_dynamic_reloc_upper_bound |
159 | PARAMS ((bfd *abfd)); | |
252b5132 RH |
160 | static long vms_canonicalize_dynamic_reloc |
161 | PARAMS ((bfd *abfd, arelent **arel, asymbol **symbols)); | |
b34976b6 AM |
162 | static bfd_boolean vms_bfd_merge_private_bfd_data |
163 | PARAMS ((bfd *ibfd, bfd *obfd)); | |
164 | static bfd_boolean vms_bfd_set_private_flags | |
165 | PARAMS ((bfd *abfd, flagword flags)); | |
252b5132 | 166 | |
3f3c5c34 | 167 | #define vms_make_empty_symbol _bfd_generic_make_empty_symbol |
2d653fc7 | 168 | #define vms_bfd_link_just_syms _bfd_generic_link_just_syms |
72adc230 | 169 | #define vms_bfd_is_group_section bfd_generic_is_group_section |
e61463e1 | 170 | #define vms_bfd_discard_group bfd_generic_discard_group |
252b5132 RH |
171 | \f |
172 | /*===========================================================================*/ | |
173 | ||
174 | const bfd_target vms_alpha_vec = | |
175 | { | |
252b5132 RH |
176 | "vms-alpha", /* name */ |
177 | bfd_target_evax_flavour, | |
c3c89269 NC |
178 | BFD_ENDIAN_LITTLE, /* data byte order is little */ |
179 | BFD_ENDIAN_LITTLE, /* header byte order is little */ | |
252b5132 RH |
180 | |
181 | (HAS_RELOC | HAS_SYMS | |
182 | | WP_TEXT | D_PAGED), /* object flags */ | |
183 | (SEC_ALLOC | SEC_LOAD | SEC_RELOC | |
184 | | SEC_READONLY | SEC_CODE | SEC_DATA | |
185 | | SEC_HAS_CONTENTS | SEC_IN_MEMORY), /* sect flags */ | |
186 | 0, /* symbol_leading_char */ | |
187 | ' ', /* ar_pad_char */ | |
188 | 15, /* ar_max_namelen */ | |
189 | bfd_getl64, bfd_getl_signed_64, bfd_putl64, | |
190 | bfd_getl32, bfd_getl_signed_32, bfd_putl32, | |
191 | bfd_getl16, bfd_getl_signed_16, bfd_putl16, | |
192 | bfd_getl64, bfd_getl_signed_64, bfd_putl64, | |
193 | bfd_getl32, bfd_getl_signed_32, bfd_putl32, | |
194 | bfd_getl16, bfd_getl_signed_16, bfd_putl16, | |
195 | ||
196 | {_bfd_dummy_target, vms_object_p, /* bfd_check_format */ | |
197 | vms_archive_p, _bfd_dummy_target}, | |
198 | {bfd_false, vms_mkobject, /* bfd_set_format */ | |
199 | _bfd_generic_mkarchive, bfd_false}, | |
200 | {bfd_false, vms_write_object_contents, /* bfd_write_contents */ | |
201 | _bfd_write_archive_contents, bfd_false}, | |
202 | ||
203 | BFD_JUMP_TABLE_GENERIC (vms), | |
204 | BFD_JUMP_TABLE_COPY (vms), | |
205 | BFD_JUMP_TABLE_CORE (vms), | |
206 | BFD_JUMP_TABLE_ARCHIVE (vms), | |
207 | BFD_JUMP_TABLE_SYMBOLS (vms), | |
208 | BFD_JUMP_TABLE_RELOCS (vms), | |
209 | BFD_JUMP_TABLE_WRITE (vms), | |
210 | BFD_JUMP_TABLE_LINK (vms), | |
211 | BFD_JUMP_TABLE_DYNAMIC (vms), | |
212 | ||
c3c89269 | 213 | NULL, |
55f2d5ed | 214 | |
252b5132 RH |
215 | (PTR) 0 |
216 | }; | |
217 | ||
218 | const bfd_target vms_vax_vec = | |
219 | { | |
252b5132 RH |
220 | "vms-vax", /* name */ |
221 | bfd_target_ovax_flavour, | |
c3c89269 NC |
222 | BFD_ENDIAN_LITTLE, /* data byte order is little */ |
223 | BFD_ENDIAN_LITTLE, /* header byte order is little */ | |
252b5132 RH |
224 | |
225 | (HAS_RELOC | HAS_SYMS /* object flags */ | |
226 | | WP_TEXT | D_PAGED | |
227 | | HAS_LINENO | HAS_DEBUG | HAS_LOCALS), | |
228 | ||
229 | (SEC_ALLOC | SEC_LOAD | SEC_RELOC | |
230 | | SEC_READONLY | SEC_CODE | SEC_DATA | |
231 | | SEC_HAS_CONTENTS | SEC_IN_MEMORY), /* sect flags */ | |
232 | 0, /* symbol_leading_char */ | |
233 | ' ', /* ar_pad_char */ | |
234 | 15, /* ar_max_namelen */ | |
235 | bfd_getl64, bfd_getl_signed_64, bfd_putl64, | |
236 | bfd_getl32, bfd_getl_signed_32, bfd_putl32, | |
237 | bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ | |
238 | bfd_getl64, bfd_getl_signed_64, bfd_putl64, | |
239 | bfd_getl32, bfd_getl_signed_32, bfd_putl32, | |
240 | bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ | |
241 | ||
242 | {_bfd_dummy_target, vms_object_p, /* bfd_check_format */ | |
243 | vms_archive_p, _bfd_dummy_target}, | |
244 | {bfd_false, vms_mkobject, /* bfd_set_format */ | |
245 | _bfd_generic_mkarchive, bfd_false}, | |
246 | {bfd_false, vms_write_object_contents, /* bfd_write_contents */ | |
247 | _bfd_write_archive_contents, bfd_false}, | |
248 | ||
249 | BFD_JUMP_TABLE_GENERIC (vms), | |
250 | BFD_JUMP_TABLE_COPY (vms), | |
251 | BFD_JUMP_TABLE_CORE (vms), | |
252 | BFD_JUMP_TABLE_ARCHIVE (vms), | |
253 | BFD_JUMP_TABLE_SYMBOLS (vms), | |
254 | BFD_JUMP_TABLE_RELOCS (vms), | |
255 | BFD_JUMP_TABLE_WRITE (vms), | |
256 | BFD_JUMP_TABLE_LINK (vms), | |
257 | BFD_JUMP_TABLE_DYNAMIC (vms), | |
258 | ||
c3c89269 | 259 | NULL, |
55f2d5ed | 260 | |
252b5132 RH |
261 | (PTR) 0 |
262 | }; | |
263 | \f | |
264 | /*===========================================================================*/ | |
265 | ||
266 | /* Initialize private data */ | |
267 | ||
b34976b6 | 268 | static bfd_boolean |
252b5132 RH |
269 | vms_initialize (abfd) |
270 | bfd *abfd; | |
271 | { | |
272 | int i; | |
dc810e39 | 273 | bfd_size_type amt; |
252b5132 | 274 | |
dc810e39 | 275 | bfd_set_start_address (abfd, (bfd_vma) -1); |
252b5132 | 276 | |
dc810e39 | 277 | amt = sizeof (struct vms_private_data_struct); |
487e54f2 | 278 | abfd->tdata.any = (struct vms_private_data_struct*) bfd_alloc (abfd, amt); |
252b5132 | 279 | if (abfd->tdata.any == 0) |
b34976b6 | 280 | return FALSE; |
252b5132 RH |
281 | |
282 | #ifdef __ALPHA | |
8a0c27cd | 283 | PRIV (is_vax) = 0; |
252b5132 | 284 | #else |
8a0c27cd | 285 | PRIV (is_vax) = 1; |
252b5132 | 286 | #endif |
8a0c27cd KH |
287 | PRIV (vms_buf) = 0; |
288 | PRIV (buf_size) = 0; | |
289 | PRIV (rec_length) = 0; | |
290 | PRIV (file_format) = FF_UNKNOWN; | |
b34976b6 | 291 | PRIV (fixup_done) = FALSE; |
8a0c27cd KH |
292 | PRIV (sections) = NULL; |
293 | ||
dc810e39 | 294 | amt = sizeof (struct stack_struct) * STACKSIZE; |
487e54f2 | 295 | PRIV (stack) = (struct stack_struct *) bfd_alloc (abfd, amt); |
8a0c27cd | 296 | if (PRIV (stack) == 0) |
487e54f2 | 297 | goto error_ret1; |
8a0c27cd | 298 | PRIV (stackptr) = 0; |
252b5132 | 299 | |
dc810e39 | 300 | amt = sizeof (struct bfd_hash_table); |
487e54f2 | 301 | PRIV (vms_symbol_table) = (struct bfd_hash_table *) bfd_alloc (abfd, amt); |
8a0c27cd | 302 | if (PRIV (vms_symbol_table) == 0) |
487e54f2 | 303 | goto error_ret1; |
252b5132 | 304 | |
8a0c27cd | 305 | if (!bfd_hash_table_init (PRIV (vms_symbol_table), _bfd_vms_hash_newfunc)) |
487e54f2 | 306 | goto error_ret1; |
252b5132 | 307 | |
dc810e39 | 308 | amt = sizeof (struct location_struct) * LOCATION_SAVE_SIZE; |
487e54f2 | 309 | PRIV (location_stack) = (struct location_struct *) bfd_alloc (abfd, amt); |
8a0c27cd | 310 | if (PRIV (location_stack) == 0) |
487e54f2 | 311 | goto error_ret2; |
252b5132 RH |
312 | |
313 | for (i = 0; i < VMS_SECTION_COUNT; i++) | |
8a0c27cd | 314 | PRIV (vms_section_table)[i] = NULL; |
252b5132 | 315 | |
487e54f2 AM |
316 | amt = MAX_OUTREC_SIZE; |
317 | PRIV (output_buf) = (unsigned char *) bfd_alloc (abfd, amt); | |
8a0c27cd | 318 | if (PRIV (output_buf) == 0) |
487e54f2 AM |
319 | goto error_ret2; |
320 | ||
8a0c27cd KH |
321 | PRIV (push_level) = 0; |
322 | PRIV (pushed_size) = 0; | |
323 | PRIV (length_pos) = 2; | |
324 | PRIV (output_size) = 0; | |
325 | PRIV (output_alignment) = 1; | |
252b5132 | 326 | |
b34976b6 | 327 | return TRUE; |
487e54f2 AM |
328 | |
329 | error_ret2: | |
330 | bfd_hash_table_free (PRIV (vms_symbol_table)); | |
331 | error_ret1: | |
332 | bfd_release (abfd, abfd->tdata.any); | |
333 | abfd->tdata.any = 0; | |
b34976b6 | 334 | return FALSE; |
252b5132 RH |
335 | } |
336 | ||
252b5132 RH |
337 | /* Fill symbol->section with section ptr |
338 | symbol->section is filled with the section index for defined symbols | |
339 | during reading the GSD/EGSD section. But we need the pointer to the | |
340 | bfd section later. | |
341 | ||
342 | It has the correct value for referenced (undefined section) symbols | |
343 | ||
344 | called from bfd_hash_traverse in vms_fixup_sections */ | |
345 | ||
b34976b6 | 346 | static bfd_boolean |
252b5132 RH |
347 | fill_section_ptr (entry, sections) |
348 | struct bfd_hash_entry *entry; | |
349 | PTR sections; | |
350 | { | |
351 | asection *sec; | |
352 | asymbol *sym; | |
353 | ||
354 | sym = ((vms_symbol_entry *)entry)->symbol; | |
355 | sec = sym->section; | |
356 | ||
357 | #if VMS_DEBUG | |
358 | vms_debug (6, "fill_section_ptr: sym %p, sec %p\n", sym, sec); | |
359 | #endif | |
360 | ||
361 | /* fill forward references (these contain section number, not section ptr). */ | |
362 | ||
5f771d47 | 363 | if ((unsigned int) sec < priv_section_count) |
252b5132 RH |
364 | { |
365 | sec = ((vms_symbol_entry *)entry)->symbol->section = | |
366 | ((asection **)sections)[(int)sec]; | |
367 | } | |
368 | ||
369 | if (strcmp (sym->name, sec->name) == 0) | |
370 | sym->flags |= BSF_SECTION_SYM; | |
371 | ||
b34976b6 | 372 | return TRUE; |
252b5132 RH |
373 | } |
374 | ||
252b5132 RH |
375 | /* Fixup sections |
376 | set up all pointers and arrays, counters and sizes are fixed now | |
377 | ||
378 | we build a private sections vector for easy access since sections | |
379 | are always referenced by an index number. | |
380 | ||
381 | alloc PRIV(sections) according to abfd->section_count | |
382 | copy abfd->sections to PRIV(sections) */ | |
383 | ||
b34976b6 | 384 | static bfd_boolean |
252b5132 RH |
385 | vms_fixup_sections (abfd) |
386 | bfd *abfd; | |
387 | { | |
8a0c27cd | 388 | if (PRIV (fixup_done)) |
b34976b6 | 389 | return TRUE; |
252b5132 RH |
390 | |
391 | /* | |
392 | * traverse symbol table and fill in all section pointers | |
393 | */ | |
394 | ||
395 | /* can't provide section count as argument to fill_section_ptr(). */ | |
8a0c27cd KH |
396 | priv_section_count = PRIV (section_count); |
397 | bfd_hash_traverse (PRIV (vms_symbol_table), fill_section_ptr, | |
398 | (PTR) (PRIV (sections))); | |
252b5132 | 399 | |
b34976b6 | 400 | PRIV (fixup_done) = TRUE; |
252b5132 | 401 | |
b34976b6 | 402 | return TRUE; |
252b5132 RH |
403 | } |
404 | ||
405 | /*===========================================================================*/ | |
406 | ||
407 | /* Check the format for a file being read. | |
408 | Return a (bfd_target *) if it's an object file or zero if not. */ | |
409 | ||
410 | static const struct bfd_target * | |
411 | vms_object_p (abfd) | |
412 | bfd *abfd; | |
413 | { | |
414 | int err = 0; | |
415 | int prev_type; | |
416 | const struct bfd_target *target_vector = 0; | |
417 | const bfd_arch_info_type *arch = 0; | |
487e54f2 | 418 | PTR tdata_save = abfd->tdata.any; |
5e9aae3e | 419 | bfd_vma saddr_save = bfd_get_start_address (abfd); |
252b5132 RH |
420 | |
421 | #if VMS_DEBUG | |
422 | vms_debug (1, "vms_object_p(%p)\n", abfd); | |
423 | #endif | |
424 | ||
425 | if (!vms_initialize (abfd)) | |
487e54f2 | 426 | goto error_ret; |
252b5132 | 427 | |
dc810e39 | 428 | if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET)) |
487e54f2 | 429 | goto err_wrong_format; |
252b5132 RH |
430 | |
431 | prev_type = -1; | |
432 | ||
433 | do | |
434 | { | |
435 | #if VMS_DEBUG | |
436 | vms_debug (7, "reading at %08lx\n", bfd_tell(abfd)); | |
437 | #endif | |
438 | if (_bfd_vms_next_record (abfd) < 0) | |
439 | { | |
440 | #if VMS_DEBUG | |
55f2d5ed | 441 | vms_debug (2, "next_record failed\n"); |
252b5132 | 442 | #endif |
487e54f2 | 443 | goto err_wrong_format; |
252b5132 RH |
444 | } |
445 | ||
446 | if ((prev_type == EOBJ_S_C_EGSD) | |
8a0c27cd | 447 | && (PRIV (rec_type) != EOBJ_S_C_EGSD)) |
252b5132 | 448 | { |
82e51918 | 449 | if (! vms_fixup_sections (abfd)) |
252b5132 RH |
450 | { |
451 | #if VMS_DEBUG | |
452 | vms_debug (2, "vms_fixup_sections failed\n"); | |
453 | #endif | |
487e54f2 | 454 | goto err_wrong_format; |
252b5132 RH |
455 | } |
456 | } | |
457 | ||
8a0c27cd | 458 | prev_type = PRIV (rec_type); |
252b5132 RH |
459 | |
460 | if (target_vector == 0) | |
461 | { | |
462 | if (prev_type <= OBJ_S_C_MAXRECTYP) | |
463 | target_vector = &vms_vax_vec; | |
464 | else | |
465 | target_vector = &vms_alpha_vec; | |
466 | } | |
467 | ||
468 | switch (prev_type) | |
469 | { | |
470 | case OBJ_S_C_HDR: | |
471 | case EOBJ_S_C_EMH: | |
472 | err = _bfd_vms_slurp_hdr (abfd, prev_type); | |
473 | break; | |
474 | case OBJ_S_C_EOM: | |
475 | case OBJ_S_C_EOMW: | |
476 | case EOBJ_S_C_EEOM: | |
477 | err = _bfd_vms_slurp_eom (abfd, prev_type); | |
478 | break; | |
479 | case OBJ_S_C_GSD: | |
480 | case EOBJ_S_C_EGSD: | |
481 | err = _bfd_vms_slurp_gsd (abfd, prev_type); | |
482 | break; | |
483 | case OBJ_S_C_TIR: | |
484 | case EOBJ_S_C_ETIR: | |
485 | err = _bfd_vms_slurp_tir (abfd, prev_type); | |
486 | break; | |
487 | case OBJ_S_C_DBG: | |
488 | case EOBJ_S_C_EDBG: | |
489 | err = _bfd_vms_slurp_dbg (abfd, prev_type); | |
490 | break; | |
491 | case OBJ_S_C_TBT: | |
492 | case EOBJ_S_C_ETBT: | |
493 | err = _bfd_vms_slurp_tbt (abfd, prev_type); | |
494 | break; | |
495 | case OBJ_S_C_LNK: | |
496 | err = _bfd_vms_slurp_lnk (abfd, prev_type); | |
497 | break; | |
498 | default: | |
499 | err = -1; | |
500 | } | |
501 | if (err != 0) | |
502 | { | |
503 | #if VMS_DEBUG | |
504 | vms_debug (2, "slurp type %d failed with %d\n", prev_type, err); | |
505 | #endif | |
487e54f2 | 506 | goto err_wrong_format; |
252b5132 RH |
507 | } |
508 | } | |
509 | while ((prev_type != EOBJ_S_C_EEOM) && (prev_type != OBJ_S_C_EOM) && (prev_type != OBJ_S_C_EOMW)); | |
510 | ||
511 | if (target_vector == &vms_vax_vec) | |
512 | { | |
82e51918 | 513 | if (! vms_fixup_sections (abfd)) |
252b5132 RH |
514 | { |
515 | #if VMS_DEBUG | |
516 | vms_debug (2, "vms_fixup_sections failed\n"); | |
517 | #endif | |
487e54f2 | 518 | goto err_wrong_format; |
252b5132 RH |
519 | } |
520 | ||
521 | /* set arch_info to vax */ | |
55f2d5ed | 522 | |
252b5132 RH |
523 | arch = bfd_scan_arch ("vax"); |
524 | PRIV (is_vax) = 1; | |
525 | #if VMS_DEBUG | |
526 | vms_debug (2, "arch is vax\n"); | |
527 | #endif | |
528 | } | |
529 | else if (target_vector == &vms_alpha_vec) | |
530 | { | |
531 | /* set arch_info to alpha */ | |
55f2d5ed | 532 | |
252b5132 RH |
533 | arch = bfd_scan_arch ("alpha"); |
534 | PRIV (is_vax) = 0; | |
535 | #if VMS_DEBUG | |
536 | vms_debug (2, "arch is alpha\n"); | |
537 | #endif | |
538 | } | |
539 | ||
540 | if (arch == 0) | |
541 | { | |
542 | #if VMS_DEBUG | |
543 | vms_debug (2, "arch not found\n"); | |
544 | #endif | |
487e54f2 | 545 | goto err_wrong_format; |
252b5132 RH |
546 | } |
547 | abfd->arch_info = arch; | |
548 | ||
549 | return target_vector; | |
487e54f2 AM |
550 | |
551 | err_wrong_format: | |
552 | bfd_set_error (bfd_error_wrong_format); | |
553 | error_ret: | |
554 | if (abfd->tdata.any != tdata_save && abfd->tdata.any != NULL) | |
555 | bfd_release (abfd, abfd->tdata.any); | |
556 | abfd->tdata.any = tdata_save; | |
5e9aae3e | 557 | bfd_set_start_address (abfd, saddr_save); |
487e54f2 | 558 | return NULL; |
252b5132 RH |
559 | } |
560 | ||
252b5132 RH |
561 | /* Check the format for a file being read. |
562 | Return a (bfd_target *) if it's an archive file or zero. */ | |
563 | ||
564 | static const struct bfd_target * | |
565 | vms_archive_p (abfd) | |
5f771d47 | 566 | bfd *abfd ATTRIBUTE_UNUSED; |
252b5132 RH |
567 | { |
568 | #if VMS_DEBUG | |
569 | vms_debug (1, "vms_archive_p(%p)\n", abfd); | |
570 | #endif | |
571 | ||
572 | return 0; | |
573 | } | |
574 | ||
252b5132 RH |
575 | /* Set the format of a file being written. */ |
576 | ||
b34976b6 | 577 | static bfd_boolean |
252b5132 RH |
578 | vms_mkobject (abfd) |
579 | bfd *abfd; | |
580 | { | |
581 | #if VMS_DEBUG | |
582 | vms_debug (1, "vms_mkobject(%p)\n", abfd); | |
583 | #endif | |
584 | ||
585 | if (!vms_initialize (abfd)) | |
487e54f2 | 586 | return 0; |
252b5132 RH |
587 | |
588 | { | |
589 | #ifdef __VAX | |
590 | const bfd_arch_info_type *arch = bfd_scan_arch ("vax"); | |
591 | #else | |
592 | const bfd_arch_info_type *arch = bfd_scan_arch ("alpha"); | |
593 | #endif | |
594 | if (arch == 0) | |
595 | { | |
596 | bfd_set_error(bfd_error_wrong_format); | |
597 | return 0; | |
598 | } | |
599 | abfd->arch_info = arch; | |
600 | } | |
601 | ||
b34976b6 | 602 | return TRUE; |
252b5132 RH |
603 | } |
604 | ||
252b5132 RH |
605 | /* Write cached information into a file being written, at bfd_close. */ |
606 | ||
b34976b6 | 607 | static bfd_boolean |
252b5132 RH |
608 | vms_write_object_contents (abfd) |
609 | bfd *abfd; | |
610 | { | |
611 | #if VMS_DEBUG | |
612 | vms_debug (1, "vms_write_object_contents(%p)\n", abfd); | |
613 | #endif | |
614 | ||
615 | if (abfd->section_count > 0) /* we have sections */ | |
616 | { | |
8a0c27cd | 617 | if (PRIV (is_vax)) |
252b5132 RH |
618 | { |
619 | if (_bfd_vms_write_hdr (abfd, OBJ_S_C_HDR) != 0) | |
b34976b6 | 620 | return FALSE; |
252b5132 | 621 | if (_bfd_vms_write_gsd (abfd, OBJ_S_C_GSD) != 0) |
b34976b6 | 622 | return FALSE; |
252b5132 | 623 | if (_bfd_vms_write_tir (abfd, OBJ_S_C_TIR) != 0) |
b34976b6 | 624 | return FALSE; |
252b5132 | 625 | if (_bfd_vms_write_tbt (abfd, OBJ_S_C_TBT) != 0) |
b34976b6 | 626 | return FALSE; |
252b5132 | 627 | if (_bfd_vms_write_dbg (abfd, OBJ_S_C_DBG) != 0) |
b34976b6 | 628 | return FALSE; |
252b5132 RH |
629 | if (abfd->section_count > 255) |
630 | { | |
631 | if (_bfd_vms_write_eom (abfd, OBJ_S_C_EOMW) != 0) | |
b34976b6 | 632 | return FALSE; |
252b5132 RH |
633 | } |
634 | else | |
635 | { | |
636 | if (_bfd_vms_write_eom (abfd, OBJ_S_C_EOM) != 0) | |
b34976b6 | 637 | return FALSE; |
252b5132 RH |
638 | } |
639 | } | |
640 | else | |
641 | { | |
642 | if (_bfd_vms_write_hdr (abfd, EOBJ_S_C_EMH) != 0) | |
b34976b6 | 643 | return FALSE; |
252b5132 | 644 | if (_bfd_vms_write_gsd (abfd, EOBJ_S_C_EGSD) != 0) |
b34976b6 | 645 | return FALSE; |
252b5132 | 646 | if (_bfd_vms_write_tir (abfd, EOBJ_S_C_ETIR) != 0) |
b34976b6 | 647 | return FALSE; |
252b5132 | 648 | if (_bfd_vms_write_tbt (abfd, EOBJ_S_C_ETBT) != 0) |
b34976b6 | 649 | return FALSE; |
252b5132 | 650 | if (_bfd_vms_write_dbg (abfd, EOBJ_S_C_EDBG) != 0) |
b34976b6 | 651 | return FALSE; |
252b5132 | 652 | if (_bfd_vms_write_eom (abfd, EOBJ_S_C_EEOM) != 0) |
b34976b6 | 653 | return FALSE; |
252b5132 RH |
654 | } |
655 | } | |
b34976b6 | 656 | return TRUE; |
252b5132 RH |
657 | } |
658 | ||
659 | /*-- 4.1, generic -----------------------------------------------------------*/ | |
660 | ||
661 | /* Called when the BFD is being closed to do any necessary cleanup. */ | |
662 | ||
b34976b6 | 663 | static bfd_boolean |
252b5132 RH |
664 | vms_close_and_cleanup (abfd) |
665 | bfd *abfd; | |
666 | { | |
252b5132 RH |
667 | #if VMS_DEBUG |
668 | vms_debug (1, "vms_close_and_cleanup(%p)\n", abfd); | |
669 | #endif | |
670 | if (abfd == 0) | |
b34976b6 | 671 | return TRUE; |
252b5132 | 672 | |
8a0c27cd | 673 | if (PRIV (vms_buf) != NULL) |
487e54f2 | 674 | free (PRIV (vms_buf)); |
252b5132 | 675 | |
8a0c27cd | 676 | if (PRIV (sections) != NULL) |
487e54f2 | 677 | free (PRIV (sections)); |
252b5132 | 678 | |
8a0c27cd | 679 | if (PRIV (vms_symbol_table)) |
487e54f2 | 680 | bfd_hash_table_free (PRIV (vms_symbol_table)); |
252b5132 | 681 | |
487e54f2 | 682 | bfd_release (abfd, abfd->tdata.any); |
252b5132 RH |
683 | abfd->tdata.any = NULL; |
684 | ||
b34976b6 | 685 | return TRUE; |
252b5132 RH |
686 | } |
687 | ||
252b5132 | 688 | /* Ask the BFD to free all cached information. */ |
b34976b6 | 689 | static bfd_boolean |
252b5132 | 690 | vms_bfd_free_cached_info (abfd) |
5f771d47 | 691 | bfd *abfd ATTRIBUTE_UNUSED; |
252b5132 RH |
692 | { |
693 | #if VMS_DEBUG | |
694 | vms_debug (1, "vms_bfd_free_cached_info(%p)\n", abfd); | |
695 | #endif | |
b34976b6 | 696 | return TRUE; |
252b5132 RH |
697 | } |
698 | ||
252b5132 RH |
699 | /* Called when a new section is created. */ |
700 | ||
b34976b6 | 701 | static bfd_boolean |
252b5132 RH |
702 | vms_new_section_hook (abfd, section) |
703 | bfd *abfd; | |
704 | asection *section; | |
705 | { | |
4e6bfe8a AM |
706 | /* Count hasn't been incremented yet. */ |
707 | unsigned int section_count = abfd->section_count + 1; | |
708 | ||
252b5132 | 709 | #if VMS_DEBUG |
4e6bfe8a AM |
710 | vms_debug (1, "vms_new_section_hook (%p, [%d]%s), count %d\n", |
711 | abfd, section->index, section->name, section_count); | |
252b5132 | 712 | #endif |
4e6bfe8a | 713 | bfd_set_section_alignment (abfd, section, 4); |
252b5132 | 714 | |
4e6bfe8a | 715 | if (section_count > PRIV (section_count)) |
252b5132 | 716 | { |
4e6bfe8a | 717 | bfd_size_type amt = section_count; |
dc810e39 AM |
718 | amt *= sizeof (asection *); |
719 | PRIV (sections) = (asection **) bfd_realloc (PRIV (sections), amt); | |
8a0c27cd | 720 | if (PRIV (sections) == 0) |
b34976b6 | 721 | return FALSE; |
4e6bfe8a | 722 | PRIV (section_count) = section_count; |
252b5132 RH |
723 | } |
724 | #if VMS_DEBUG | |
8a0c27cd | 725 | vms_debug (6, "section_count: %d\n", PRIV (section_count)); |
252b5132 | 726 | #endif |
8a0c27cd | 727 | PRIV (sections)[section->index] = section; |
252b5132 RH |
728 | #if VMS_DEBUG |
729 | vms_debug (7, "%d: %s\n", section->index, section->name); | |
730 | #endif | |
731 | ||
b34976b6 | 732 | return TRUE; |
252b5132 RH |
733 | } |
734 | ||
252b5132 RH |
735 | /* Read the contents of a section. |
736 | buf points to a buffer of buf_size bytes to be filled with | |
737 | section data (starting at offset into section) */ | |
738 | ||
b34976b6 | 739 | static bfd_boolean |
252b5132 | 740 | vms_get_section_contents (abfd, section, buf, offset, buf_size) |
5f771d47 ILT |
741 | bfd *abfd ATTRIBUTE_UNUSED; |
742 | asection *section ATTRIBUTE_UNUSED; | |
743 | PTR buf ATTRIBUTE_UNUSED; | |
744 | file_ptr offset ATTRIBUTE_UNUSED; | |
745 | bfd_size_type buf_size ATTRIBUTE_UNUSED; | |
252b5132 RH |
746 | { |
747 | #if VMS_DEBUG | |
748 | vms_debug (1, "vms_get_section_contents(%p, %s, %p, off %ld, size %d)\n", | |
749 | abfd, section->name, buf, offset, (int)buf_size); | |
750 | #endif | |
751 | ||
752 | /* shouldn't be called, since all sections are IN_MEMORY */ | |
753 | ||
b34976b6 | 754 | return FALSE; |
252b5132 RH |
755 | } |
756 | ||
757 | /* Read the contents of a section. | |
758 | buf points to a buffer of buf_size bytes to be filled with | |
759 | section data (starting at offset into section) */ | |
760 | ||
b34976b6 | 761 | static bfd_boolean |
252b5132 | 762 | vms_get_section_contents_in_window (abfd, section, w, offset, count) |
5f771d47 ILT |
763 | bfd *abfd ATTRIBUTE_UNUSED; |
764 | asection *section ATTRIBUTE_UNUSED; | |
765 | bfd_window *w ATTRIBUTE_UNUSED; | |
766 | file_ptr offset ATTRIBUTE_UNUSED; | |
767 | bfd_size_type count ATTRIBUTE_UNUSED; | |
252b5132 RH |
768 | { |
769 | #if VMS_DEBUG | |
770 | vms_debug (1, "vms_get_section_contents_in_window(%p, %s, %p, off %ld, count %d)\n", | |
771 | abfd, section->name, w, offset, (int)count); | |
772 | #endif | |
773 | ||
774 | /* shouldn't be called, since all sections are IN_MEMORY */ | |
775 | ||
b34976b6 | 776 | return FALSE; |
252b5132 RH |
777 | } |
778 | ||
779 | /*-- Part 4.2, copy private data --------------------------------------------*/ | |
780 | ||
781 | /* Called to copy BFD general private data from one object file | |
782 | to another. */ | |
783 | ||
b34976b6 | 784 | static bfd_boolean |
252b5132 | 785 | vms_bfd_copy_private_bfd_data (src, dest) |
5f771d47 ILT |
786 | bfd *src ATTRIBUTE_UNUSED; |
787 | bfd *dest ATTRIBUTE_UNUSED; | |
252b5132 RH |
788 | { |
789 | #if VMS_DEBUG | |
790 | vms_debug (1, "vms_bfd_copy_private_bfd_data(%p, %p)\n", src, dest); | |
791 | #endif | |
b34976b6 | 792 | return TRUE; |
252b5132 RH |
793 | } |
794 | ||
252b5132 | 795 | /* Merge private BFD information from the BFD @var{ibfd} to the |
b34976b6 AM |
796 | the output file BFD @var{obfd} when linking. Return <<TRUE>> |
797 | on success, <<FALSE>> on error. Possible error returns are: | |
252b5132 RH |
798 | |
799 | o <<bfd_error_no_memory>> - | |
800 | Not enough memory exists to create private data for @var{obfd}. */ | |
801 | ||
b34976b6 | 802 | static bfd_boolean |
252b5132 | 803 | vms_bfd_merge_private_bfd_data (ibfd, obfd) |
5f771d47 ILT |
804 | bfd *ibfd ATTRIBUTE_UNUSED; |
805 | bfd *obfd ATTRIBUTE_UNUSED; | |
252b5132 RH |
806 | { |
807 | #if VMS_DEBUG | |
808 | vms_debug (1,"vms_bfd_merge_private_bfd_data(%p, %p)\n", ibfd, obfd); | |
809 | #endif | |
b34976b6 | 810 | return TRUE; |
252b5132 RH |
811 | } |
812 | ||
252b5132 | 813 | /* Set private BFD flag information in the BFD @var{abfd}. |
b34976b6 | 814 | Return <<TRUE>> on success, <<FALSE>> on error. Possible error |
252b5132 RH |
815 | returns are: |
816 | ||
817 | o <<bfd_error_no_memory>> - | |
818 | Not enough memory exists to create private data for @var{obfd}. */ | |
819 | ||
b34976b6 | 820 | static bfd_boolean |
252b5132 | 821 | vms_bfd_set_private_flags (abfd, flags) |
5f771d47 ILT |
822 | bfd *abfd ATTRIBUTE_UNUSED; |
823 | flagword flags ATTRIBUTE_UNUSED; | |
252b5132 RH |
824 | { |
825 | #if VMS_DEBUG | |
826 | vms_debug (1,"vms_bfd_set_private_flags(%p, %lx)\n", abfd, (long)flags); | |
827 | #endif | |
b34976b6 | 828 | return TRUE; |
252b5132 RH |
829 | } |
830 | ||
252b5132 RH |
831 | /* Called to copy BFD private section data from one object file |
832 | to another. */ | |
833 | ||
b34976b6 | 834 | static bfd_boolean |
252b5132 | 835 | vms_bfd_copy_private_section_data (srcbfd, srcsec, dstbfd, dstsec) |
5f771d47 ILT |
836 | bfd *srcbfd ATTRIBUTE_UNUSED; |
837 | asection *srcsec ATTRIBUTE_UNUSED; | |
838 | bfd *dstbfd ATTRIBUTE_UNUSED; | |
839 | asection *dstsec ATTRIBUTE_UNUSED; | |
252b5132 RH |
840 | { |
841 | #if VMS_DEBUG | |
842 | vms_debug (1, "vms_bfd_copy_private_section_data(%p, %s, %p, %s)\n", | |
843 | srcbfd, srcsec->name, dstbfd, dstsec->name); | |
844 | #endif | |
b34976b6 | 845 | return TRUE; |
252b5132 RH |
846 | } |
847 | ||
848 | /* Called to copy BFD private symbol data from one object file | |
849 | to another. */ | |
850 | ||
b34976b6 | 851 | static bfd_boolean |
252b5132 | 852 | vms_bfd_copy_private_symbol_data (ibfd, isym, obfd, osym) |
5f771d47 ILT |
853 | bfd *ibfd ATTRIBUTE_UNUSED; |
854 | asymbol *isym ATTRIBUTE_UNUSED; | |
855 | bfd *obfd ATTRIBUTE_UNUSED; | |
856 | asymbol *osym ATTRIBUTE_UNUSED; | |
252b5132 RH |
857 | { |
858 | #if VMS_DEBUG | |
859 | vms_debug (1, "vms_bfd_copy_private_symbol_data(%p, %s, %p, %s)\n", | |
860 | ibfd, isym->name, obfd, osym->name); | |
861 | #endif | |
b34976b6 | 862 | return TRUE; |
252b5132 RH |
863 | } |
864 | ||
865 | /*-- Part 4.3, core file ----------------------------------------------------*/ | |
866 | ||
867 | /* Return a read-only string explaining which program was running | |
868 | when it failed and produced the core file abfd. */ | |
869 | ||
870 | static char * | |
871 | vms_core_file_failing_command (abfd) | |
5f771d47 | 872 | bfd *abfd ATTRIBUTE_UNUSED; |
252b5132 RH |
873 | { |
874 | #if VMS_DEBUG | |
875 | vms_debug (1, "vms_core_file_failing_command(%p)\n", abfd); | |
876 | #endif | |
877 | return 0; | |
878 | } | |
879 | ||
252b5132 RH |
880 | /* Returns the signal number which caused the core dump which |
881 | generated the file the BFD abfd is attached to. */ | |
882 | ||
883 | static int | |
884 | vms_core_file_failing_signal (abfd) | |
5f771d47 | 885 | bfd *abfd ATTRIBUTE_UNUSED; |
252b5132 RH |
886 | { |
887 | #if VMS_DEBUG | |
888 | vms_debug (1, "vms_core_file_failing_signal(%p)\n", abfd); | |
889 | #endif | |
890 | return 0; | |
891 | } | |
892 | ||
b34976b6 AM |
893 | /* Return TRUE if the core file attached to core_bfd was generated |
894 | by a run of the executable file attached to exec_bfd, FALSE otherwise. */ | |
252b5132 | 895 | |
b34976b6 | 896 | static bfd_boolean |
252b5132 | 897 | vms_core_file_matches_executable_p (abfd, bbfd) |
5f771d47 ILT |
898 | bfd *abfd ATTRIBUTE_UNUSED; |
899 | bfd *bbfd ATTRIBUTE_UNUSED; | |
252b5132 RH |
900 | { |
901 | #if VMS_DEBUG | |
902 | vms_debug (1, "vms_core_file_matches_executable_p(%p, %p)\n", abfd, bbfd); | |
903 | #endif | |
b34976b6 | 904 | return FALSE; |
252b5132 RH |
905 | } |
906 | ||
907 | /*-- Part 4.4, archive ------------------------------------------------------*/ | |
908 | ||
909 | /* ??? do something with an archive map. | |
b34976b6 | 910 | Return FALSE on error, TRUE otherwise. */ |
252b5132 | 911 | |
b34976b6 | 912 | static bfd_boolean |
252b5132 | 913 | vms_slurp_armap (abfd) |
5f771d47 | 914 | bfd *abfd ATTRIBUTE_UNUSED; |
252b5132 RH |
915 | { |
916 | #if VMS_DEBUG | |
917 | vms_debug (1, "vms_slurp_armap(%p)\n", abfd); | |
918 | #endif | |
b34976b6 | 919 | return FALSE; |
252b5132 RH |
920 | } |
921 | ||
252b5132 | 922 | /* ??? do something with an extended name table. |
b34976b6 | 923 | Return FALSE on error, TRUE otherwise. */ |
252b5132 | 924 | |
b34976b6 | 925 | static bfd_boolean |
252b5132 | 926 | vms_slurp_extended_name_table (abfd) |
5f771d47 | 927 | bfd *abfd ATTRIBUTE_UNUSED; |
252b5132 RH |
928 | { |
929 | #if VMS_DEBUG | |
930 | vms_debug (1, "vms_slurp_extended_name_table(%p)\n", abfd); | |
931 | #endif | |
b34976b6 | 932 | return FALSE; |
252b5132 RH |
933 | } |
934 | ||
252b5132 | 935 | /* ??? do something with an extended name table. |
b34976b6 | 936 | Return FALSE on error, TRUE otherwise. */ |
252b5132 | 937 | |
b34976b6 | 938 | static bfd_boolean |
252b5132 | 939 | vms_construct_extended_name_table (abfd, tabloc, tablen, name) |
5f771d47 ILT |
940 | bfd *abfd ATTRIBUTE_UNUSED; |
941 | char **tabloc ATTRIBUTE_UNUSED; | |
942 | bfd_size_type *tablen ATTRIBUTE_UNUSED; | |
943 | const char **name ATTRIBUTE_UNUSED; | |
252b5132 RH |
944 | { |
945 | #if VMS_DEBUG | |
946 | vms_debug (1, "vms_construct_extended_name_table(%p)\n", abfd); | |
947 | #endif | |
b34976b6 | 948 | return FALSE; |
252b5132 RH |
949 | } |
950 | ||
252b5132 RH |
951 | /* Truncate the name of an archive to match system-dependent restrictions */ |
952 | ||
953 | static void | |
954 | vms_truncate_arname (abfd, pathname, arhdr) | |
5f771d47 | 955 | bfd *abfd ATTRIBUTE_UNUSED; |
dc810e39 | 956 | const char *pathname ATTRIBUTE_UNUSED; |
5f771d47 | 957 | char *arhdr ATTRIBUTE_UNUSED; |
252b5132 RH |
958 | { |
959 | #if VMS_DEBUG | |
960 | vms_debug (1, "vms_truncate_arname(%p, %s, %s)\n", abfd, pathname, arhdr); | |
961 | #endif | |
962 | return; | |
963 | } | |
964 | ||
252b5132 RH |
965 | /* ??? write archive map */ |
966 | ||
b34976b6 | 967 | static bfd_boolean |
252b5132 | 968 | vms_write_armap (arch, elength, map, orl_count, stridx) |
5f771d47 ILT |
969 | bfd *arch ATTRIBUTE_UNUSED; |
970 | unsigned int elength ATTRIBUTE_UNUSED; | |
971 | struct orl *map ATTRIBUTE_UNUSED; | |
972 | unsigned int orl_count ATTRIBUTE_UNUSED; | |
973 | int stridx ATTRIBUTE_UNUSED; | |
252b5132 RH |
974 | { |
975 | #if VMS_DEBUG | |
976 | vms_debug (1, "vms_write_armap(%p, %d, %p, %d %d)\n", | |
977 | arch, elength, map, orl_count, stridx); | |
978 | #endif | |
b34976b6 | 979 | return TRUE; |
252b5132 RH |
980 | } |
981 | ||
982 | /* Read archive header ??? */ | |
983 | ||
984 | static PTR | |
985 | vms_read_ar_hdr (abfd) | |
5f771d47 | 986 | bfd * abfd ATTRIBUTE_UNUSED; |
252b5132 RH |
987 | { |
988 | #if VMS_DEBUG | |
989 | vms_debug (1, "vms_read_ar_hdr(%p)\n", abfd); | |
990 | #endif | |
991 | return (PTR)0; | |
992 | } | |
993 | ||
252b5132 RH |
994 | /* Provided a BFD, @var{archive}, containing an archive and NULL, open |
995 | an input BFD on the first contained element and returns that. | |
996 | Subsequent calls should pass the archive and the previous return value | |
997 | to return a created BFD to the next contained element. | |
998 | NULL is returned when there are no more. */ | |
999 | ||
1000 | static bfd * | |
1001 | vms_openr_next_archived_file (arch, prev) | |
5f771d47 ILT |
1002 | bfd *arch ATTRIBUTE_UNUSED; |
1003 | bfd *prev ATTRIBUTE_UNUSED; | |
252b5132 RH |
1004 | { |
1005 | #if VMS_DEBUG | |
1006 | vms_debug (1, "vms_openr_next_archived_file(%p, %p)\n", arch, prev); | |
1007 | #endif | |
01fff6e2 | 1008 | return NULL; |
252b5132 RH |
1009 | } |
1010 | ||
252b5132 RH |
1011 | /* Return the BFD which is referenced by the symbol in ABFD indexed by |
1012 | INDEX. INDEX should have been returned by bfd_get_next_mapent. */ | |
1013 | ||
1014 | static bfd * | |
1015 | vms_get_elt_at_index (abfd, index) | |
1016 | bfd *abfd; | |
1017 | symindex index; | |
1018 | { | |
1019 | #if VMS_DEBUG | |
1020 | vms_debug (1, "vms_get_elt_at_index(%p, %p)\n", abfd, index); | |
1021 | #endif | |
1022 | return _bfd_generic_get_elt_at_index(abfd, index); | |
1023 | } | |
1024 | ||
252b5132 RH |
1025 | /* ??? |
1026 | -> bfd_generic_stat_arch_elt */ | |
1027 | ||
1028 | static int | |
dc810e39 | 1029 | vms_generic_stat_arch_elt (abfd, st) |
252b5132 | 1030 | bfd *abfd; |
dc810e39 | 1031 | struct stat *st; |
252b5132 RH |
1032 | { |
1033 | #if VMS_DEBUG | |
dc810e39 | 1034 | vms_debug (1, "vms_generic_stat_arch_elt(%p, %p)\n", abfd, st); |
252b5132 | 1035 | #endif |
dc810e39 | 1036 | return bfd_generic_stat_arch_elt (abfd, st); |
252b5132 RH |
1037 | } |
1038 | ||
252b5132 RH |
1039 | /* This is a new function in bfd 2.5 */ |
1040 | ||
b34976b6 | 1041 | static bfd_boolean |
252b5132 | 1042 | vms_update_armap_timestamp (abfd) |
5f771d47 | 1043 | bfd *abfd ATTRIBUTE_UNUSED; |
252b5132 RH |
1044 | { |
1045 | #if VMS_DEBUG | |
1046 | vms_debug (1, "vms_update_armap_timestamp(%p)\n", abfd); | |
1047 | #endif | |
b34976b6 | 1048 | return TRUE; |
252b5132 RH |
1049 | } |
1050 | ||
1051 | /*-- Part 4.5, symbols --------------------------------------------------------*/ | |
1052 | ||
1053 | /* Return the number of bytes required to store a vector of pointers | |
1054 | to asymbols for all the symbols in the BFD abfd, including a | |
1055 | terminal NULL pointer. If there are no symbols in the BFD, | |
1056 | then return 0. If an error occurs, return -1. */ | |
1057 | ||
1058 | static long | |
1059 | vms_get_symtab_upper_bound (abfd) | |
1060 | bfd *abfd; | |
1061 | { | |
1062 | #if VMS_DEBUG | |
8a0c27cd | 1063 | vms_debug (1, "vms_get_symtab_upper_bound(%p), %d symbols\n", abfd, PRIV (gsd_sym_count)); |
252b5132 | 1064 | #endif |
8a0c27cd | 1065 | return (PRIV (gsd_sym_count)+1) * sizeof (asymbol *); |
252b5132 RH |
1066 | } |
1067 | ||
252b5132 RH |
1068 | /* Copy symbols from hash table to symbol vector |
1069 | ||
6cee3f79 | 1070 | called from bfd_hash_traverse in vms_canonicalize_symtab |
252b5132 RH |
1071 | init counter to 0 if entry == 0 */ |
1072 | ||
b34976b6 | 1073 | static bfd_boolean |
252b5132 RH |
1074 | copy_symbols (entry, arg) |
1075 | struct bfd_hash_entry *entry; | |
1076 | PTR arg; | |
1077 | { | |
1078 | bfd *abfd = (bfd *) arg; | |
1079 | ||
1080 | if (entry == NULL) /* init counter */ | |
8a0c27cd | 1081 | PRIV (symnum) = 0; |
252b5132 | 1082 | else /* fill vector, inc counter */ |
8a0c27cd | 1083 | PRIV (symcache)[PRIV (symnum)++] = ((vms_symbol_entry *)entry)->symbol; |
252b5132 | 1084 | |
b34976b6 | 1085 | return TRUE; |
252b5132 RH |
1086 | } |
1087 | ||
252b5132 RH |
1088 | /* Read the symbols from the BFD abfd, and fills in the vector |
1089 | location with pointers to the symbols and a trailing NULL. | |
1090 | ||
1091 | return # of symbols read */ | |
1092 | ||
1093 | static long | |
6cee3f79 | 1094 | vms_canonicalize_symtab (abfd, symbols) |
252b5132 RH |
1095 | bfd *abfd; |
1096 | asymbol **symbols; | |
1097 | { | |
1098 | #if VMS_DEBUG | |
6cee3f79 | 1099 | vms_debug (1, "vms_canonicalize_symtab(%p, <ret>)\n", abfd); |
252b5132 RH |
1100 | #endif |
1101 | ||
1102 | /* init counter */ | |
1103 | (void)copy_symbols((struct bfd_hash_entry *)0, abfd); | |
1104 | ||
1105 | /* traverse table and fill symbols vector */ | |
1106 | ||
8a0c27cd KH |
1107 | PRIV (symcache) = symbols; |
1108 | bfd_hash_traverse(PRIV (vms_symbol_table), copy_symbols, (PTR)abfd); | |
252b5132 | 1109 | |
8a0c27cd | 1110 | symbols[PRIV (gsd_sym_count)] = NULL; |
252b5132 | 1111 | |
8a0c27cd | 1112 | return PRIV (gsd_sym_count); |
252b5132 RH |
1113 | } |
1114 | ||
252b5132 RH |
1115 | /* Print symbol to file according to how. how is one of |
1116 | bfd_print_symbol_name just print the name | |
1117 | bfd_print_symbol_more print more (???) | |
1118 | bfd_print_symbol_all print all we know, which is not much right now :-) */ | |
1119 | ||
1120 | static void | |
1121 | vms_print_symbol (abfd, file, symbol, how) | |
60b89a18 | 1122 | bfd *abfd; |
252b5132 RH |
1123 | PTR file; |
1124 | asymbol *symbol; | |
1125 | bfd_print_symbol_type how; | |
1126 | { | |
1127 | #if VMS_DEBUG | |
1128 | vms_debug (1, "vms_print_symbol(%p, %p, %p, %d)\n", abfd, file, symbol, how); | |
1129 | #endif | |
1130 | ||
1131 | switch (how) | |
1132 | { | |
1133 | case bfd_print_symbol_name: | |
1134 | case bfd_print_symbol_more: | |
55f2d5ed | 1135 | fprintf ((FILE *)file," %s", symbol->name); |
252b5132 RH |
1136 | break; |
1137 | ||
252b5132 RH |
1138 | case bfd_print_symbol_all: |
1139 | { | |
dc810e39 | 1140 | const char *section_name = symbol->section->name; |
252b5132 | 1141 | |
60b89a18 | 1142 | bfd_print_symbol_vandf (abfd, (PTR)file, symbol); |
252b5132 | 1143 | |
55f2d5ed | 1144 | fprintf ((FILE *)file," %-8s %s", section_name, symbol->name); |
252b5132 RH |
1145 | } |
1146 | break; | |
1147 | } | |
1148 | return; | |
1149 | } | |
1150 | ||
252b5132 RH |
1151 | /* Return information about symbol in ret. |
1152 | ||
1153 | fill type, value and name | |
1154 | type: | |
1155 | A absolute | |
1156 | B bss segment symbol | |
1157 | C common symbol | |
1158 | D data segment symbol | |
1159 | f filename | |
1160 | t a static function symbol | |
1161 | T text segment symbol | |
1162 | U undefined | |
1163 | - debug */ | |
1164 | ||
1165 | static void | |
1166 | vms_get_symbol_info (abfd, symbol, ret) | |
5f771d47 | 1167 | bfd *abfd ATTRIBUTE_UNUSED; |
252b5132 RH |
1168 | asymbol *symbol; |
1169 | symbol_info *ret; | |
1170 | { | |
1171 | asection *sec; | |
1172 | ||
1173 | #if VMS_DEBUG | |
1174 | vms_debug (1, "vms_get_symbol_info(%p, %p, %p)\n", abfd, symbol, ret); | |
1175 | #endif | |
1176 | ||
1177 | sec = symbol->section; | |
1178 | ||
1179 | if (ret == 0) | |
1180 | return; | |
1181 | ||
1182 | if (bfd_is_com_section (sec)) | |
1183 | ret->type = 'C'; | |
1184 | else if (bfd_is_abs_section (sec)) | |
1185 | ret->type = 'A'; | |
1186 | else if (bfd_is_und_section (sec)) | |
1187 | ret->type = 'U'; | |
1188 | else if (bfd_is_ind_section (sec)) | |
1189 | ret->type = 'I'; | |
1190 | else if (bfd_get_section_flags (abfd, sec) & SEC_CODE) | |
1191 | ret->type = 'T'; | |
1192 | else if (bfd_get_section_flags (abfd, sec) & SEC_DATA) | |
1193 | ret->type = 'D'; | |
1194 | else if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC) | |
1195 | ret->type = 'B'; | |
1196 | else | |
1197 | ret->type = '-'; | |
1198 | ||
1199 | if (ret->type != 'U') | |
1200 | ret->value = symbol->value + symbol->section->vma; | |
1201 | else | |
1202 | ret->value = 0; | |
1203 | ret->name = symbol->name; | |
1204 | ||
1205 | return; | |
1206 | } | |
1207 | ||
b34976b6 AM |
1208 | /* Return TRUE if the given symbol sym in the BFD abfd is |
1209 | a compiler generated local label, else return FALSE. */ | |
252b5132 | 1210 | |
b34976b6 | 1211 | static bfd_boolean |
252b5132 | 1212 | vms_bfd_is_local_label_name (abfd, name) |
5f771d47 | 1213 | bfd *abfd ATTRIBUTE_UNUSED; |
252b5132 RH |
1214 | const char *name; |
1215 | { | |
1216 | #if VMS_DEBUG | |
1217 | vms_debug (1, "vms_bfd_is_local_label_name(%p, %s)\n", abfd, name); | |
1218 | #endif | |
1219 | return name[0] == '$'; | |
1220 | } | |
1221 | ||
252b5132 RH |
1222 | /* Get source line number for symbol */ |
1223 | ||
1224 | static alent * | |
1225 | vms_get_lineno (abfd, symbol) | |
5f771d47 ILT |
1226 | bfd *abfd ATTRIBUTE_UNUSED; |
1227 | asymbol *symbol ATTRIBUTE_UNUSED; | |
252b5132 RH |
1228 | { |
1229 | #if VMS_DEBUG | |
1230 | vms_debug (1, "vms_get_lineno(%p, %p)\n", abfd, symbol); | |
1231 | #endif | |
1232 | return 0; | |
1233 | } | |
1234 | ||
252b5132 RH |
1235 | /* Provided a BFD, a section and an offset into the section, calculate and |
1236 | return the name of the source file and the line nearest to the wanted | |
1237 | location. */ | |
1238 | ||
b34976b6 | 1239 | static bfd_boolean |
252b5132 | 1240 | vms_find_nearest_line (abfd, section, symbols, offset, file, func, line) |
5f771d47 ILT |
1241 | bfd *abfd ATTRIBUTE_UNUSED; |
1242 | asection *section ATTRIBUTE_UNUSED; | |
1243 | asymbol **symbols ATTRIBUTE_UNUSED; | |
1244 | bfd_vma offset ATTRIBUTE_UNUSED; | |
dc810e39 AM |
1245 | const char **file ATTRIBUTE_UNUSED; |
1246 | const char **func ATTRIBUTE_UNUSED; | |
5f771d47 | 1247 | unsigned int *line ATTRIBUTE_UNUSED; |
252b5132 RH |
1248 | { |
1249 | #if VMS_DEBUG | |
1250 | vms_debug (1, "vms_find_nearest_line(%p, %s, %p, %ld, <ret>, <ret>, <ret>)\n", | |
1251 | abfd, section->name, symbols, (long int)offset); | |
1252 | #endif | |
b34976b6 | 1253 | return FALSE; |
252b5132 RH |
1254 | } |
1255 | ||
252b5132 RH |
1256 | /* Back-door to allow format-aware applications to create debug symbols |
1257 | while using BFD for everything else. Currently used by the assembler | |
1258 | when creating COFF files. */ | |
1259 | ||
1260 | static asymbol * | |
1261 | vms_bfd_make_debug_symbol (abfd, ptr, size) | |
5f771d47 ILT |
1262 | bfd *abfd ATTRIBUTE_UNUSED; |
1263 | void *ptr ATTRIBUTE_UNUSED; | |
1264 | unsigned long size ATTRIBUTE_UNUSED; | |
252b5132 RH |
1265 | { |
1266 | #if VMS_DEBUG | |
1267 | vms_debug (1, "vms_bfd_make_debug_symbol(%p, %p, %ld)\n", abfd, ptr, size); | |
1268 | #endif | |
1269 | return 0; | |
1270 | } | |
1271 | ||
252b5132 RH |
1272 | /* Read minisymbols. For minisymbols, we use the unmodified a.out |
1273 | symbols. The minisymbol_to_symbol function translates these into | |
1274 | BFD asymbol structures. */ | |
1275 | ||
1276 | static long | |
1277 | vms_read_minisymbols (abfd, dynamic, minisymsp, sizep) | |
1278 | bfd *abfd; | |
b34976b6 | 1279 | bfd_boolean dynamic; |
252b5132 RH |
1280 | PTR *minisymsp; |
1281 | unsigned int *sizep; | |
1282 | { | |
1283 | #if VMS_DEBUG | |
1284 | vms_debug (1, "vms_read_minisymbols(%p, %d, %p, %d)\n", abfd, dynamic, minisymsp, *sizep); | |
1285 | #endif | |
1286 | return _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep); | |
1287 | } | |
1288 | ||
1289 | /* Convert a minisymbol to a BFD asymbol. A minisymbol is just an | |
1290 | unmodified a.out symbol. The SYM argument is a structure returned | |
1291 | by bfd_make_empty_symbol, which we fill in here. */ | |
1292 | ||
1293 | static asymbol * | |
1294 | vms_minisymbol_to_symbol (abfd, dynamic, minisym, sym) | |
1295 | bfd *abfd; | |
b34976b6 | 1296 | bfd_boolean dynamic; |
252b5132 RH |
1297 | const PTR minisym; |
1298 | asymbol *sym; | |
1299 | { | |
1300 | #if VMS_DEBUG | |
1301 | vms_debug (1, "vms_minisymbol_to_symbol(%p, %d, %p, %p)\n", abfd, dynamic, minisym, sym); | |
1302 | #endif | |
1303 | return _bfd_generic_minisymbol_to_symbol (abfd, dynamic, minisym, sym); | |
1304 | } | |
1305 | ||
1306 | /*-- Part 4.6, relocations --------------------------------------------------*/ | |
1307 | ||
1308 | /* Return the number of bytes required to store the relocation information | |
1309 | associated with section sect attached to bfd abfd. | |
1310 | If an error occurs, return -1. */ | |
1311 | ||
1312 | static long | |
1313 | vms_get_reloc_upper_bound (abfd, section) | |
5f771d47 ILT |
1314 | bfd *abfd ATTRIBUTE_UNUSED; |
1315 | asection *section ATTRIBUTE_UNUSED; | |
252b5132 RH |
1316 | { |
1317 | #if VMS_DEBUG | |
1318 | vms_debug (1, "vms_get_reloc_upper_bound(%p, %s)\n", abfd, section->name); | |
1319 | #endif | |
1320 | return -1L; | |
1321 | } | |
1322 | ||
252b5132 RH |
1323 | /* Call the back end associated with the open BFD abfd and translate the |
1324 | external form of the relocation information attached to sec into the | |
1325 | internal canonical form. Place the table into memory at loc, which has | |
1326 | been preallocated, usually by a call to bfd_get_reloc_upper_bound. | |
1327 | Returns the number of relocs, or -1 on error. */ | |
1328 | ||
1329 | static long | |
1330 | vms_canonicalize_reloc (abfd, section, location, symbols) | |
5f771d47 ILT |
1331 | bfd *abfd ATTRIBUTE_UNUSED; |
1332 | asection *section ATTRIBUTE_UNUSED; | |
1333 | arelent **location ATTRIBUTE_UNUSED; | |
1334 | asymbol **symbols ATTRIBUTE_UNUSED; | |
252b5132 RH |
1335 | { |
1336 | #if VMS_DEBUG | |
1337 | vms_debug (1, "vms_canonicalize_reloc(%p, %s, <ret>, <ret>)\n", abfd, section->name); | |
1338 | #endif | |
b34976b6 | 1339 | return FALSE; |
252b5132 RH |
1340 | } |
1341 | ||
1342 | /*---------------------------------------------------------------------------*/ | |
1343 | /* this is just copied from ecoff-alpha, needs to be fixed probably */ | |
1344 | ||
1345 | /* How to process the various reloc types. */ | |
1346 | ||
1347 | static bfd_reloc_status_type | |
1348 | reloc_nil (abfd, reloc, sym, data, sec, output_bfd, error_message) | |
5f771d47 ILT |
1349 | bfd *abfd ATTRIBUTE_UNUSED; |
1350 | arelent *reloc ATTRIBUTE_UNUSED; | |
1351 | asymbol *sym ATTRIBUTE_UNUSED; | |
1352 | PTR data ATTRIBUTE_UNUSED; | |
1353 | asection *sec ATTRIBUTE_UNUSED; | |
1354 | bfd *output_bfd ATTRIBUTE_UNUSED; | |
1355 | char **error_message ATTRIBUTE_UNUSED; | |
252b5132 RH |
1356 | { |
1357 | #if VMS_DEBUG | |
1358 | vms_debug (1, "reloc_nil(abfd %p, output_bfd %p)\n", abfd, output_bfd); | |
1359 | vms_debug (2, "In section %s, symbol %s\n", | |
1360 | sec->name, sym->name); | |
1361 | vms_debug (2, "reloc sym %s, addr %08lx, addend %08lx, reloc is a %s\n", | |
1362 | reloc->sym_ptr_ptr[0]->name, | |
1363 | (unsigned long)reloc->address, | |
1364 | (unsigned long)reloc->addend, reloc->howto->name); | |
1365 | vms_debug (2, "data at %p\n", data); | |
1366 | /* _bfd_hexdump (2, data, bfd_get_reloc_size(reloc->howto),0); */ | |
1367 | #endif | |
1368 | ||
1369 | return bfd_reloc_ok; | |
1370 | } | |
1371 | ||
1372 | /* In case we're on a 32-bit machine, construct a 64-bit "-1" value | |
1373 | from smaller values. Start with zero, widen, *then* decrement. */ | |
1374 | #define MINUS_ONE (((bfd_vma)0) - 1) | |
1375 | ||
1376 | static reloc_howto_type alpha_howto_table[] = | |
1377 | { | |
1378 | HOWTO (ALPHA_R_IGNORE, /* type */ | |
1379 | 0, /* rightshift */ | |
1380 | 0, /* size (0 = byte, 1 = short, 2 = long) */ | |
1381 | 8, /* bitsize */ | |
b34976b6 | 1382 | TRUE, /* pc_relative */ |
252b5132 RH |
1383 | 0, /* bitpos */ |
1384 | complain_overflow_dont, /* complain_on_overflow */ | |
1385 | reloc_nil, /* special_function */ | |
1386 | "IGNORE", /* name */ | |
b34976b6 | 1387 | TRUE, /* partial_inplace */ |
252b5132 RH |
1388 | 0, /* src_mask */ |
1389 | 0, /* dst_mask */ | |
b34976b6 | 1390 | TRUE), /* pcrel_offset */ |
252b5132 RH |
1391 | |
1392 | /* A 64 bit reference to a symbol. */ | |
1393 | HOWTO (ALPHA_R_REFQUAD, /* type */ | |
1394 | 0, /* rightshift */ | |
1395 | 4, /* size (0 = byte, 1 = short, 2 = long) */ | |
1396 | 64, /* bitsize */ | |
b34976b6 | 1397 | FALSE, /* pc_relative */ |
252b5132 RH |
1398 | 0, /* bitpos */ |
1399 | complain_overflow_bitfield, /* complain_on_overflow */ | |
1400 | reloc_nil, /* special_function */ | |
1401 | "REFQUAD", /* name */ | |
b34976b6 | 1402 | TRUE, /* partial_inplace */ |
252b5132 RH |
1403 | MINUS_ONE, /* src_mask */ |
1404 | MINUS_ONE, /* dst_mask */ | |
b34976b6 | 1405 | FALSE), /* pcrel_offset */ |
252b5132 RH |
1406 | |
1407 | /* A 21 bit branch. The native assembler generates these for | |
1408 | branches within the text segment, and also fills in the PC | |
1409 | relative offset in the instruction. */ | |
1410 | HOWTO (ALPHA_R_BRADDR, /* type */ | |
1411 | 2, /* rightshift */ | |
1412 | 2, /* size (0 = byte, 1 = short, 2 = long) */ | |
1413 | 21, /* bitsize */ | |
b34976b6 | 1414 | TRUE, /* pc_relative */ |
252b5132 RH |
1415 | 0, /* bitpos */ |
1416 | complain_overflow_signed, /* complain_on_overflow */ | |
1417 | reloc_nil, /* special_function */ | |
1418 | "BRADDR", /* name */ | |
b34976b6 | 1419 | TRUE, /* partial_inplace */ |
252b5132 RH |
1420 | 0x1fffff, /* src_mask */ |
1421 | 0x1fffff, /* dst_mask */ | |
b34976b6 | 1422 | FALSE), /* pcrel_offset */ |
252b5132 RH |
1423 | |
1424 | /* A hint for a jump to a register. */ | |
1425 | HOWTO (ALPHA_R_HINT, /* type */ | |
1426 | 2, /* rightshift */ | |
1427 | 1, /* size (0 = byte, 1 = short, 2 = long) */ | |
1428 | 14, /* bitsize */ | |
b34976b6 | 1429 | TRUE, /* pc_relative */ |
252b5132 RH |
1430 | 0, /* bitpos */ |
1431 | complain_overflow_dont, /* complain_on_overflow */ | |
1432 | reloc_nil, /* special_function */ | |
1433 | "HINT", /* name */ | |
b34976b6 | 1434 | TRUE, /* partial_inplace */ |
252b5132 RH |
1435 | 0x3fff, /* src_mask */ |
1436 | 0x3fff, /* dst_mask */ | |
b34976b6 | 1437 | FALSE), /* pcrel_offset */ |
252b5132 RH |
1438 | |
1439 | /* 16 bit PC relative offset. */ | |
1440 | HOWTO (ALPHA_R_SREL16, /* type */ | |
1441 | 0, /* rightshift */ | |
1442 | 1, /* size (0 = byte, 1 = short, 2 = long) */ | |
1443 | 16, /* bitsize */ | |
b34976b6 | 1444 | TRUE, /* pc_relative */ |
252b5132 RH |
1445 | 0, /* bitpos */ |
1446 | complain_overflow_signed, /* complain_on_overflow */ | |
1447 | reloc_nil, /* special_function */ | |
1448 | "SREL16", /* name */ | |
b34976b6 | 1449 | TRUE, /* partial_inplace */ |
252b5132 RH |
1450 | 0xffff, /* src_mask */ |
1451 | 0xffff, /* dst_mask */ | |
b34976b6 | 1452 | FALSE), /* pcrel_offset */ |
252b5132 RH |
1453 | |
1454 | /* 32 bit PC relative offset. */ | |
1455 | HOWTO (ALPHA_R_SREL32, /* type */ | |
1456 | 0, /* rightshift */ | |
1457 | 2, /* size (0 = byte, 1 = short, 2 = long) */ | |
1458 | 32, /* bitsize */ | |
b34976b6 | 1459 | TRUE, /* pc_relative */ |
252b5132 RH |
1460 | 0, /* bitpos */ |
1461 | complain_overflow_signed, /* complain_on_overflow */ | |
1462 | reloc_nil, /* special_function */ | |
1463 | "SREL32", /* name */ | |
b34976b6 | 1464 | TRUE, /* partial_inplace */ |
252b5132 RH |
1465 | 0xffffffff, /* src_mask */ |
1466 | 0xffffffff, /* dst_mask */ | |
b34976b6 | 1467 | FALSE), /* pcrel_offset */ |
252b5132 RH |
1468 | |
1469 | /* A 64 bit PC relative offset. */ | |
1470 | HOWTO (ALPHA_R_SREL64, /* type */ | |
1471 | 0, /* rightshift */ | |
1472 | 4, /* size (0 = byte, 1 = short, 2 = long) */ | |
1473 | 64, /* bitsize */ | |
b34976b6 | 1474 | TRUE, /* pc_relative */ |
252b5132 RH |
1475 | 0, /* bitpos */ |
1476 | complain_overflow_signed, /* complain_on_overflow */ | |
1477 | reloc_nil, /* special_function */ | |
1478 | "SREL64", /* name */ | |
b34976b6 | 1479 | TRUE, /* partial_inplace */ |
252b5132 RH |
1480 | MINUS_ONE, /* src_mask */ |
1481 | MINUS_ONE, /* dst_mask */ | |
b34976b6 | 1482 | FALSE), /* pcrel_offset */ |
252b5132 RH |
1483 | |
1484 | /* Push a value on the reloc evaluation stack. */ | |
1485 | HOWTO (ALPHA_R_OP_PUSH, /* type */ | |
1486 | 0, /* rightshift */ | |
1487 | 0, /* size (0 = byte, 1 = short, 2 = long) */ | |
1488 | 0, /* bitsize */ | |
b34976b6 | 1489 | FALSE, /* pc_relative */ |
252b5132 RH |
1490 | 0, /* bitpos */ |
1491 | complain_overflow_dont, /* complain_on_overflow */ | |
1492 | reloc_nil, /* special_function */ | |
1493 | "OP_PUSH", /* name */ | |
b34976b6 | 1494 | FALSE, /* partial_inplace */ |
252b5132 RH |
1495 | 0, /* src_mask */ |
1496 | 0, /* dst_mask */ | |
b34976b6 | 1497 | FALSE), /* pcrel_offset */ |
252b5132 RH |
1498 | |
1499 | /* Store the value from the stack at the given address. Store it in | |
1500 | a bitfield of size r_size starting at bit position r_offset. */ | |
1501 | HOWTO (ALPHA_R_OP_STORE, /* type */ | |
1502 | 0, /* rightshift */ | |
1503 | 4, /* size (0 = byte, 1 = short, 2 = long) */ | |
1504 | 64, /* bitsize */ | |
b34976b6 | 1505 | FALSE, /* pc_relative */ |
252b5132 RH |
1506 | 0, /* bitpos */ |
1507 | complain_overflow_dont, /* complain_on_overflow */ | |
1508 | reloc_nil, /* special_function */ | |
1509 | "OP_STORE", /* name */ | |
b34976b6 | 1510 | FALSE, /* partial_inplace */ |
252b5132 RH |
1511 | 0, /* src_mask */ |
1512 | MINUS_ONE, /* dst_mask */ | |
b34976b6 | 1513 | FALSE), /* pcrel_offset */ |
252b5132 RH |
1514 | |
1515 | /* Subtract the reloc address from the value on the top of the | |
1516 | relocation stack. */ | |
1517 | HOWTO (ALPHA_R_OP_PSUB, /* type */ | |
1518 | 0, /* rightshift */ | |
1519 | 0, /* size (0 = byte, 1 = short, 2 = long) */ | |
1520 | 0, /* bitsize */ | |
b34976b6 | 1521 | FALSE, /* pc_relative */ |
252b5132 RH |
1522 | 0, /* bitpos */ |
1523 | complain_overflow_dont, /* complain_on_overflow */ | |
1524 | reloc_nil, /* special_function */ | |
1525 | "OP_PSUB", /* name */ | |
b34976b6 | 1526 | FALSE, /* partial_inplace */ |
252b5132 RH |
1527 | 0, /* src_mask */ |
1528 | 0, /* dst_mask */ | |
b34976b6 | 1529 | FALSE), /* pcrel_offset */ |
252b5132 RH |
1530 | |
1531 | /* Shift the value on the top of the relocation stack right by the | |
1532 | given value. */ | |
1533 | HOWTO (ALPHA_R_OP_PRSHIFT, /* type */ | |
1534 | 0, /* rightshift */ | |
1535 | 0, /* size (0 = byte, 1 = short, 2 = long) */ | |
1536 | 0, /* bitsize */ | |
b34976b6 | 1537 | FALSE, /* pc_relative */ |
252b5132 RH |
1538 | 0, /* bitpos */ |
1539 | complain_overflow_dont, /* complain_on_overflow */ | |
1540 | reloc_nil, /* special_function */ | |
1541 | "OP_PRSHIFT", /* name */ | |
b34976b6 | 1542 | FALSE, /* partial_inplace */ |
252b5132 RH |
1543 | 0, /* src_mask */ |
1544 | 0, /* dst_mask */ | |
b34976b6 | 1545 | FALSE), /* pcrel_offset */ |
252b5132 RH |
1546 | |
1547 | /* Hack. Linkage is done by linker. */ | |
1548 | HOWTO (ALPHA_R_LINKAGE, /* type */ | |
1549 | 0, /* rightshift */ | |
1550 | 8, /* size (0 = byte, 1 = short, 2 = long) */ | |
1551 | 256, /* bitsize */ | |
b34976b6 | 1552 | FALSE, /* pc_relative */ |
252b5132 RH |
1553 | 0, /* bitpos */ |
1554 | complain_overflow_dont, /* complain_on_overflow */ | |
1555 | reloc_nil, /* special_function */ | |
1556 | "LINKAGE", /* name */ | |
b34976b6 | 1557 | FALSE, /* partial_inplace */ |
252b5132 RH |
1558 | 0, /* src_mask */ |
1559 | 0, /* dst_mask */ | |
b34976b6 | 1560 | FALSE), /* pcrel_offset */ |
252b5132 RH |
1561 | |
1562 | /* A 32 bit reference to a symbol. */ | |
1563 | HOWTO (ALPHA_R_REFLONG, /* type */ | |
1564 | 0, /* rightshift */ | |
1565 | 2, /* size (0 = byte, 1 = short, 2 = long) */ | |
1566 | 32, /* bitsize */ | |
b34976b6 | 1567 | FALSE, /* pc_relative */ |
252b5132 RH |
1568 | 0, /* bitpos */ |
1569 | complain_overflow_bitfield, /* complain_on_overflow */ | |
1570 | reloc_nil, /* special_function */ | |
1571 | "REFLONG", /* name */ | |
b34976b6 | 1572 | TRUE, /* partial_inplace */ |
252b5132 RH |
1573 | 0xffffffff, /* src_mask */ |
1574 | 0xffffffff, /* dst_mask */ | |
b34976b6 | 1575 | FALSE), /* pcrel_offset */ |
252b5132 RH |
1576 | |
1577 | /* A 64 bit reference to a procedure, written as 32 bit value. */ | |
1578 | HOWTO (ALPHA_R_CODEADDR, /* type */ | |
1579 | 0, /* rightshift */ | |
1580 | 4, /* size (0 = byte, 1 = short, 2 = long) */ | |
1581 | 64, /* bitsize */ | |
b34976b6 | 1582 | FALSE, /* pc_relative */ |
252b5132 RH |
1583 | 0, /* bitpos */ |
1584 | complain_overflow_signed,/* complain_on_overflow */ | |
1585 | reloc_nil, /* special_function */ | |
1586 | "CODEADDR", /* name */ | |
b34976b6 | 1587 | FALSE, /* partial_inplace */ |
252b5132 RH |
1588 | 0xffffffff, /* src_mask */ |
1589 | 0xffffffff, /* dst_mask */ | |
b34976b6 | 1590 | FALSE), /* pcrel_offset */ |
252b5132 RH |
1591 | |
1592 | }; | |
1593 | ||
1594 | /* Return a pointer to a howto structure which, when invoked, will perform | |
1595 | the relocation code on data from the architecture noted. */ | |
1596 | ||
1597 | static const struct reloc_howto_struct * | |
1598 | vms_bfd_reloc_type_lookup (abfd, code) | |
5f771d47 | 1599 | bfd *abfd ATTRIBUTE_UNUSED; |
252b5132 RH |
1600 | bfd_reloc_code_real_type code; |
1601 | { | |
1602 | int alpha_type; | |
1603 | ||
1604 | #if VMS_DEBUG | |
1605 | vms_debug (1, "vms_bfd_reloc_type_lookup(%p, %d)\t", abfd, code); | |
1606 | #endif | |
1607 | ||
1608 | switch (code) | |
1609 | { | |
1610 | case BFD_RELOC_16: alpha_type = ALPHA_R_SREL16; break; | |
1611 | case BFD_RELOC_32: alpha_type = ALPHA_R_REFLONG; break; | |
1612 | case BFD_RELOC_64: alpha_type = ALPHA_R_REFQUAD; break; | |
1613 | case BFD_RELOC_CTOR: alpha_type = ALPHA_R_REFQUAD; break; | |
1614 | case BFD_RELOC_23_PCREL_S2: alpha_type = ALPHA_R_BRADDR; break; | |
1615 | case BFD_RELOC_ALPHA_HINT: alpha_type = ALPHA_R_HINT; break; | |
1616 | case BFD_RELOC_16_PCREL: alpha_type = ALPHA_R_SREL16; break; | |
1617 | case BFD_RELOC_32_PCREL: alpha_type = ALPHA_R_SREL32; break; | |
1618 | case BFD_RELOC_64_PCREL: alpha_type = ALPHA_R_SREL64; break; | |
1619 | case BFD_RELOC_ALPHA_LINKAGE: alpha_type = ALPHA_R_LINKAGE; break; | |
1620 | case BFD_RELOC_ALPHA_CODEADDR: alpha_type = ALPHA_R_CODEADDR; break; | |
1621 | default: | |
1622 | (*_bfd_error_handler) ("reloc (%d) is *UNKNOWN*", code); | |
1623 | return (const struct reloc_howto_struct *) NULL; | |
1624 | } | |
1625 | #if VMS_DEBUG | |
1626 | vms_debug (2, "reloc is %s\n", alpha_howto_table[alpha_type].name); | |
1627 | #endif | |
1628 | return &alpha_howto_table[alpha_type]; | |
1629 | } | |
1630 | ||
252b5132 RH |
1631 | /*-- Part 4.7, writing an object file ---------------------------------------*/ |
1632 | ||
1633 | /* Set the architecture and machine type in BFD abfd to arch and mach. | |
1634 | Find the correct pointer to a structure and insert it into the arch_info | |
1635 | pointer. */ | |
1636 | ||
b34976b6 | 1637 | static bfd_boolean |
252b5132 RH |
1638 | vms_set_arch_mach (abfd, arch, mach) |
1639 | bfd *abfd; | |
5f771d47 ILT |
1640 | enum bfd_architecture arch ATTRIBUTE_UNUSED; |
1641 | unsigned long mach ATTRIBUTE_UNUSED; | |
252b5132 RH |
1642 | { |
1643 | #if VMS_DEBUG | |
1644 | vms_debug (1, "vms_set_arch_mach(%p, %d, %ld)\n", abfd, arch, mach); | |
1645 | #endif | |
1646 | abfd->arch_info = bfd_scan_arch("alpha"); | |
1647 | ||
b34976b6 | 1648 | return TRUE; |
252b5132 RH |
1649 | } |
1650 | ||
252b5132 RH |
1651 | /* Sets the contents of the section section in BFD abfd to the data starting |
1652 | in memory at data. The data is written to the output section starting at | |
1653 | offset offset for count bytes. | |
1654 | ||
b34976b6 | 1655 | Normally TRUE is returned, else FALSE. Possible error returns are: |
252b5132 RH |
1656 | o bfd_error_no_contents - The output section does not have the |
1657 | SEC_HAS_CONTENTS attribute, so nothing can be written to it. | |
1658 | o and some more too */ | |
1659 | ||
b34976b6 | 1660 | static bfd_boolean |
252b5132 RH |
1661 | vms_set_section_contents (abfd, section, location, offset, count) |
1662 | bfd *abfd; | |
1663 | asection *section; | |
0f867abe | 1664 | const PTR location; |
252b5132 RH |
1665 | file_ptr offset; |
1666 | bfd_size_type count; | |
1667 | { | |
1668 | #if VMS_DEBUG | |
1669 | vms_debug (1, "vms_set_section_contents(%p, sec %s, loc %p, off %ld, count %d)\n", | |
1670 | abfd, section->name, location, (long int)offset, (int)count); | |
1671 | vms_debug (2, "secraw %d, seccooked %d\n", (int)section->_raw_size, (int)section->_cooked_size); | |
1672 | #endif | |
1673 | return _bfd_save_vms_section(abfd, section, location, offset, count); | |
1674 | } | |
1675 | ||
252b5132 RH |
1676 | /*-- Part 4.8, linker -------------------------------------------------------*/ |
1677 | ||
1678 | /* Get the size of the section headers. */ | |
1679 | ||
1680 | static int | |
1681 | vms_sizeof_headers (abfd, reloc) | |
5f771d47 | 1682 | bfd *abfd ATTRIBUTE_UNUSED; |
b34976b6 | 1683 | bfd_boolean reloc ATTRIBUTE_UNUSED; |
252b5132 RH |
1684 | { |
1685 | #if VMS_DEBUG | |
1686 | vms_debug (1, "vms_sizeof_headers(%p, %s)\n", abfd, (reloc)?"True":"False"); | |
1687 | #endif | |
1688 | return 0; | |
1689 | } | |
1690 | ||
252b5132 RH |
1691 | /* Provides default handling of relocation effort for back ends |
1692 | which can't be bothered to do it efficiently. */ | |
1693 | ||
1694 | static bfd_byte * | |
1695 | vms_bfd_get_relocated_section_contents (abfd, link_info, link_order, data, | |
1049f94e | 1696 | relocatable, symbols) |
5f771d47 ILT |
1697 | bfd *abfd ATTRIBUTE_UNUSED; |
1698 | struct bfd_link_info *link_info ATTRIBUTE_UNUSED; | |
1699 | struct bfd_link_order *link_order ATTRIBUTE_UNUSED; | |
1700 | bfd_byte *data ATTRIBUTE_UNUSED; | |
1049f94e | 1701 | bfd_boolean relocatable ATTRIBUTE_UNUSED; |
5f771d47 | 1702 | asymbol **symbols ATTRIBUTE_UNUSED; |
252b5132 RH |
1703 | { |
1704 | #if VMS_DEBUG | |
1705 | vms_debug (1, "vms_bfd_get_relocated_section_contents(%p, %p, %p, %p, %s, %p)\n", | |
1049f94e | 1706 | abfd, link_info, link_order, data, (relocatable)?"True":"False", symbols); |
252b5132 RH |
1707 | #endif |
1708 | return 0; | |
1709 | } | |
1710 | ||
252b5132 RH |
1711 | /* ??? */ |
1712 | ||
b34976b6 | 1713 | static bfd_boolean |
252b5132 | 1714 | vms_bfd_relax_section (abfd, section, link_info, again) |
5f771d47 ILT |
1715 | bfd *abfd ATTRIBUTE_UNUSED; |
1716 | asection *section ATTRIBUTE_UNUSED; | |
1717 | struct bfd_link_info *link_info ATTRIBUTE_UNUSED; | |
b34976b6 | 1718 | bfd_boolean *again ATTRIBUTE_UNUSED; |
252b5132 RH |
1719 | { |
1720 | #if VMS_DEBUG | |
1721 | vms_debug (1, "vms_bfd_relax_section(%p, %s, %p, <ret>)\n", | |
1722 | abfd, section->name, link_info); | |
1723 | #endif | |
b34976b6 | 1724 | return TRUE; |
252b5132 RH |
1725 | } |
1726 | ||
b34976b6 | 1727 | static bfd_boolean |
252b5132 | 1728 | vms_bfd_gc_sections (abfd, link_info) |
5f771d47 ILT |
1729 | bfd *abfd ATTRIBUTE_UNUSED; |
1730 | struct bfd_link_info *link_info ATTRIBUTE_UNUSED; | |
252b5132 RH |
1731 | { |
1732 | #if VMS_DEBUG | |
1733 | vms_debug (1, "vms_bfd_gc_sections(%p, %p)\n", abfd, link_info); | |
1734 | #endif | |
b34976b6 | 1735 | return TRUE; |
252b5132 RH |
1736 | } |
1737 | ||
b34976b6 | 1738 | static bfd_boolean |
8550eb6e JJ |
1739 | vms_bfd_merge_sections (abfd, link_info) |
1740 | bfd *abfd ATTRIBUTE_UNUSED; | |
1741 | struct bfd_link_info *link_info ATTRIBUTE_UNUSED; | |
1742 | { | |
1743 | #if VMS_DEBUG | |
1744 | vms_debug (1, "vms_bfd_merge_sections(%p, %p)\n", abfd, link_info); | |
1745 | #endif | |
b34976b6 | 1746 | return TRUE; |
8550eb6e JJ |
1747 | } |
1748 | ||
252b5132 RH |
1749 | /* Create a hash table for the linker. Different backends store |
1750 | different information in this table. */ | |
1751 | ||
1752 | static struct bfd_link_hash_table * | |
1753 | vms_bfd_link_hash_table_create (abfd) | |
5f771d47 | 1754 | bfd *abfd ATTRIBUTE_UNUSED; |
252b5132 RH |
1755 | { |
1756 | #if VMS_DEBUG | |
1757 | vms_debug (1, "vms_bfd_link_hash_table_create(%p)\n", abfd); | |
1758 | #endif | |
1759 | return 0; | |
1760 | } | |
1761 | ||
e2d34d7d DJ |
1762 | /* Free a linker hash table. */ |
1763 | ||
1764 | static void | |
1765 | vms_bfd_link_hash_table_free (hash) | |
1766 | struct bfd_link_hash_table *hash ATTRIBUTE_UNUSED; | |
1767 | { | |
1768 | #if VMS_DEBUG | |
1769 | vms_debug (1, "vms_bfd_link_hash_table_free(%p)\n", abfd); | |
1770 | #endif | |
1771 | } | |
1772 | ||
252b5132 RH |
1773 | /* Add symbols from this object file into the hash table. */ |
1774 | ||
b34976b6 | 1775 | static bfd_boolean |
252b5132 | 1776 | vms_bfd_link_add_symbols (abfd, link_info) |
5f771d47 ILT |
1777 | bfd *abfd ATTRIBUTE_UNUSED; |
1778 | struct bfd_link_info *link_info ATTRIBUTE_UNUSED; | |
252b5132 RH |
1779 | { |
1780 | #if VMS_DEBUG | |
1781 | vms_debug (1, "vms_bfd_link_add_symbols(%p, %p)\n", abfd, link_info); | |
1782 | #endif | |
b34976b6 | 1783 | return FALSE; |
252b5132 RH |
1784 | } |
1785 | ||
252b5132 RH |
1786 | /* Do a link based on the link_order structures attached to each |
1787 | section of the BFD. */ | |
1788 | ||
b34976b6 | 1789 | static bfd_boolean |
252b5132 | 1790 | vms_bfd_final_link (abfd, link_info) |
5f771d47 ILT |
1791 | bfd *abfd ATTRIBUTE_UNUSED; |
1792 | struct bfd_link_info *link_info ATTRIBUTE_UNUSED; | |
252b5132 RH |
1793 | { |
1794 | #if VMS_DEBUG | |
1795 | vms_debug (1, "vms_bfd_final_link(%p, %p)\n", abfd, link_info); | |
1796 | #endif | |
b34976b6 | 1797 | return TRUE; |
252b5132 RH |
1798 | } |
1799 | ||
1800 | /* Should this section be split up into smaller pieces during linking. */ | |
1801 | ||
b34976b6 | 1802 | static bfd_boolean |
252b5132 | 1803 | vms_bfd_link_split_section (abfd, section) |
5f771d47 ILT |
1804 | bfd *abfd ATTRIBUTE_UNUSED; |
1805 | asection *section ATTRIBUTE_UNUSED; | |
252b5132 RH |
1806 | { |
1807 | #if VMS_DEBUG | |
1808 | vms_debug (1, "vms_bfd_link_split_section(%p, %s)\n", abfd, section->name); | |
1809 | #endif | |
b34976b6 | 1810 | return FALSE; |
252b5132 RH |
1811 | } |
1812 | ||
1813 | /*-- Part 4.9, dynamic symbols and relocations ------------------------------*/ | |
1814 | ||
1815 | /* Get the amount of memory required to hold the dynamic symbols. */ | |
1816 | ||
1817 | static long | |
1818 | vms_get_dynamic_symtab_upper_bound (abfd) | |
5f771d47 | 1819 | bfd *abfd ATTRIBUTE_UNUSED; |
252b5132 RH |
1820 | { |
1821 | #if VMS_DEBUG | |
1822 | vms_debug (1, "vms_get_dynamic_symtab_upper_bound(%p)\n", abfd); | |
1823 | #endif | |
1824 | return 0; | |
1825 | } | |
1826 | ||
b34976b6 | 1827 | static bfd_boolean |
252b5132 | 1828 | vms_bfd_print_private_bfd_data (abfd, file) |
5f771d47 ILT |
1829 | bfd *abfd ATTRIBUTE_UNUSED; |
1830 | void *file ATTRIBUTE_UNUSED; | |
252b5132 RH |
1831 | { |
1832 | #if VMS_DEBUG | |
1833 | vms_debug (1, "vms_bfd_print_private_bfd_data(%p)\n", abfd); | |
1834 | #endif | |
1835 | return 0; | |
1836 | } | |
1837 | ||
252b5132 RH |
1838 | /* Read in the dynamic symbols. */ |
1839 | ||
1840 | static long | |
1841 | vms_canonicalize_dynamic_symtab (abfd, symbols) | |
5f771d47 ILT |
1842 | bfd *abfd ATTRIBUTE_UNUSED; |
1843 | asymbol **symbols ATTRIBUTE_UNUSED; | |
252b5132 RH |
1844 | { |
1845 | #if VMS_DEBUG | |
1846 | vms_debug (1, "vms_canonicalize_dynamic_symtab(%p, <ret>)\n", abfd); | |
1847 | #endif | |
1848 | return 0L; | |
1849 | } | |
1850 | ||
252b5132 RH |
1851 | /* Get the amount of memory required to hold the dynamic relocs. */ |
1852 | ||
1853 | static long | |
1854 | vms_get_dynamic_reloc_upper_bound (abfd) | |
5f771d47 | 1855 | bfd *abfd ATTRIBUTE_UNUSED; |
252b5132 RH |
1856 | { |
1857 | #if VMS_DEBUG | |
1858 | vms_debug (1, "vms_get_dynamic_reloc_upper_bound(%p)\n", abfd); | |
1859 | #endif | |
1860 | return 0L; | |
1861 | } | |
1862 | ||
252b5132 RH |
1863 | /* Read in the dynamic relocs. */ |
1864 | ||
1865 | static long | |
1866 | vms_canonicalize_dynamic_reloc (abfd, arel, symbols) | |
5f771d47 ILT |
1867 | bfd *abfd ATTRIBUTE_UNUSED; |
1868 | arelent **arel ATTRIBUTE_UNUSED; | |
1869 | asymbol **symbols ATTRIBUTE_UNUSED; | |
252b5132 RH |
1870 | { |
1871 | #if VMS_DEBUG | |
1872 | vms_debug (1, "vms_canonicalize_dynamic_reloc(%p)\n", abfd); | |
1873 | #endif | |
1874 | return 0L; | |
1875 | } |