1 /* vms.c -- BFD back-end for VAX (openVMS/VAX) and
2 EVAX (openVMS/Alpha) files.
3 Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 2006 Free Software Foundation, Inc.
6 Written by Klaus K"ampf (kkaempf@rmi.de)
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.
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.
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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
29 #define vms_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
30 #define vms_make_empty_symbol _bfd_generic_make_empty_symbol
31 #define vms_bfd_link_just_syms _bfd_generic_link_just_syms
32 #define vms_bfd_is_group_section bfd_generic_is_group_section
33 #define vms_bfd_discard_group bfd_generic_discard_group
34 #define vms_section_already_linked _bfd_generic_section_already_linked
35 #define vms_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
36 #define vms_get_synthetic_symtab _bfd_nodynamic_get_synthetic_symtab
38 static unsigned int priv_section_count
;
39 extern const bfd_target vms_vax_vec
;
40 extern const bfd_target vms_alpha_vec
;
42 /* Initialize private data. */
45 vms_initialize (bfd
* abfd
)
50 bfd_set_start_address (abfd
, (bfd_vma
) -1);
52 amt
= sizeof (struct vms_private_data_struct
);
53 abfd
->tdata
.any
= bfd_alloc (abfd
, amt
);
54 if (abfd
->tdata
.any
== NULL
)
58 PRIV (is_vax
) = FALSE
;
62 PRIV (vms_buf
) = NULL
;
64 PRIV (rec_length
) = 0;
65 PRIV (file_format
) = FF_UNKNOWN
;
66 PRIV (fixup_done
) = FALSE
;
67 PRIV (sections
) = NULL
;
69 amt
= sizeof (struct stack_struct
) * STACKSIZE
;
70 PRIV (stack
) = bfd_alloc (abfd
, amt
);
71 if (PRIV (stack
) == NULL
)
75 amt
= sizeof (struct bfd_hash_table
);
76 PRIV (vms_symbol_table
) = bfd_alloc (abfd
, amt
);
77 if (PRIV (vms_symbol_table
) == NULL
)
80 if (!bfd_hash_table_init (PRIV (vms_symbol_table
), _bfd_vms_hash_newfunc
,
81 sizeof (vms_symbol_entry
)))
84 amt
= sizeof (struct location_struct
) * LOCATION_SAVE_SIZE
;
85 PRIV (location_stack
) = bfd_alloc (abfd
, amt
);
86 if (PRIV (location_stack
) == NULL
)
89 for (i
= 0; i
< VMS_SECTION_COUNT
; i
++)
90 PRIV (vms_section_table
)[i
] = NULL
;
92 amt
= MAX_OUTREC_SIZE
;
93 PRIV (output_buf
) = bfd_alloc (abfd
, amt
);
94 if (PRIV (output_buf
) == NULL
)
97 PRIV (push_level
) = 0;
98 PRIV (pushed_size
) = 0;
99 PRIV (length_pos
) = 2;
100 PRIV (output_size
) = 0;
101 PRIV (output_alignment
) = 1;
106 bfd_hash_table_free (PRIV (vms_symbol_table
));
108 bfd_release (abfd
, abfd
->tdata
.any
);
109 abfd
->tdata
.any
= NULL
;
113 /* Fill symbol->section with section ptr
114 symbol->section is filled with the section index for defined symbols
115 during reading the GSD/EGSD section. But we need the pointer to the
118 It has the correct value for referenced (undefined section) symbols
120 called from bfd_hash_traverse in vms_fixup_sections. */
123 fill_section_ptr (struct bfd_hash_entry
* entry
, void * sections
)
128 sym
= ((vms_symbol_entry
*) entry
)->symbol
;
132 vms_debug (6, "fill_section_ptr: sym %p, sec %p\n", sym
, sec
);
135 /* Fill forward references (these contain section number, not section ptr). */
136 if ((unsigned int) (size_t) sec
< priv_section_count
)
137 sec
= ((vms_symbol_entry
*) entry
)->symbol
->section
=
138 ((asection
**) sections
)[(unsigned int) (size_t) sec
];
140 if (strcmp (sym
->name
, sec
->name
) == 0)
141 sym
->flags
|= BSF_SECTION_SYM
;
147 set up all pointers and arrays, counters and sizes are fixed now
149 we build a private sections vector for easy access since sections
150 are always referenced by an index number.
152 alloc PRIV(sections) according to abfd->section_count
153 copy abfd->sections to PRIV(sections). */
156 vms_fixup_sections (bfd
* abfd
)
158 if (PRIV (fixup_done
))
161 /* Traverse symbol table and fill in all section pointers. */
163 /* Can't provide section count as argument to fill_section_ptr(). */
164 priv_section_count
= PRIV (section_count
);
165 bfd_hash_traverse (PRIV (vms_symbol_table
), fill_section_ptr
, (PRIV (sections
)));
167 PRIV (fixup_done
) = TRUE
;
172 /* Check the format for a file being read.
173 Return a (bfd_target *) if it's an object file or zero if not. */
175 static const struct bfd_target
*
176 vms_object_p (bfd
* abfd
)
180 const struct bfd_target
*target_vector
= NULL
;
181 const bfd_arch_info_type
*arch
= NULL
;
182 void * tdata_save
= abfd
->tdata
.any
;
183 bfd_vma saddr_save
= bfd_get_start_address (abfd
);
186 vms_debug (1, "vms_object_p (%p)\n", abfd
);
189 if (!vms_initialize (abfd
))
192 if (bfd_seek (abfd
, (file_ptr
) 0, SEEK_SET
))
193 goto err_wrong_format
;
200 vms_debug (7, "reading at %08lx\n", bfd_tell (abfd
));
202 if (_bfd_vms_next_record (abfd
) < 0)
205 vms_debug (2, "next_record failed\n");
207 goto err_wrong_format
;
210 if ((prev_type
== EOBJ_S_C_EGSD
)
211 && (PRIV (rec_type
) != EOBJ_S_C_EGSD
))
213 if (! vms_fixup_sections (abfd
))
216 vms_debug (2, "vms_fixup_sections failed\n");
218 goto err_wrong_format
;
222 prev_type
= PRIV (rec_type
);
224 if (target_vector
== NULL
)
226 if (prev_type
<= OBJ_S_C_MAXRECTYP
)
227 target_vector
= & vms_vax_vec
;
229 target_vector
= & vms_alpha_vec
;
236 err
= _bfd_vms_slurp_hdr (abfd
, prev_type
);
241 err
= _bfd_vms_slurp_eom (abfd
, prev_type
);
245 err
= _bfd_vms_slurp_gsd (abfd
, prev_type
);
249 err
= _bfd_vms_slurp_tir (abfd
, prev_type
);
253 err
= _bfd_vms_slurp_dbg (abfd
, prev_type
);
257 err
= _bfd_vms_slurp_tbt (abfd
, prev_type
);
260 err
= _bfd_vms_slurp_lnk (abfd
, prev_type
);
268 vms_debug (2, "slurp type %d failed with %d\n", prev_type
, err
);
270 goto err_wrong_format
;
273 while ((prev_type
!= EOBJ_S_C_EEOM
) && (prev_type
!= OBJ_S_C_EOM
) && (prev_type
!= OBJ_S_C_EOMW
));
275 if (target_vector
== & vms_vax_vec
)
277 if (! vms_fixup_sections (abfd
))
280 vms_debug (2, "vms_fixup_sections failed\n");
282 goto err_wrong_format
;
285 /* Set arch_info to vax. */
287 arch
= bfd_scan_arch ("vax");
288 PRIV (is_vax
) = TRUE
;
290 vms_debug (2, "arch is vax\n");
293 else if (target_vector
== & vms_alpha_vec
)
295 /* Set arch_info to alpha. */
297 arch
= bfd_scan_arch ("alpha");
298 PRIV (is_vax
) = FALSE
;
300 vms_debug (2, "arch is alpha\n");
307 vms_debug (2, "arch not found\n");
309 goto err_wrong_format
;
311 abfd
->arch_info
= arch
;
313 return target_vector
;
316 bfd_set_error (bfd_error_wrong_format
);
318 if (abfd
->tdata
.any
!= tdata_save
&& abfd
->tdata
.any
!= NULL
)
319 bfd_release (abfd
, abfd
->tdata
.any
);
320 abfd
->tdata
.any
= tdata_save
;
321 bfd_set_start_address (abfd
, saddr_save
);
325 /* Check the format for a file being read.
326 Return a (bfd_target *) if it's an archive file or zero. */
328 static const struct bfd_target
*
329 vms_archive_p (bfd
* abfd ATTRIBUTE_UNUSED
)
332 vms_debug (1, "vms_archive_p (%p)\n", abfd
);
338 /* Set the format of a file being written. */
341 vms_mkobject (bfd
* abfd
)
344 vms_debug (1, "vms_mkobject (%p)\n", abfd
);
347 if (!vms_initialize (abfd
))
352 const bfd_arch_info_type
*arch
= bfd_scan_arch ("vax");
354 const bfd_arch_info_type
*arch
= bfd_scan_arch ("alpha");
358 bfd_set_error (bfd_error_wrong_format
);
361 abfd
->arch_info
= arch
;
367 /* Write cached information into a file being written, at bfd_close. */
370 vms_write_object_contents (bfd
* abfd
)
373 vms_debug (1, "vms_write_object_contents (%p)\n", abfd
);
376 if (abfd
->section_count
> 0) /* we have sections */
380 if (_bfd_vms_write_hdr (abfd
, OBJ_S_C_HDR
) != 0)
382 if (_bfd_vms_write_gsd (abfd
, OBJ_S_C_GSD
) != 0)
384 if (_bfd_vms_write_tir (abfd
, OBJ_S_C_TIR
) != 0)
386 if (_bfd_vms_write_tbt (abfd
, OBJ_S_C_TBT
) != 0)
388 if (_bfd_vms_write_dbg (abfd
, OBJ_S_C_DBG
) != 0)
390 if (abfd
->section_count
> 255)
392 if (_bfd_vms_write_eom (abfd
, OBJ_S_C_EOMW
) != 0)
397 if (_bfd_vms_write_eom (abfd
, OBJ_S_C_EOM
) != 0)
403 if (_bfd_vms_write_hdr (abfd
, EOBJ_S_C_EMH
) != 0)
405 if (_bfd_vms_write_gsd (abfd
, EOBJ_S_C_EGSD
) != 0)
407 if (_bfd_vms_write_tir (abfd
, EOBJ_S_C_ETIR
) != 0)
409 if (_bfd_vms_write_tbt (abfd
, EOBJ_S_C_ETBT
) != 0)
411 if (_bfd_vms_write_dbg (abfd
, EOBJ_S_C_EDBG
) != 0)
413 if (_bfd_vms_write_eom (abfd
, EOBJ_S_C_EEOM
) != 0)
422 /* Called when the BFD is being closed to do any necessary cleanup. */
425 vms_close_and_cleanup (bfd
* abfd
)
428 vms_debug (1, "vms_close_and_cleanup (%p)\n", abfd
);
433 if (PRIV (vms_buf
) != NULL
)
434 free (PRIV (vms_buf
));
436 if (PRIV (sections
) != NULL
)
437 free (PRIV (sections
));
439 if (PRIV (vms_symbol_table
))
440 bfd_hash_table_free (PRIV (vms_symbol_table
));
442 bfd_release (abfd
, abfd
->tdata
.any
);
443 abfd
->tdata
.any
= NULL
;
448 /* Ask the BFD to free all cached information. */
451 vms_bfd_free_cached_info (bfd
* abfd ATTRIBUTE_UNUSED
)
454 vms_debug (1, "vms_bfd_free_cached_info (%p)\n", abfd
);
459 /* Called when a new section is created. */
462 vms_new_section_hook (bfd
* abfd
, asection
*section
)
464 /* Count hasn't been incremented yet. */
465 unsigned int section_count
= abfd
->section_count
+ 1;
468 vms_debug (1, "vms_new_section_hook (%p, [%d]%s), count %d\n",
469 abfd
, section
->index
, section
->name
, section_count
);
471 bfd_set_section_alignment (abfd
, section
, 4);
473 if (section_count
> PRIV (section_count
))
475 bfd_size_type amt
= section_count
;
476 amt
*= sizeof (asection
*);
477 PRIV (sections
) = bfd_realloc (PRIV (sections
), amt
);
478 if (PRIV (sections
) == NULL
)
480 PRIV (section_count
) = section_count
;
483 vms_debug (6, "section_count: %d\n", PRIV (section_count
));
485 PRIV (sections
)[section
->index
] = section
;
487 vms_debug (7, "%d: %s\n", section
->index
, section
->name
);
493 /* Read the contents of a section.
494 buf points to a buffer of buf_size bytes to be filled with
495 section data (starting at offset into section) */
498 vms_get_section_contents (bfd
* abfd ATTRIBUTE_UNUSED
,
499 asection
*section ATTRIBUTE_UNUSED
,
500 void * buf ATTRIBUTE_UNUSED
,
501 file_ptr offset ATTRIBUTE_UNUSED
,
502 bfd_size_type buf_size ATTRIBUTE_UNUSED
)
505 vms_debug (1, "vms_get_section_contents (%p, %s, %p, off %ld, size %d)\n",
506 abfd
, section
->name
, buf
, offset
, (int)buf_size
);
509 /* Shouldn't be called, since all sections are IN_MEMORY. */
513 /* Read the contents of a section.
514 buf points to a buffer of buf_size bytes to be filled with
515 section data (starting at offset into section). */
518 vms_get_section_contents_in_window (bfd
* abfd ATTRIBUTE_UNUSED
,
519 asection
*section ATTRIBUTE_UNUSED
,
520 bfd_window
*w ATTRIBUTE_UNUSED
,
521 file_ptr offset ATTRIBUTE_UNUSED
,
522 bfd_size_type count ATTRIBUTE_UNUSED
)
525 vms_debug (1, "vms_get_section_contents_in_window (%p, %s, %p, off %ld, count %d)\n",
526 abfd
, section
->name
, w
, offset
, (int)count
);
529 /* Shouldn't be called, since all sections are IN_MEMORY. */
533 /* Part 4.2, copy private data. */
535 /* Called to copy BFD general private data from one object file
539 vms_bfd_copy_private_bfd_data (bfd
*src ATTRIBUTE_UNUSED
,
540 bfd
*dest ATTRIBUTE_UNUSED
)
543 vms_debug (1, "vms_bfd_copy_private_bfd_data (%p, %p)\n", src
, dest
);
548 /* Merge private BFD information from the BFD @var{ibfd} to the
549 the output file BFD @var{obfd} when linking. Return <<TRUE>>
550 on success, <<FALSE>> on error. Possible error returns are:
552 o <<bfd_error_no_memory>> -
553 Not enough memory exists to create private data for @var{obfd}. */
556 vms_bfd_merge_private_bfd_data (bfd
* ibfd ATTRIBUTE_UNUSED
,
557 bfd
* obfd ATTRIBUTE_UNUSED
)
560 vms_debug (1,"vms_bfd_merge_private_bfd_data (%p, %p)\n", ibfd
, obfd
);
565 /* Set private BFD flag information in the BFD @var{abfd}.
566 Return <<TRUE>> on success, <<FALSE>> on error. Possible error
569 o <<bfd_error_no_memory>> -
570 Not enough memory exists to create private data for @var{obfd}. */
573 vms_bfd_set_private_flags (bfd
* abfd ATTRIBUTE_UNUSED
,
574 flagword flags ATTRIBUTE_UNUSED
)
577 vms_debug (1,"vms_bfd_set_private_flags (%p, %lx)\n", abfd
, (long)flags
);
582 /* Called to copy BFD private section data from one object file
586 vms_bfd_copy_private_section_data (bfd
*srcbfd ATTRIBUTE_UNUSED
,
587 asection
*srcsec ATTRIBUTE_UNUSED
,
588 bfd
*dstbfd ATTRIBUTE_UNUSED
,
589 asection
*dstsec ATTRIBUTE_UNUSED
)
592 vms_debug (1, "vms_bfd_copy_private_section_data (%p, %s, %p, %s)\n",
593 srcbfd
, srcsec
->name
, dstbfd
, dstsec
->name
);
598 /* Called to copy BFD private symbol data from one object file
602 vms_bfd_copy_private_symbol_data (bfd
*ibfd ATTRIBUTE_UNUSED
,
603 asymbol
*isym ATTRIBUTE_UNUSED
,
604 bfd
*obfd ATTRIBUTE_UNUSED
,
605 asymbol
*osym ATTRIBUTE_UNUSED
)
608 vms_debug (1, "vms_bfd_copy_private_symbol_data (%p, %s, %p, %s)\n",
609 ibfd
, isym
->name
, obfd
, osym
->name
);
614 /* Part 4.3, core file. */
616 /* Return a read-only string explaining which program was running
617 when it failed and produced the core file abfd. */
620 vms_core_file_failing_command (bfd
* abfd ATTRIBUTE_UNUSED
)
623 vms_debug (1, "vms_core_file_failing_command (%p)\n", abfd
);
628 /* Returns the signal number which caused the core dump which
629 generated the file the BFD abfd is attached to. */
632 vms_core_file_failing_signal (bfd
* abfd ATTRIBUTE_UNUSED
)
635 vms_debug (1, "vms_core_file_failing_signal (%p)\n", abfd
);
640 /* Return TRUE if the core file attached to core_bfd was generated
641 by a run of the executable file attached to exec_bfd, FALSE otherwise. */
644 vms_core_file_matches_executable_p (bfd
* abfd ATTRIBUTE_UNUSED
,
645 bfd
*bbfd ATTRIBUTE_UNUSED
)
648 vms_debug (1, "vms_core_file_matches_executable_p (%p, %p)\n", abfd
, bbfd
);
653 /* Part 4.4, archive. */
655 /* ??? do something with an archive map.
656 Return FALSE on error, TRUE otherwise. */
659 vms_slurp_armap (bfd
* abfd ATTRIBUTE_UNUSED
)
662 vms_debug (1, "vms_slurp_armap (%p)\n", abfd
);
667 /* ??? do something with an extended name table.
668 Return FALSE on error, TRUE otherwise. */
671 vms_slurp_extended_name_table (bfd
* abfd ATTRIBUTE_UNUSED
)
674 vms_debug (1, "vms_slurp_extended_name_table (%p)\n", abfd
);
679 /* ??? do something with an extended name table.
680 Return FALSE on error, TRUE otherwise. */
683 vms_construct_extended_name_table (bfd
* abfd ATTRIBUTE_UNUSED
,
684 char **tabloc ATTRIBUTE_UNUSED
,
685 bfd_size_type
*tablen ATTRIBUTE_UNUSED
,
686 const char **name ATTRIBUTE_UNUSED
)
689 vms_debug (1, "vms_construct_extended_name_table (%p)\n", abfd
);
694 /* Truncate the name of an archive to match system-dependent restrictions. */
697 vms_truncate_arname (bfd
* abfd ATTRIBUTE_UNUSED
,
698 const char *pathname ATTRIBUTE_UNUSED
,
699 char *arhdr ATTRIBUTE_UNUSED
)
702 vms_debug (1, "vms_truncate_arname (%p, %s, %s)\n", abfd
, pathname
, arhdr
);
707 /* ??? write archive map. */
710 vms_write_armap (bfd
*arch ATTRIBUTE_UNUSED
,
711 unsigned int elength ATTRIBUTE_UNUSED
,
712 struct orl
*map ATTRIBUTE_UNUSED
,
713 unsigned int orl_count ATTRIBUTE_UNUSED
,
714 int stridx ATTRIBUTE_UNUSED
)
717 vms_debug (1, "vms_write_armap (%p, %d, %p, %d %d)\n",
718 arch
, elength
, map
, orl_count
, stridx
);
723 /* Read archive header ??? */
726 vms_read_ar_hdr (bfd
* abfd ATTRIBUTE_UNUSED
)
729 vms_debug (1, "vms_read_ar_hdr (%p)\n", abfd
);
734 /* Provided a BFD, @var{archive}, containing an archive and NULL, open
735 an input BFD on the first contained element and returns that.
736 Subsequent calls should pass the archive and the previous return value
737 to return a created BFD to the next contained element.
738 NULL is returned when there are no more. */
741 vms_openr_next_archived_file (bfd
*arch ATTRIBUTE_UNUSED
,
742 bfd
*prev ATTRIBUTE_UNUSED
)
745 vms_debug (1, "vms_openr_next_archived_file (%p, %p)\n", arch
, prev
);
750 /* Return the BFD which is referenced by the symbol in ABFD indexed by
751 INDEX. INDEX should have been returned by bfd_get_next_mapent. */
754 vms_get_elt_at_index (bfd
* abfd
, symindex index
)
757 vms_debug (1, "vms_get_elt_at_index (%p, %p)\n", abfd
, index
);
759 return _bfd_generic_get_elt_at_index (abfd
, index
);
763 -> bfd_generic_stat_arch_elt. */
766 vms_generic_stat_arch_elt (bfd
* abfd
, struct stat
*st
)
769 vms_debug (1, "vms_generic_stat_arch_elt (%p, %p)\n", abfd
, st
);
771 return bfd_generic_stat_arch_elt (abfd
, st
);
774 /* This is a new function in bfd 2.5. */
777 vms_update_armap_timestamp (bfd
* abfd ATTRIBUTE_UNUSED
)
780 vms_debug (1, "vms_update_armap_timestamp (%p)\n", abfd
);
785 /* Part 4.5, symbols. */
787 /* Return the number of bytes required to store a vector of pointers
788 to asymbols for all the symbols in the BFD abfd, including a
789 terminal NULL pointer. If there are no symbols in the BFD,
790 then return 0. If an error occurs, return -1. */
793 vms_get_symtab_upper_bound (bfd
* abfd
)
796 vms_debug (1, "vms_get_symtab_upper_bound (%p), %d symbols\n", abfd
, PRIV (gsd_sym_count
));
798 return (PRIV (gsd_sym_count
) + 1) * sizeof (asymbol
*);
801 /* Copy symbols from hash table to symbol vector
803 called from bfd_hash_traverse in vms_canonicalize_symtab
804 init counter to 0 if entry == 0. */
807 copy_symbols (struct bfd_hash_entry
*entry
, void * arg
)
809 bfd
* abfd
= (bfd
*) arg
;
811 if (entry
== NULL
) /* Init counter. */
813 else /* Fill vector, inc counter. */
814 PRIV (symcache
)[PRIV (symnum
)++] = ((vms_symbol_entry
*)entry
)->symbol
;
819 /* Read the symbols from the BFD abfd, and fills in the vector
820 location with pointers to the symbols and a trailing NULL.
822 Return number of symbols read. */
825 vms_canonicalize_symtab (bfd
* abfd
, asymbol
**symbols
)
828 vms_debug (1, "vms_canonicalize_symtab (%p, <ret>)\n", abfd
);
832 copy_symbols (NULL
, abfd
);
834 /* Traverse table and fill symbols vector. */
835 PRIV (symcache
) = symbols
;
836 bfd_hash_traverse (PRIV (vms_symbol_table
), copy_symbols
, abfd
);
838 symbols
[PRIV (gsd_sym_count
)] = NULL
;
840 return PRIV (gsd_sym_count
);
843 /* Print symbol to file according to how. how is one of
844 bfd_print_symbol_name just print the name
845 bfd_print_symbol_more print more (???)
846 bfd_print_symbol_all print all we know, which is not much right now :-). */
849 vms_print_symbol (bfd
* abfd
,
852 bfd_print_symbol_type how
)
855 vms_debug (1, "vms_print_symbol (%p, %p, %p, %d)\n", abfd
, file
, symbol
, how
);
860 case bfd_print_symbol_name
:
861 case bfd_print_symbol_more
:
862 fprintf ((FILE *)file
," %s", symbol
->name
);
865 case bfd_print_symbol_all
:
867 const char *section_name
= symbol
->section
->name
;
869 bfd_print_symbol_vandf (abfd
, file
, symbol
);
871 fprintf ((FILE *) file
," %-8s %s", section_name
, symbol
->name
);
877 /* Return information about symbol in ret.
879 fill type, value and name
884 D data segment symbol
886 t a static function symbol
887 T text segment symbol
892 vms_get_symbol_info (bfd
* abfd ATTRIBUTE_UNUSED
,
899 vms_debug (1, "vms_get_symbol_info (%p, %p, %p)\n", abfd
, symbol
, ret
);
902 sec
= symbol
->section
;
907 if (bfd_is_com_section (sec
))
909 else if (bfd_is_abs_section (sec
))
911 else if (bfd_is_und_section (sec
))
913 else if (bfd_is_ind_section (sec
))
915 else if (bfd_get_section_flags (abfd
, sec
) & SEC_CODE
)
917 else if (bfd_get_section_flags (abfd
, sec
) & SEC_DATA
)
919 else if (bfd_get_section_flags (abfd
, sec
) & SEC_ALLOC
)
924 if (ret
->type
!= 'U')
925 ret
->value
= symbol
->value
+ symbol
->section
->vma
;
928 ret
->name
= symbol
->name
;
931 /* Return TRUE if the given symbol sym in the BFD abfd is
932 a compiler generated local label, else return FALSE. */
935 vms_bfd_is_local_label_name (bfd
* abfd ATTRIBUTE_UNUSED
,
939 vms_debug (1, "vms_bfd_is_local_label_name (%p, %s)\n", abfd
, name
);
941 return name
[0] == '$';
944 /* Get source line number for symbol. */
947 vms_get_lineno (bfd
* abfd ATTRIBUTE_UNUSED
,
948 asymbol
*symbol ATTRIBUTE_UNUSED
)
951 vms_debug (1, "vms_get_lineno (%p, %p)\n", abfd
, symbol
);
956 /* Provided a BFD, a section and an offset into the section, calculate and
957 return the name of the source file and the line nearest to the wanted
961 vms_find_nearest_line (bfd
* abfd ATTRIBUTE_UNUSED
,
962 asection
*section ATTRIBUTE_UNUSED
,
963 asymbol
**symbols ATTRIBUTE_UNUSED
,
964 bfd_vma offset ATTRIBUTE_UNUSED
,
965 const char **file ATTRIBUTE_UNUSED
,
966 const char **func ATTRIBUTE_UNUSED
,
967 unsigned int *line ATTRIBUTE_UNUSED
)
970 vms_debug (1, "vms_find_nearest_line (%p, %s, %p, %ld, <ret>, <ret>, <ret>)\n",
971 abfd
, section
->name
, symbols
, (long int)offset
);
977 vms_find_inliner_info (bfd
* abfd ATTRIBUTE_UNUSED
,
978 const char **file ATTRIBUTE_UNUSED
,
979 const char **func ATTRIBUTE_UNUSED
,
980 unsigned int *line ATTRIBUTE_UNUSED
)
983 vms_debug (1, "vms_find_inliner_info (%p, <ret>, <ret>, <ret>)\n",
989 /* Back-door to allow format-aware applications to create debug symbols
990 while using BFD for everything else. Currently used by the assembler
991 when creating COFF files. */
994 vms_bfd_make_debug_symbol (bfd
* abfd ATTRIBUTE_UNUSED
,
995 void *ptr ATTRIBUTE_UNUSED
,
996 unsigned long size ATTRIBUTE_UNUSED
)
999 vms_debug (1, "vms_bfd_make_debug_symbol (%p, %p, %ld)\n", abfd
, ptr
, size
);
1004 /* Read minisymbols. For minisymbols, we use the unmodified a.out
1005 symbols. The minisymbol_to_symbol function translates these into
1006 BFD asymbol structures. */
1009 vms_read_minisymbols (bfd
* abfd
,
1010 bfd_boolean dynamic
,
1012 unsigned int *sizep
)
1015 vms_debug (1, "vms_read_minisymbols (%p, %d, %p, %d)\n", abfd
, dynamic
, minisymsp
, *sizep
);
1017 return _bfd_generic_read_minisymbols (abfd
, dynamic
, minisymsp
, sizep
);
1020 /* Convert a minisymbol to a BFD asymbol. A minisymbol is just an
1021 unmodified a.out symbol. The SYM argument is a structure returned
1022 by bfd_make_empty_symbol, which we fill in here. */
1025 vms_minisymbol_to_symbol (bfd
* abfd
,
1026 bfd_boolean dynamic
,
1027 const void * minisym
,
1031 vms_debug (1, "vms_minisymbol_to_symbol (%p, %d, %p, %p)\n", abfd
, dynamic
, minisym
, sym
);
1033 return _bfd_generic_minisymbol_to_symbol (abfd
, dynamic
, minisym
, sym
);
1036 /* Part 4.6, relocations. */
1038 /* Return the number of bytes required to store the relocation information
1039 associated with section sect attached to bfd abfd.
1040 If an error occurs, return -1. */
1043 vms_get_reloc_upper_bound (bfd
* abfd ATTRIBUTE_UNUSED
,
1044 asection
*section ATTRIBUTE_UNUSED
)
1047 vms_debug (1, "vms_get_reloc_upper_bound (%p, %s)\n", abfd
, section
->name
);
1052 /* Call the back end associated with the open BFD abfd and translate the
1053 external form of the relocation information attached to sec into the
1054 internal canonical form. Place the table into memory at loc, which has
1055 been preallocated, usually by a call to bfd_get_reloc_upper_bound.
1056 Returns the number of relocs, or -1 on error. */
1059 vms_canonicalize_reloc (bfd
* abfd ATTRIBUTE_UNUSED
,
1060 asection
*section ATTRIBUTE_UNUSED
,
1061 arelent
**location ATTRIBUTE_UNUSED
,
1062 asymbol
**symbols ATTRIBUTE_UNUSED
)
1065 vms_debug (1, "vms_canonicalize_reloc (%p, %s, <ret>, <ret>)\n", abfd
, section
->name
);
1070 /* This is just copied from ecoff-alpha, needs to be fixed probably. */
1072 /* How to process the various reloc types. */
1074 static bfd_reloc_status_type
1075 reloc_nil (bfd
* abfd ATTRIBUTE_UNUSED
,
1076 arelent
*reloc ATTRIBUTE_UNUSED
,
1077 asymbol
*sym ATTRIBUTE_UNUSED
,
1078 void * data ATTRIBUTE_UNUSED
,
1079 asection
*sec ATTRIBUTE_UNUSED
,
1080 bfd
*output_bfd ATTRIBUTE_UNUSED
,
1081 char **error_message ATTRIBUTE_UNUSED
)
1084 vms_debug (1, "reloc_nil (abfd %p, output_bfd %p)\n", abfd
, output_bfd
);
1085 vms_debug (2, "In section %s, symbol %s\n",
1086 sec
->name
, sym
->name
);
1087 vms_debug (2, "reloc sym %s, addr %08lx, addend %08lx, reloc is a %s\n",
1088 reloc
->sym_ptr_ptr
[0]->name
,
1089 (unsigned long)reloc
->address
,
1090 (unsigned long)reloc
->addend
, reloc
->howto
->name
);
1091 vms_debug (2, "data at %p\n", data
);
1092 /* _bfd_hexdump (2, data, bfd_get_reloc_size (reloc->howto), 0); */
1095 return bfd_reloc_ok
;
1098 /* In case we're on a 32-bit machine, construct a 64-bit "-1" value
1099 from smaller values. Start with zero, widen, *then* decrement. */
1100 #define MINUS_ONE (((bfd_vma)0) - 1)
1102 static reloc_howto_type alpha_howto_table
[] =
1104 HOWTO (ALPHA_R_IGNORE
, /* Type. */
1105 0, /* Rightshift. */
1106 0, /* Size (0 = byte, 1 = short, 2 = long). */
1108 TRUE
, /* PC relative. */
1110 complain_overflow_dont
,/* Complain_on_overflow. */
1111 reloc_nil
, /* Special_function. */
1112 "IGNORE", /* Name. */
1113 TRUE
, /* Partial_inplace. */
1114 0, /* Source mask */
1116 TRUE
), /* PC rel offset. */
1118 /* A 64 bit reference to a symbol. */
1119 HOWTO (ALPHA_R_REFQUAD
, /* Type. */
1120 0, /* Rightshift. */
1121 4, /* Size (0 = byte, 1 = short, 2 = long). */
1123 FALSE
, /* PC relative. */
1125 complain_overflow_bitfield
, /* Complain_on_overflow. */
1126 reloc_nil
, /* Special_function. */
1127 "REFQUAD", /* Name. */
1128 TRUE
, /* Partial_inplace. */
1129 MINUS_ONE
, /* Source mask. */
1130 MINUS_ONE
, /* Dest mask. */
1131 FALSE
), /* PC rel offset. */
1133 /* A 21 bit branch. The native assembler generates these for
1134 branches within the text segment, and also fills in the PC
1135 relative offset in the instruction. */
1136 HOWTO (ALPHA_R_BRADDR
, /* Type. */
1137 2, /* Rightshift. */
1138 2, /* Size (0 = byte, 1 = short, 2 = long). */
1140 TRUE
, /* PC relative. */
1142 complain_overflow_signed
, /* Complain_on_overflow. */
1143 reloc_nil
, /* Special_function. */
1144 "BRADDR", /* Name. */
1145 TRUE
, /* Partial_inplace. */
1146 0x1fffff, /* Source mask. */
1147 0x1fffff, /* Dest mask. */
1148 FALSE
), /* PC rel offset. */
1150 /* A hint for a jump to a register. */
1151 HOWTO (ALPHA_R_HINT
, /* Type. */
1152 2, /* Rightshift. */
1153 1, /* Size (0 = byte, 1 = short, 2 = long). */
1155 TRUE
, /* PC relative. */
1157 complain_overflow_dont
,/* Complain_on_overflow. */
1158 reloc_nil
, /* Special_function. */
1160 TRUE
, /* Partial_inplace. */
1161 0x3fff, /* Source mask. */
1162 0x3fff, /* Dest mask. */
1163 FALSE
), /* PC rel offset. */
1165 /* 16 bit PC relative offset. */
1166 HOWTO (ALPHA_R_SREL16
, /* Type. */
1167 0, /* Rightshift. */
1168 1, /* Size (0 = byte, 1 = short, 2 = long). */
1170 TRUE
, /* PC relative. */
1172 complain_overflow_signed
, /* Complain_on_overflow. */
1173 reloc_nil
, /* Special_function. */
1174 "SREL16", /* Name. */
1175 TRUE
, /* Partial_inplace. */
1176 0xffff, /* Source mask. */
1177 0xffff, /* Dest mask. */
1178 FALSE
), /* PC rel offset. */
1180 /* 32 bit PC relative offset. */
1181 HOWTO (ALPHA_R_SREL32
, /* Type. */
1182 0, /* Rightshift. */
1183 2, /* Size (0 = byte, 1 = short, 2 = long). */
1185 TRUE
, /* PC relative. */
1187 complain_overflow_signed
, /* Complain_on_overflow. */
1188 reloc_nil
, /* Special_function. */
1189 "SREL32", /* Name. */
1190 TRUE
, /* Partial_inplace. */
1191 0xffffffff, /* Source mask. */
1192 0xffffffff, /* Dest mask. */
1193 FALSE
), /* PC rel offset. */
1195 /* A 64 bit PC relative offset. */
1196 HOWTO (ALPHA_R_SREL64
, /* Type. */
1197 0, /* Rightshift. */
1198 4, /* Size (0 = byte, 1 = short, 2 = long). */
1200 TRUE
, /* PC relative. */
1202 complain_overflow_signed
, /* Complain_on_overflow. */
1203 reloc_nil
, /* Special_function. */
1204 "SREL64", /* Name. */
1205 TRUE
, /* Partial_inplace. */
1206 MINUS_ONE
, /* Source mask. */
1207 MINUS_ONE
, /* Dest mask. */
1208 FALSE
), /* PC rel offset. */
1210 /* Push a value on the reloc evaluation stack. */
1211 HOWTO (ALPHA_R_OP_PUSH
, /* Type. */
1212 0, /* Rightshift. */
1213 0, /* Size (0 = byte, 1 = short, 2 = long). */
1215 FALSE
, /* PC relative. */
1217 complain_overflow_dont
,/* Complain_on_overflow. */
1218 reloc_nil
, /* Special_function. */
1219 "OP_PUSH", /* Name. */
1220 FALSE
, /* Partial_inplace. */
1221 0, /* Source mask. */
1223 FALSE
), /* PC rel offset. */
1225 /* Store the value from the stack at the given address. Store it in
1226 a bitfield of size r_size starting at bit position r_offset. */
1227 HOWTO (ALPHA_R_OP_STORE
, /* Type. */
1228 0, /* Rightshift. */
1229 4, /* Size (0 = byte, 1 = short, 2 = long). */
1231 FALSE
, /* PC relative. */
1233 complain_overflow_dont
,/* Complain_on_overflow. */
1234 reloc_nil
, /* Special_function. */
1235 "OP_STORE", /* Name. */
1236 FALSE
, /* Partial_inplace. */
1237 0, /* Source mask. */
1238 MINUS_ONE
, /* Dest mask. */
1239 FALSE
), /* PC rel offset. */
1241 /* Subtract the reloc address from the value on the top of the
1242 relocation stack. */
1243 HOWTO (ALPHA_R_OP_PSUB
, /* Type. */
1244 0, /* Rightshift. */
1245 0, /* Size (0 = byte, 1 = short, 2 = long). */
1247 FALSE
, /* PC relative. */
1249 complain_overflow_dont
,/* Complain_on_overflow. */
1250 reloc_nil
, /* Special_function. */
1251 "OP_PSUB", /* Name. */
1252 FALSE
, /* Partial_inplace. */
1253 0, /* Source mask. */
1255 FALSE
), /* PC rel offset. */
1257 /* Shift the value on the top of the relocation stack right by the
1259 HOWTO (ALPHA_R_OP_PRSHIFT
, /* Type. */
1260 0, /* Rightshift. */
1261 0, /* Size (0 = byte, 1 = short, 2 = long). */
1263 FALSE
, /* PC relative. */
1265 complain_overflow_dont
,/* Complain_on_overflow. */
1266 reloc_nil
, /* Special_function. */
1267 "OP_PRSHIFT", /* Name. */
1268 FALSE
, /* Partial_inplace. */
1269 0, /* Source mask. */
1271 FALSE
), /* PC rel offset. */
1273 /* Hack. Linkage is done by linker. */
1274 HOWTO (ALPHA_R_LINKAGE
, /* Type. */
1275 0, /* Rightshift. */
1276 8, /* Size (0 = byte, 1 = short, 2 = long). */
1278 FALSE
, /* PC relative. */
1280 complain_overflow_dont
,/* Complain_on_overflow. */
1281 reloc_nil
, /* Special_function. */
1282 "LINKAGE", /* Name. */
1283 FALSE
, /* Partial_inplace. */
1284 0, /* Source mask. */
1286 FALSE
), /* PC rel offset. */
1288 /* A 32 bit reference to a symbol. */
1289 HOWTO (ALPHA_R_REFLONG
, /* Type. */
1290 0, /* Rightshift. */
1291 2, /* Size (0 = byte, 1 = short, 2 = long). */
1293 FALSE
, /* PC relative. */
1295 complain_overflow_bitfield
, /* Complain_on_overflow. */
1296 reloc_nil
, /* Special_function. */
1297 "REFLONG", /* Name. */
1298 TRUE
, /* Partial_inplace. */
1299 0xffffffff, /* Source mask. */
1300 0xffffffff, /* Dest mask. */
1301 FALSE
), /* PC rel offset. */
1303 /* A 64 bit reference to a procedure, written as 32 bit value. */
1304 HOWTO (ALPHA_R_CODEADDR
, /* Type. */
1305 0, /* Rightshift. */
1306 4, /* Size (0 = byte, 1 = short, 2 = long). */
1308 FALSE
, /* PC relative. */
1310 complain_overflow_signed
,/* Complain_on_overflow. */
1311 reloc_nil
, /* Special_function. */
1312 "CODEADDR", /* Name. */
1313 FALSE
, /* Partial_inplace. */
1314 0xffffffff, /* Source mask. */
1315 0xffffffff, /* Dest mask. */
1316 FALSE
), /* PC rel offset. */
1320 /* Return a pointer to a howto structure which, when invoked, will perform
1321 the relocation code on data from the architecture noted. */
1323 static const struct reloc_howto_struct
*
1324 vms_bfd_reloc_type_lookup (bfd
* abfd ATTRIBUTE_UNUSED
,
1325 bfd_reloc_code_real_type code
)
1330 vms_debug (1, "vms_bfd_reloc_type_lookup (%p, %d)\t", abfd
, code
);
1335 case BFD_RELOC_16
: alpha_type
= ALPHA_R_SREL16
; break;
1336 case BFD_RELOC_32
: alpha_type
= ALPHA_R_REFLONG
; break;
1337 case BFD_RELOC_64
: alpha_type
= ALPHA_R_REFQUAD
; break;
1338 case BFD_RELOC_CTOR
: alpha_type
= ALPHA_R_REFQUAD
; break;
1339 case BFD_RELOC_23_PCREL_S2
: alpha_type
= ALPHA_R_BRADDR
; break;
1340 case BFD_RELOC_ALPHA_HINT
: alpha_type
= ALPHA_R_HINT
; break;
1341 case BFD_RELOC_16_PCREL
: alpha_type
= ALPHA_R_SREL16
; break;
1342 case BFD_RELOC_32_PCREL
: alpha_type
= ALPHA_R_SREL32
; break;
1343 case BFD_RELOC_64_PCREL
: alpha_type
= ALPHA_R_SREL64
; break;
1344 case BFD_RELOC_ALPHA_LINKAGE
: alpha_type
= ALPHA_R_LINKAGE
; break;
1345 case BFD_RELOC_ALPHA_CODEADDR
: alpha_type
= ALPHA_R_CODEADDR
; break;
1347 (*_bfd_error_handler
) ("reloc (%d) is *UNKNOWN*", code
);
1351 vms_debug (2, "reloc is %s\n", alpha_howto_table
[alpha_type
].name
);
1353 return & alpha_howto_table
[alpha_type
];
1356 /* Part 4.7, writing an object file. */
1358 /* Set the architecture and machine type in BFD abfd to arch and mach.
1359 Find the correct pointer to a structure and insert it into the arch_info
1363 vms_set_arch_mach (bfd
* abfd
,
1364 enum bfd_architecture arch ATTRIBUTE_UNUSED
,
1365 unsigned long mach ATTRIBUTE_UNUSED
)
1368 vms_debug (1, "vms_set_arch_mach (%p, %d, %ld)\n", abfd
, arch
, mach
);
1370 abfd
->arch_info
= bfd_scan_arch ("alpha");
1375 /* Sets the contents of the section section in BFD abfd to the data starting
1376 in memory at data. The data is written to the output section starting at
1377 offset offset for count bytes.
1379 Normally TRUE is returned, else FALSE. Possible error returns are:
1380 o bfd_error_no_contents - The output section does not have the
1381 SEC_HAS_CONTENTS attribute, so nothing can be written to it.
1382 o and some more too */
1385 vms_set_section_contents (bfd
* abfd
,
1387 const void * location
,
1389 bfd_size_type count
)
1392 vms_debug (1, "vms_set_section_contents (%p, sec %s, loc %p, off %ld, count %d)\n",
1393 abfd
, section
->name
, location
, (long int)offset
, (int)count
);
1394 vms_debug (2, "size %d\n", (int) section
->size
);
1396 return _bfd_save_vms_section (abfd
, section
, location
, offset
, count
);
1399 /* Part 4.8, linker. */
1401 /* Get the size of the section headers. */
1404 vms_sizeof_headers (bfd
* abfd ATTRIBUTE_UNUSED
,
1405 bfd_boolean reloc ATTRIBUTE_UNUSED
)
1408 vms_debug (1, "vms_sizeof_headers (%p, %s)\n", abfd
, (reloc
)?"True":"False");
1413 /* Provides default handling of relocation effort for back ends
1414 which can't be bothered to do it efficiently. */
1417 vms_bfd_get_relocated_section_contents (bfd
* abfd ATTRIBUTE_UNUSED
,
1418 struct bfd_link_info
*link_info ATTRIBUTE_UNUSED
,
1419 struct bfd_link_order
*link_order ATTRIBUTE_UNUSED
,
1420 bfd_byte
*data ATTRIBUTE_UNUSED
,
1421 bfd_boolean relocatable ATTRIBUTE_UNUSED
,
1422 asymbol
**symbols ATTRIBUTE_UNUSED
)
1425 vms_debug (1, "vms_bfd_get_relocated_section_contents (%p, %p, %p, %p, %s, %p)\n",
1426 abfd
, link_info
, link_order
, data
, (relocatable
)?"True":"False", symbols
);
1434 vms_bfd_relax_section (bfd
* abfd ATTRIBUTE_UNUSED
,
1435 asection
*section ATTRIBUTE_UNUSED
,
1436 struct bfd_link_info
*link_info ATTRIBUTE_UNUSED
,
1437 bfd_boolean
*again ATTRIBUTE_UNUSED
)
1440 vms_debug (1, "vms_bfd_relax_section (%p, %s, %p, <ret>)\n",
1441 abfd
, section
->name
, link_info
);
1447 vms_bfd_gc_sections (bfd
* abfd ATTRIBUTE_UNUSED
,
1448 struct bfd_link_info
*link_info ATTRIBUTE_UNUSED
)
1451 vms_debug (1, "vms_bfd_gc_sections (%p, %p)\n", abfd
, link_info
);
1457 vms_bfd_merge_sections (bfd
* abfd ATTRIBUTE_UNUSED
,
1458 struct bfd_link_info
*link_info ATTRIBUTE_UNUSED
)
1461 vms_debug (1, "vms_bfd_merge_sections (%p, %p)\n", abfd
, link_info
);
1466 /* Create a hash table for the linker. Different backends store
1467 different information in this table. */
1469 static struct bfd_link_hash_table
*
1470 vms_bfd_link_hash_table_create (bfd
* abfd ATTRIBUTE_UNUSED
)
1473 vms_debug (1, "vms_bfd_link_hash_table_create (%p)\n", abfd
);
1478 /* Free a linker hash table. */
1481 vms_bfd_link_hash_table_free (struct bfd_link_hash_table
*hash ATTRIBUTE_UNUSED
)
1484 vms_debug (1, "vms_bfd_link_hash_table_free (%p)\n", abfd
);
1488 /* Add symbols from this object file into the hash table. */
1491 vms_bfd_link_add_symbols (bfd
* abfd ATTRIBUTE_UNUSED
,
1492 struct bfd_link_info
*link_info ATTRIBUTE_UNUSED
)
1495 vms_debug (1, "vms_bfd_link_add_symbols (%p, %p)\n", abfd
, link_info
);
1500 /* Do a link based on the link_order structures attached to each
1501 section of the BFD. */
1504 vms_bfd_final_link (bfd
* abfd ATTRIBUTE_UNUSED
,
1505 struct bfd_link_info
*link_info ATTRIBUTE_UNUSED
)
1508 vms_debug (1, "vms_bfd_final_link (%p, %p)\n", abfd
, link_info
);
1513 /* Should this section be split up into smaller pieces during linking. */
1516 vms_bfd_link_split_section (bfd
* abfd ATTRIBUTE_UNUSED
,
1517 asection
*section ATTRIBUTE_UNUSED
)
1520 vms_debug (1, "vms_bfd_link_split_section (%p, %s)\n", abfd
, section
->name
);
1525 /* Part 4.9, dynamic symbols and relocations. */
1527 /* Get the amount of memory required to hold the dynamic symbols. */
1530 vms_get_dynamic_symtab_upper_bound (bfd
* abfd ATTRIBUTE_UNUSED
)
1533 vms_debug (1, "vms_get_dynamic_symtab_upper_bound (%p)\n", abfd
);
1539 vms_bfd_print_private_bfd_data (bfd
* abfd ATTRIBUTE_UNUSED
,
1540 void *file ATTRIBUTE_UNUSED
)
1543 vms_debug (1, "vms_bfd_print_private_bfd_data (%p)\n", abfd
);
1548 /* Read in the dynamic symbols. */
1551 vms_canonicalize_dynamic_symtab (bfd
* abfd ATTRIBUTE_UNUSED
,
1552 asymbol
**symbols ATTRIBUTE_UNUSED
)
1555 vms_debug (1, "vms_canonicalize_dynamic_symtab (%p, <ret>)\n", abfd
);
1560 /* Get the amount of memory required to hold the dynamic relocs. */
1563 vms_get_dynamic_reloc_upper_bound (bfd
* abfd ATTRIBUTE_UNUSED
)
1566 vms_debug (1, "vms_get_dynamic_reloc_upper_bound (%p)\n", abfd
);
1571 /* Read in the dynamic relocs. */
1574 vms_canonicalize_dynamic_reloc (bfd
* abfd ATTRIBUTE_UNUSED
,
1575 arelent
**arel ATTRIBUTE_UNUSED
,
1576 asymbol
**symbols ATTRIBUTE_UNUSED
)
1579 vms_debug (1, "vms_canonicalize_dynamic_reloc (%p)\n", abfd
);
1584 const bfd_target vms_alpha_vec
=
1586 "vms-alpha", /* Name. */
1587 bfd_target_evax_flavour
,
1588 BFD_ENDIAN_LITTLE
, /* Data byte order is little. */
1589 BFD_ENDIAN_LITTLE
, /* Header byte order is little. */
1591 (HAS_RELOC
| HAS_SYMS
1592 | WP_TEXT
| D_PAGED
), /* Object flags. */
1593 (SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
1594 | SEC_READONLY
| SEC_CODE
| SEC_DATA
1595 | SEC_HAS_CONTENTS
| SEC_IN_MEMORY
), /* Sect flags. */
1596 0, /* Symbol_leading_char. */
1597 ' ', /* AR_pad_char. */
1598 15, /* AR_max_namelen. */
1599 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
1600 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
1601 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
,
1602 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
1603 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
1604 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
,
1606 {_bfd_dummy_target
, vms_object_p
, /* bfd_check_format. */
1607 vms_archive_p
, _bfd_dummy_target
},
1608 {bfd_false
, vms_mkobject
, /* bfd_set_format. */
1609 _bfd_generic_mkarchive
, bfd_false
},
1610 {bfd_false
, vms_write_object_contents
, /* bfd_write_contents. */
1611 _bfd_write_archive_contents
, bfd_false
},
1613 BFD_JUMP_TABLE_GENERIC (vms
),
1614 BFD_JUMP_TABLE_COPY (vms
),
1615 BFD_JUMP_TABLE_CORE (vms
),
1616 BFD_JUMP_TABLE_ARCHIVE (vms
),
1617 BFD_JUMP_TABLE_SYMBOLS (vms
),
1618 BFD_JUMP_TABLE_RELOCS (vms
),
1619 BFD_JUMP_TABLE_WRITE (vms
),
1620 BFD_JUMP_TABLE_LINK (vms
),
1621 BFD_JUMP_TABLE_DYNAMIC (vms
),
1628 const bfd_target vms_vax_vec
=
1630 "vms-vax", /* Name. */
1631 bfd_target_ovax_flavour
,
1632 BFD_ENDIAN_LITTLE
, /* Data byte order is little. */
1633 BFD_ENDIAN_LITTLE
, /* Header byte order is little. */
1635 (HAS_RELOC
| HAS_SYMS
/* Object flags. */
1637 | HAS_LINENO
| HAS_DEBUG
| HAS_LOCALS
),
1639 (SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
1640 | SEC_READONLY
| SEC_CODE
| SEC_DATA
1641 | SEC_HAS_CONTENTS
| SEC_IN_MEMORY
), /* Sect flags. */
1642 0, /* Symbol_leading_char. */
1643 ' ', /* AR_pad_char. */
1644 15, /* AR_max_namelen. */
1645 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
1646 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
1647 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* Data. */
1648 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
1649 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
1650 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
, /* Headers. */
1652 {_bfd_dummy_target
, vms_object_p
, /* bfd_check_format. */
1653 vms_archive_p
, _bfd_dummy_target
},
1654 {bfd_false
, vms_mkobject
, /* bfd_set_format. */
1655 _bfd_generic_mkarchive
, bfd_false
},
1656 {bfd_false
, vms_write_object_contents
, /* bfd_write_contents. */
1657 _bfd_write_archive_contents
, bfd_false
},
1659 BFD_JUMP_TABLE_GENERIC (vms
),
1660 BFD_JUMP_TABLE_COPY (vms
),
1661 BFD_JUMP_TABLE_CORE (vms
),
1662 BFD_JUMP_TABLE_ARCHIVE (vms
),
1663 BFD_JUMP_TABLE_SYMBOLS (vms
),
1664 BFD_JUMP_TABLE_RELOCS (vms
),
1665 BFD_JUMP_TABLE_WRITE (vms
),
1666 BFD_JUMP_TABLE_LINK (vms
),
1667 BFD_JUMP_TABLE_DYNAMIC (vms
),