/* vms.c -- BFD back-end for VAX (openVMS/VAX) and
EVAX (openVMS/Alpha) files.
- Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
Written by Klaus K"ampf (kkaempf@rmi.de)
#include "vms.h"
static boolean vms_initialize PARAMS ((bfd *));
-static int priv_section_count;
+static unsigned int priv_section_count;
static boolean fill_section_ptr PARAMS ((struct bfd_hash_entry *, PTR));
static boolean vms_fixup_sections PARAMS ((bfd *));
static boolean copy_symbols PARAMS ((struct bfd_hash_entry *, PTR));
PARAMS ((bfd *abfd, char **tabloc, bfd_size_type *tablen,
const char **name));
static void vms_truncate_arname
- PARAMS ((bfd *abfd, CONST char *pathname, char *arhdr));
+ PARAMS ((bfd *abfd, const char *pathname, char *arhdr));
static boolean vms_write_armap
PARAMS ((bfd *arch, unsigned int elength, struct orl *map,
unsigned int orl_count, int stridx));
static bfd *vms_get_elt_at_index PARAMS ((bfd *abfd, symindex index));
static bfd *vms_openr_next_archived_file PARAMS ((bfd *arch, bfd *prev));
static boolean vms_update_armap_timestamp PARAMS ((bfd *abfd));
-static int vms_generic_stat_arch_elt PARAMS ((bfd *abfd, struct stat *stat));
+static int vms_generic_stat_arch_elt PARAMS ((bfd *, struct stat *));
static long vms_get_symtab_upper_bound PARAMS ((bfd *abfd));
static long vms_get_symtab PARAMS ((bfd *abfd, asymbol **symbols));
static void vms_print_symbol
boolean *again));
static boolean vms_bfd_gc_sections
PARAMS ((bfd *abfd, struct bfd_link_info *link_info));
+static boolean vms_bfd_merge_sections
+ PARAMS ((bfd *abfd, struct bfd_link_info *link_info));
static struct bfd_link_hash_table *vms_bfd_link_hash_table_create
PARAMS ((bfd *abfd));
static boolean vms_bfd_link_add_symbols
const bfd_target vms_alpha_vec =
{
-
"vms-alpha", /* name */
bfd_target_evax_flavour,
- false, /* data byte order is little */
- false, /* header byte order is little */
+ BFD_ENDIAN_LITTLE, /* data byte order is little */
+ BFD_ENDIAN_LITTLE, /* header byte order is little */
(HAS_RELOC | HAS_SYMS
| WP_TEXT | D_PAGED), /* object flags */
BFD_JUMP_TABLE_LINK (vms),
BFD_JUMP_TABLE_DYNAMIC (vms),
+ NULL,
+
(PTR) 0
};
const bfd_target vms_vax_vec =
{
-
"vms-vax", /* name */
bfd_target_ovax_flavour,
- false, /* data byte order is little */
- false, /* header byte order is little */
+ BFD_ENDIAN_LITTLE, /* data byte order is little */
+ BFD_ENDIAN_LITTLE, /* header byte order is little */
(HAS_RELOC | HAS_SYMS /* object flags */
| WP_TEXT | D_PAGED
BFD_JUMP_TABLE_LINK (vms),
BFD_JUMP_TABLE_DYNAMIC (vms),
+ NULL,
+
(PTR) 0
};
\f
bfd *abfd;
{
int i;
+ bfd_size_type amt;
if (abfd->tdata.any != 0)
return true;
- bfd_set_start_address (abfd, (bfd_vma)-1);
+ bfd_set_start_address (abfd, (bfd_vma) -1);
- abfd->tdata.any = ((struct vms_private_data_struct*)
- bfd_malloc (sizeof (struct vms_private_data_struct)));
+ amt = sizeof (struct vms_private_data_struct);
+ abfd->tdata.any = (struct vms_private_data_struct*) bfd_malloc (amt);
if (abfd->tdata.any == 0)
return false;
#ifdef __ALPHA
- PRIV(is_vax) = 0;
+ PRIV (is_vax) = 0;
#else
- PRIV(is_vax) = 1;
-#endif
- PRIV(vms_buf) = 0;
- PRIV(buf_size) = 0;
- PRIV(rec_length) = 0;
- PRIV(file_format) = FF_UNKNOWN;
- PRIV(fixup_done) = false;
- PRIV(sections) = NULL;
-
- PRIV(stack) = ((struct stack_struct *)
- bfd_malloc (sizeof (struct stack_struct) * STACKSIZE));
- if (PRIV(stack) == 0)
+ PRIV (is_vax) = 1;
+#endif
+ PRIV (vms_buf) = 0;
+ PRIV (buf_size) = 0;
+ PRIV (rec_length) = 0;
+ PRIV (file_format) = FF_UNKNOWN;
+ PRIV (fixup_done) = false;
+ PRIV (sections) = NULL;
+
+ amt = sizeof (struct stack_struct) * STACKSIZE;
+ PRIV (stack) = (struct stack_struct *) bfd_malloc (amt);
+ if (PRIV (stack) == 0)
{
vms_init_no_mem1:
free (abfd->tdata.any);
abfd->tdata.any = 0;
return false;
}
- PRIV(stackptr) = 0;
+ PRIV (stackptr) = 0;
- PRIV(vms_symbol_table) = ((struct bfd_hash_table *)
- bfd_malloc (sizeof (struct bfd_hash_table)));
- if (PRIV(vms_symbol_table) == 0)
+ amt = sizeof (struct bfd_hash_table);
+ PRIV (vms_symbol_table) = (struct bfd_hash_table *) bfd_malloc (amt);
+ if (PRIV (vms_symbol_table) == 0)
{
vms_init_no_mem2:
- free (PRIV(stack));
- PRIV(stack) = 0;
+ free (PRIV (stack));
+ PRIV (stack) = 0;
goto vms_init_no_mem1;
}
- if (!bfd_hash_table_init (PRIV(vms_symbol_table), _bfd_vms_hash_newfunc))
+ if (!bfd_hash_table_init (PRIV (vms_symbol_table), _bfd_vms_hash_newfunc))
return false;
- PRIV(location_stack) = ((struct location_struct *)
- bfd_malloc (sizeof (struct location_struct)
- * LOCATION_SAVE_SIZE));
- if (PRIV(location_stack) == 0)
+ amt = sizeof (struct location_struct) * LOCATION_SAVE_SIZE;
+ PRIV (location_stack) = (struct location_struct *) bfd_malloc (amt);
+ if (PRIV (location_stack) == 0)
{
vms_init_no_mem3:
- free (PRIV(vms_symbol_table));
- PRIV(vms_symbol_table) = 0;
+ free (PRIV (vms_symbol_table));
+ PRIV (vms_symbol_table) = 0;
goto vms_init_no_mem2;
}
for (i = 0; i < VMS_SECTION_COUNT; i++)
- PRIV(vms_section_table)[i] = NULL;
+ PRIV (vms_section_table)[i] = NULL;
- PRIV(output_buf) = (unsigned char *) malloc (MAX_OUTREC_SIZE);
- if (PRIV(output_buf) == 0)
+ PRIV (output_buf) = (unsigned char *) malloc (MAX_OUTREC_SIZE);
+ if (PRIV (output_buf) == 0)
{
- free (PRIV(location_stack));
- PRIV(location_stack) = 0;
+ free (PRIV (location_stack));
+ PRIV (location_stack) = 0;
goto vms_init_no_mem3;
}
- PRIV(push_level) = 0;
- PRIV(pushed_size) = 0;
- PRIV(length_pos) = 2;
- PRIV(output_size) = 0;
- PRIV(output_alignment) = 1;
+ PRIV (push_level) = 0;
+ PRIV (pushed_size) = 0;
+ PRIV (length_pos) = 2;
+ PRIV (output_size) = 0;
+ PRIV (output_alignment) = 1;
return true;
}
-
/* Fill symbol->section with section ptr
symbol->section is filled with the section index for defined symbols
during reading the GSD/EGSD section. But we need the pointer to the
/* fill forward references (these contain section number, not section ptr). */
- if ((int)sec < priv_section_count)
+ if ((unsigned int) sec < priv_section_count)
{
sec = ((vms_symbol_entry *)entry)->symbol->section =
((asection **)sections)[(int)sec];
return true;
}
-
/* Fixup sections
set up all pointers and arrays, counters and sizes are fixed now
vms_fixup_sections (abfd)
bfd *abfd;
{
- if (PRIV(fixup_done))
+ if (PRIV (fixup_done))
return true;
/*
*/
/* can't provide section count as argument to fill_section_ptr(). */
- priv_section_count = PRIV(section_count);
- bfd_hash_traverse (PRIV(vms_symbol_table), fill_section_ptr,
- (PTR)(PRIV(sections)));
+ priv_section_count = PRIV (section_count);
+ bfd_hash_traverse (PRIV (vms_symbol_table), fill_section_ptr,
+ (PTR) (PRIV (sections)));
- PRIV(fixup_done) = true;
+ PRIV (fixup_done) = true;
return true;
}
return 0;
}
- if (bfd_seek (abfd, 0L, SEEK_SET))
+ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET))
{
bfd_set_error (bfd_error_file_truncated);
return 0;
if (_bfd_vms_next_record (abfd) < 0)
{
#if VMS_DEBUG
- vms_debug (2, "next_record failed\n");
+ vms_debug (2, "next_record failed\n");
#endif
bfd_set_error (bfd_error_wrong_format);
return 0;
}
if ((prev_type == EOBJ_S_C_EGSD)
- && (PRIV(rec_type) != EOBJ_S_C_EGSD))
+ && (PRIV (rec_type) != EOBJ_S_C_EGSD))
{
if (vms_fixup_sections (abfd) == false)
{
}
}
- prev_type = PRIV(rec_type);
+ prev_type = PRIV (rec_type);
if (target_vector == 0)
{
}
/* set arch_info to vax */
-
+
arch = bfd_scan_arch ("vax");
PRIV (is_vax) = 1;
#if VMS_DEBUG
else if (target_vector == &vms_alpha_vec)
{
/* set arch_info to alpha */
-
+
arch = bfd_scan_arch ("alpha");
PRIV (is_vax) = 0;
#if VMS_DEBUG
return target_vector;
}
-
/* Check the format for a file being read.
Return a (bfd_target *) if it's an archive file or zero. */
static const struct bfd_target *
vms_archive_p (abfd)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_archive_p(%p)\n", abfd);
return 0;
}
-
/* Set the format of a file being written. */
static boolean
return true;
}
-
/* Write cached information into a file being written, at bfd_close. */
static boolean
if (abfd->section_count > 0) /* we have sections */
{
- if (PRIV(is_vax))
+ if (PRIV (is_vax))
{
if (_bfd_vms_write_hdr (abfd, OBJ_S_C_HDR) != 0)
return false;
if (abfd == 0)
return true;
- if (PRIV(vms_buf) != NULL)
+ if (PRIV (vms_buf) != NULL)
{
- free (PRIV(vms_buf));
- PRIV(vms_buf) = NULL;
+ free (PRIV (vms_buf));
+ PRIV (vms_buf) = NULL;
}
- PRIV(buf_size) = 0;
+ PRIV (buf_size) = 0;
- if (PRIV(output_buf) != 0)
+ if (PRIV (output_buf) != 0)
{
- free (PRIV(output_buf));
- PRIV(output_buf) = 0;
+ free (PRIV (output_buf));
+ PRIV (output_buf) = 0;
}
sec = abfd->sections;
sec = sec->next;
}
- if (PRIV(sections) != NULL)
+ if (PRIV (sections) != NULL)
{
- free (PRIV(sections));
- PRIV(sections) = NULL;
+ free (PRIV (sections));
+ PRIV (sections) = NULL;
}
- if (PRIV(vms_symbol_table))
+ if (PRIV (vms_symbol_table))
{
- bfd_hash_table_free (PRIV(vms_symbol_table));
- PRIV(vms_symbol_table) = 0;
+ bfd_hash_table_free (PRIV (vms_symbol_table));
+ PRIV (vms_symbol_table) = 0;
}
- if (PRIV(stack))
+ if (PRIV (stack))
{
- free (PRIV(stack));
- PRIV(stack) = 0;
+ free (PRIV (stack));
+ PRIV (stack) = 0;
}
- if (PRIV(location_stack))
+ if (PRIV (location_stack))
{
- free (PRIV(location_stack));
- PRIV(location_stack) = 0;
+ free (PRIV (location_stack));
+ PRIV (location_stack) = 0;
}
for (i = 0; i < VMS_SECTION_COUNT; i++)
{
- es = PRIV(vms_section_table)[i];
+ es = PRIV (vms_section_table)[i];
while (es != NULL)
{
es1 = es->next;
free (es);
es = es1;
}
- PRIV(vms_section_table)[i] = NULL;
+ PRIV (vms_section_table)[i] = NULL;
}
free (abfd->tdata.any);
return true;
}
-
/* Ask the BFD to free all cached information. */
static boolean
vms_bfd_free_cached_info (abfd)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_bfd_free_cached_info(%p)\n", abfd);
return true;
}
-
/* Called when a new section is created. */
static boolean
#endif
bfd_set_section_alignment(abfd, section, 4);
- if (abfd->section_count > PRIV(section_count))
+ if (abfd->section_count > PRIV (section_count))
{
- PRIV(sections) = ((asection **)
- bfd_realloc (PRIV(sections), abfd->section_count * sizeof (asection *)));
- if (PRIV(sections) == 0)
+ bfd_size_type amt = abfd->section_count;
+ amt *= sizeof (asection *);
+ PRIV (sections) = (asection **) bfd_realloc (PRIV (sections), amt);
+ if (PRIV (sections) == 0)
return false;
- PRIV(section_count) = abfd->section_count;
+ PRIV (section_count) = abfd->section_count;
}
#if VMS_DEBUG
- vms_debug (6, "section_count: %d\n", PRIV(section_count));
+ vms_debug (6, "section_count: %d\n", PRIV (section_count));
#endif
- PRIV(sections)[section->index] = section;
+ PRIV (sections)[section->index] = section;
#if VMS_DEBUG
vms_debug (7, "%d: %s\n", section->index, section->name);
#endif
return true;
}
-
/* Read the contents of a section.
buf points to a buffer of buf_size bytes to be filled with
section data (starting at offset into section) */
static boolean
vms_get_section_contents (abfd, section, buf, offset, buf_size)
- bfd *abfd;
- asection *section;
- PTR buf;
- file_ptr offset;
- bfd_size_type buf_size;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *section ATTRIBUTE_UNUSED;
+ PTR buf ATTRIBUTE_UNUSED;
+ file_ptr offset ATTRIBUTE_UNUSED;
+ bfd_size_type buf_size ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_get_section_contents(%p, %s, %p, off %ld, size %d)\n",
static boolean
vms_get_section_contents_in_window (abfd, section, w, offset, count)
- bfd *abfd;
- asection *section;
- bfd_window *w;
- file_ptr offset;
- bfd_size_type count;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *section ATTRIBUTE_UNUSED;
+ bfd_window *w ATTRIBUTE_UNUSED;
+ file_ptr offset ATTRIBUTE_UNUSED;
+ bfd_size_type count ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_get_section_contents_in_window(%p, %s, %p, off %ld, count %d)\n",
static boolean
vms_bfd_copy_private_bfd_data (src, dest)
- bfd *src;
- bfd *dest;
+ bfd *src ATTRIBUTE_UNUSED;
+ bfd *dest ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_bfd_copy_private_bfd_data(%p, %p)\n", src, dest);
return true;
}
-
/* Merge private BFD information from the BFD @var{ibfd} to the
the output file BFD @var{obfd} when linking. Return <<true>>
on success, <<false>> on error. Possible error returns are:
static boolean
vms_bfd_merge_private_bfd_data (ibfd, obfd)
- bfd *ibfd;
- bfd *obfd;
+ bfd *ibfd ATTRIBUTE_UNUSED;
+ bfd *obfd ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1,"vms_bfd_merge_private_bfd_data(%p, %p)\n", ibfd, obfd);
return true;
}
-
/* Set private BFD flag information in the BFD @var{abfd}.
Return <<true>> on success, <<false>> on error. Possible error
returns are:
static boolean
vms_bfd_set_private_flags (abfd, flags)
- bfd *abfd;
- flagword flags;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ flagword flags ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1,"vms_bfd_set_private_flags(%p, %lx)\n", abfd, (long)flags);
return true;
}
-
/* Called to copy BFD private section data from one object file
to another. */
static boolean
vms_bfd_copy_private_section_data (srcbfd, srcsec, dstbfd, dstsec)
- bfd *srcbfd;
- asection *srcsec;
- bfd *dstbfd;
- asection *dstsec;
+ bfd *srcbfd ATTRIBUTE_UNUSED;
+ asection *srcsec ATTRIBUTE_UNUSED;
+ bfd *dstbfd ATTRIBUTE_UNUSED;
+ asection *dstsec ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_bfd_copy_private_section_data(%p, %s, %p, %s)\n",
/* Called to copy BFD private symbol data from one object file
to another. */
-static boolean
+static boolean
vms_bfd_copy_private_symbol_data (ibfd, isym, obfd, osym)
- bfd *ibfd;
- asymbol *isym;
- bfd *obfd;
- asymbol *osym;
+ bfd *ibfd ATTRIBUTE_UNUSED;
+ asymbol *isym ATTRIBUTE_UNUSED;
+ bfd *obfd ATTRIBUTE_UNUSED;
+ asymbol *osym ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_bfd_copy_private_symbol_data(%p, %s, %p, %s)\n",
static char *
vms_core_file_failing_command (abfd)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_core_file_failing_command(%p)\n", abfd);
return 0;
}
-
/* Returns the signal number which caused the core dump which
generated the file the BFD abfd is attached to. */
static int
vms_core_file_failing_signal (abfd)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_core_file_failing_signal(%p)\n", abfd);
return 0;
}
-
/* Return true if the core file attached to core_bfd was generated
by a run of the executable file attached to exec_bfd, false otherwise. */
static boolean
vms_core_file_matches_executable_p (abfd, bbfd)
- bfd *abfd;
- bfd *bbfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ bfd *bbfd ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_core_file_matches_executable_p(%p, %p)\n", abfd, bbfd);
static boolean
vms_slurp_armap (abfd)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_slurp_armap(%p)\n", abfd);
return false;
}
-
/* ??? do something with an extended name table.
Return false on error, true otherwise. */
static boolean
vms_slurp_extended_name_table (abfd)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_slurp_extended_name_table(%p)\n", abfd);
return false;
}
-
/* ??? do something with an extended name table.
Return false on error, true otherwise. */
static boolean
vms_construct_extended_name_table (abfd, tabloc, tablen, name)
- bfd *abfd;
- char **tabloc;
- bfd_size_type *tablen;
- const char **name;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ char **tabloc ATTRIBUTE_UNUSED;
+ bfd_size_type *tablen ATTRIBUTE_UNUSED;
+ const char **name ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_construct_extended_name_table(%p)\n", abfd);
return false;
}
-
/* Truncate the name of an archive to match system-dependent restrictions */
static void
vms_truncate_arname (abfd, pathname, arhdr)
- bfd *abfd;
- CONST char *pathname;
- char *arhdr;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ const char *pathname ATTRIBUTE_UNUSED;
+ char *arhdr ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_truncate_arname(%p, %s, %s)\n", abfd, pathname, arhdr);
return;
}
-
/* ??? write archive map */
static boolean
vms_write_armap (arch, elength, map, orl_count, stridx)
- bfd *arch;
- unsigned int elength;
- struct orl *map;
- unsigned int orl_count;
- int stridx;
+ bfd *arch ATTRIBUTE_UNUSED;
+ unsigned int elength ATTRIBUTE_UNUSED;
+ struct orl *map ATTRIBUTE_UNUSED;
+ unsigned int orl_count ATTRIBUTE_UNUSED;
+ int stridx ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_write_armap(%p, %d, %p, %d %d)\n",
static PTR
vms_read_ar_hdr (abfd)
- bfd * abfd;
+ bfd * abfd ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_read_ar_hdr(%p)\n", abfd);
return (PTR)0;
}
-
/* Provided a BFD, @var{archive}, containing an archive and NULL, open
an input BFD on the first contained element and returns that.
Subsequent calls should pass the archive and the previous return value
static bfd *
vms_openr_next_archived_file (arch, prev)
- bfd *arch;
- bfd *prev;
+ bfd *arch ATTRIBUTE_UNUSED;
+ bfd *prev ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_openr_next_archived_file(%p, %p)\n", arch, prev);
#endif
- return false;
+ return NULL;
}
-
/* Return the BFD which is referenced by the symbol in ABFD indexed by
INDEX. INDEX should have been returned by bfd_get_next_mapent. */
return _bfd_generic_get_elt_at_index(abfd, index);
}
-
/* ???
-> bfd_generic_stat_arch_elt */
static int
-vms_generic_stat_arch_elt (abfd, stat)
+vms_generic_stat_arch_elt (abfd, st)
bfd *abfd;
- struct stat *stat;
+ struct stat *st;
{
#if VMS_DEBUG
- vms_debug (1, "vms_generic_stat_arch_elt(%p, %p)\n", abfd, stat);
+ vms_debug (1, "vms_generic_stat_arch_elt(%p, %p)\n", abfd, st);
#endif
- return bfd_generic_stat_arch_elt(abfd, stat);
+ return bfd_generic_stat_arch_elt (abfd, st);
}
-
/* This is a new function in bfd 2.5 */
static boolean
vms_update_armap_timestamp (abfd)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_update_armap_timestamp(%p)\n", abfd);
bfd *abfd;
{
#if VMS_DEBUG
- vms_debug (1, "vms_get_symtab_upper_bound(%p), %d symbols\n", abfd, PRIV(gsd_sym_count));
+ vms_debug (1, "vms_get_symtab_upper_bound(%p), %d symbols\n", abfd, PRIV (gsd_sym_count));
#endif
- return (PRIV(gsd_sym_count)+1) * sizeof(asymbol *);
+ return (PRIV (gsd_sym_count)+1) * sizeof (asymbol *);
}
-
/* Copy symbols from hash table to symbol vector
called from bfd_hash_traverse in vms_get_symtab
bfd *abfd = (bfd *) arg;
if (entry == NULL) /* init counter */
- PRIV(symnum) = 0;
+ PRIV (symnum) = 0;
else /* fill vector, inc counter */
- PRIV(symcache)[PRIV(symnum)++] = ((vms_symbol_entry *)entry)->symbol;
+ PRIV (symcache)[PRIV (symnum)++] = ((vms_symbol_entry *)entry)->symbol;
return true;
}
-
/* Read the symbols from the BFD abfd, and fills in the vector
location with pointers to the symbols and a trailing NULL.
/* traverse table and fill symbols vector */
- PRIV(symcache) = symbols;
- bfd_hash_traverse(PRIV(vms_symbol_table), copy_symbols, (PTR)abfd);
+ PRIV (symcache) = symbols;
+ bfd_hash_traverse(PRIV (vms_symbol_table), copy_symbols, (PTR)abfd);
- symbols[PRIV(gsd_sym_count)] = NULL;
+ symbols[PRIV (gsd_sym_count)] = NULL;
- return PRIV(gsd_sym_count);
+ return PRIV (gsd_sym_count);
}
-
/* Create a new asymbol structure for the BFD abfd and return a pointer
to it.
This routine is necessary because each back end has private information
_bfd_vms_make_empty_symbol (abfd)
bfd *abfd;
{
- asymbol *symbol = (asymbol *)bfd_zalloc(abfd, sizeof(asymbol));
+ asymbol *symbol;
+
+ symbol = (asymbol *) bfd_zalloc(abfd, (bfd_size_type) sizeof (asymbol));
#if VMS_DEBUG
vms_debug (1, "_bfd_vms_make_empty_symbol(%p)\n", abfd);
return symbol;
}
-
/* Print symbol to file according to how. how is one of
bfd_print_symbol_name just print the name
bfd_print_symbol_more print more (???)
{
case bfd_print_symbol_name:
case bfd_print_symbol_more:
- fprintf((FILE *)file," %s", symbol->name);
- break;
-
+ fprintf ((FILE *)file," %s", symbol->name);
break;
case bfd_print_symbol_all:
{
- CONST char *section_name = symbol->section->name;
+ const char *section_name = symbol->section->name;
- bfd_print_symbol_vandf((PTR)file,symbol);
+ bfd_print_symbol_vandf (abfd, (PTR)file, symbol);
- fprintf((FILE *)file," %-8s %s", section_name, symbol->name);
+ fprintf ((FILE *)file," %-8s %s", section_name, symbol->name);
}
break;
}
return;
}
-
/* Return information about symbol in ret.
fill type, value and name
static void
vms_get_symbol_info (abfd, symbol, ret)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
asymbol *symbol;
symbol_info *ret;
{
return;
}
-
/* Return true if the given symbol sym in the BFD abfd is
a compiler generated local label, else return false. */
static boolean
vms_bfd_is_local_label_name (abfd, name)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
const char *name;
{
#if VMS_DEBUG
return name[0] == '$';
}
-
/* Get source line number for symbol */
static alent *
vms_get_lineno (abfd, symbol)
- bfd *abfd;
- asymbol *symbol;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asymbol *symbol ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_get_lineno(%p, %p)\n", abfd, symbol);
return 0;
}
-
/* Provided a BFD, a section and an offset into the section, calculate and
return the name of the source file and the line nearest to the wanted
location. */
static boolean
vms_find_nearest_line (abfd, section, symbols, offset, file, func, line)
- bfd *abfd;
- asection *section;
- asymbol **symbols;
- bfd_vma offset;
- CONST char **file;
- CONST char **func;
- unsigned int *line;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *section ATTRIBUTE_UNUSED;
+ asymbol **symbols ATTRIBUTE_UNUSED;
+ bfd_vma offset ATTRIBUTE_UNUSED;
+ const char **file ATTRIBUTE_UNUSED;
+ const char **func ATTRIBUTE_UNUSED;
+ unsigned int *line ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_find_nearest_line(%p, %s, %p, %ld, <ret>, <ret>, <ret>)\n",
return false;
}
-
/* Back-door to allow format-aware applications to create debug symbols
while using BFD for everything else. Currently used by the assembler
when creating COFF files. */
static asymbol *
vms_bfd_make_debug_symbol (abfd, ptr, size)
- bfd *abfd;
- void *ptr;
- unsigned long size;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ void *ptr ATTRIBUTE_UNUSED;
+ unsigned long size ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_bfd_make_debug_symbol(%p, %p, %ld)\n", abfd, ptr, size);
return 0;
}
-
/* Read minisymbols. For minisymbols, we use the unmodified a.out
symbols. The minisymbol_to_symbol function translates these into
BFD asymbol structures. */
static long
vms_get_reloc_upper_bound (abfd, section)
- bfd *abfd;
- asection *section;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *section ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_get_reloc_upper_bound(%p, %s)\n", abfd, section->name);
return -1L;
}
-
/* Call the back end associated with the open BFD abfd and translate the
external form of the relocation information attached to sec into the
internal canonical form. Place the table into memory at loc, which has
static long
vms_canonicalize_reloc (abfd, section, location, symbols)
- bfd *abfd;
- asection *section;
- arelent **location;
- asymbol **symbols;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *section ATTRIBUTE_UNUSED;
+ arelent **location ATTRIBUTE_UNUSED;
+ asymbol **symbols ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_canonicalize_reloc(%p, %s, <ret>, <ret>)\n", abfd, section->name);
static bfd_reloc_status_type
reloc_nil (abfd, reloc, sym, data, sec, output_bfd, error_message)
- bfd *abfd;
- arelent *reloc;
- asymbol *sym;
- PTR data;
- asection *sec;
- bfd *output_bfd;
- char **error_message;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc ATTRIBUTE_UNUSED;
+ asymbol *sym ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *sec ATTRIBUTE_UNUSED;
+ bfd *output_bfd ATTRIBUTE_UNUSED;
+ char **error_message ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "reloc_nil(abfd %p, output_bfd %p)\n", abfd, output_bfd);
static const struct reloc_howto_struct *
vms_bfd_reloc_type_lookup (abfd, code)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type code;
{
int alpha_type;
return &alpha_howto_table[alpha_type];
}
-
/*-- Part 4.7, writing an object file ---------------------------------------*/
/* Set the architecture and machine type in BFD abfd to arch and mach.
static boolean
vms_set_arch_mach (abfd, arch, mach)
bfd *abfd;
- enum bfd_architecture arch;
- unsigned long mach;
+ enum bfd_architecture arch ATTRIBUTE_UNUSED;
+ unsigned long mach ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_set_arch_mach(%p, %d, %ld)\n", abfd, arch, mach);
return true;
}
-
/* Sets the contents of the section section in BFD abfd to the data starting
in memory at data. The data is written to the output section starting at
offset offset for count bytes.
return _bfd_save_vms_section(abfd, section, location, offset, count);
}
-
/*-- Part 4.8, linker -------------------------------------------------------*/
/* Get the size of the section headers. */
static int
vms_sizeof_headers (abfd, reloc)
- bfd *abfd;
- boolean reloc;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ boolean reloc ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_sizeof_headers(%p, %s)\n", abfd, (reloc)?"True":"False");
return 0;
}
-
/* Provides default handling of relocation effort for back ends
which can't be bothered to do it efficiently. */
static bfd_byte *
vms_bfd_get_relocated_section_contents (abfd, link_info, link_order, data,
relocateable, symbols)
- bfd *abfd;
- struct bfd_link_info *link_info;
- struct bfd_link_order *link_order;
- bfd_byte *data;
- boolean relocateable;
- asymbol **symbols;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
+ struct bfd_link_order *link_order ATTRIBUTE_UNUSED;
+ bfd_byte *data ATTRIBUTE_UNUSED;
+ boolean relocateable ATTRIBUTE_UNUSED;
+ asymbol **symbols ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_bfd_get_relocated_section_contents(%p, %p, %p, %p, %s, %p)\n",
return 0;
}
-
/* ??? */
static boolean
vms_bfd_relax_section (abfd, section, link_info, again)
- bfd *abfd;
- asection *section;
- struct bfd_link_info *link_info;
- boolean *again;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *section ATTRIBUTE_UNUSED;
+ struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
+ boolean *again ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_bfd_relax_section(%p, %s, %p, <ret>)\n",
static boolean
vms_bfd_gc_sections (abfd, link_info)
- bfd *abfd;
- struct bfd_link_info *link_info;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_bfd_gc_sections(%p, %p)\n", abfd, link_info);
return true;
}
+static boolean
+vms_bfd_merge_sections (abfd, link_info)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
+{
+#if VMS_DEBUG
+ vms_debug (1, "vms_bfd_merge_sections(%p, %p)\n", abfd, link_info);
+#endif
+ return true;
+}
/* Create a hash table for the linker. Different backends store
different information in this table. */
static struct bfd_link_hash_table *
vms_bfd_link_hash_table_create (abfd)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_bfd_link_hash_table_create(%p)\n", abfd);
return 0;
}
-
/* Add symbols from this object file into the hash table. */
static boolean
vms_bfd_link_add_symbols (abfd, link_info)
- bfd *abfd;
- struct bfd_link_info *link_info;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_bfd_link_add_symbols(%p, %p)\n", abfd, link_info);
return false;
}
-
/* Do a link based on the link_order structures attached to each
section of the BFD. */
static boolean
vms_bfd_final_link (abfd, link_info)
- bfd *abfd;
- struct bfd_link_info *link_info;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_bfd_final_link(%p, %p)\n", abfd, link_info);
static boolean
vms_bfd_link_split_section (abfd, section)
- bfd *abfd;
- asection *section;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *section ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_bfd_link_split_section(%p, %s)\n", abfd, section->name);
static long
vms_get_dynamic_symtab_upper_bound (abfd)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_get_dynamic_symtab_upper_bound(%p)\n", abfd);
static boolean
vms_bfd_print_private_bfd_data (abfd, file)
- bfd *abfd;
- void *file;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ void *file ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_bfd_print_private_bfd_data(%p)\n", abfd);
return 0;
}
-
/* Read in the dynamic symbols. */
static long
vms_canonicalize_dynamic_symtab (abfd, symbols)
- bfd *abfd;
- asymbol **symbols;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asymbol **symbols ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_canonicalize_dynamic_symtab(%p, <ret>)\n", abfd);
return 0L;
}
-
/* Get the amount of memory required to hold the dynamic relocs. */
static long
vms_get_dynamic_reloc_upper_bound (abfd)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_get_dynamic_reloc_upper_bound(%p)\n", abfd);
return 0L;
}
-
/* Read in the dynamic relocs. */
static long
vms_canonicalize_dynamic_reloc (abfd, arel, symbols)
- bfd *abfd;
- arelent **arel;
- asymbol **symbols;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent **arel ATTRIBUTE_UNUSED;
+ asymbol **symbols ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_canonicalize_dynamic_reloc(%p)\n", abfd);