old-cross-binutils/bfd/vms.h
Tristan Gingold 95e34ef763 2010-04-14 Tristan Gingold <gingold@adacore.com>
* Makefile.am (BFD32_BACKENDS): Remove vms-gsd.lo, vms-hdr.lo,
	vms-tir.lo, vms.lo and add vms-alpha.lo
	(BFD32_BACKENDS_CFILES): Remove vms-gsd.c, vms-hdr.c,
	vms-tir.c, vms.c and add vms-alpha.c
	* Makefile.in: Regenerate.
	* configure.in (TDEFINES): Adjust file list for vms_alpha_vec.
	Remove vms_vax_vec.
	* configure: Regenerate.
	* targets.c (vms_vax_vec): Remove the declaration.
	(_bfd_target_vector): Remove vms_vax_vec.
	* vms-alpha.c: New file.
	* vms-gsd.c: Removed, rewritten in vms-alpha.c
	* vms-hdr.c: Ditto.
	* vms-tir.c: Ditto.
	* vms.c: Ditto.
	* vms-misc.c: Fix indentation and comments.  Replace most of
	#if VMS_DEBUG/vms_debug with vms_debug2.
	(_bfd_vms_hash_newfunc): Moved to vms-alpha.c
	(hash_string): Ditto.
	(_bfd_vms_length_hash_symbol): Ditto.
	(maybe_adjust_record_pointer_for_object): Ditto.
	(_bfd_vms_get_object_record): Ditto.
	(vms_get_remaining_object_record): Ditto.
	(_bfd_vms_push): Ditto.
	(_bfd_vms_pop): Ditto.
	(_bfd_vms_get_header_values): Removed.
	(_bfd_vms_get_first_record): Removed.
	(vms_get_remaining_image_record): Removed.
	(new_symbol): Removed.
	(_bfd_vms_enter_symbol): Removed.
	(_bfd_vms_save_sized_string): Use memcpy instead of strncpy.
	(_bfd_vms_output_begin): Remove rechead parameter.  Replace bfd
	parameter with struct vms_rec_wr.
	(_bfd_vms_output_push): Removed and replaced by ...
	(_bfd_vms_output_begin_subrec): ... new function.
	(_bfd_vms_output_alignment): Replace bfd parameter with
	struct vms_rec_wr, and adjust.
	(_bfd_vms_output_check): Ditto
	(_bfd_vms_output_byte): Ditto.
	(_bfd_vms_output_short): Ditto.
	(_bfd_vms_output_long): Ditto.
	(_bfd_vms_output_quad): Ditto.
	(_bfd_vms_output_counted): Ditto.
	(_bfd_vms_output_dump): Ditto.
	(_bfd_vms_output_fill): Ditto.
	(_bfd_vms_output_pop): Removed and replaced by ...
	(_bfd_vms_output_end_subrec): ... new function.
	(_bfd_vms_output_flush): Removed.
	(_bfd_vms_output_align): New function.
	(_bfd_vms_output_end): Add recwr parameter.  Adjust for this new
	parameter.
	(vms_convert_to_var): New function imported from vms.c
	(vms_convert_to_var_1): Ditto.
	(vms_convert_to_var_unix_filename): Ditto.
	(vms_get_module_name): Ditto.
	(get_vms_time_string): Ditto.
	(vms_time_to_time_t): Ditto.
	(vms_rawtime_to_time_t): Ditto.
	* vms.h: All macros for the VMS file format are now in include/vms.
	Prototypes for vms.c, vms-gsd.c, vms-misc.c, vms-hdr.c, vms-tir.c
	have been removed.
	(struct vms_symbol_struct, struct stack_struct): Moved to vms-alpha.c
	(struct fileinfo, struct srecinfo, struct lineinfo): Ditto.
	(struct funcinfo, struct vms_private_data_struct): Ditto.
	(struct vms_section_data_struct): Ditto.
	(struct vms_rec_rd, stryct vms_rec_wr): New declarations.
	(vms_get_module_name, get_vms_time_string): New declarations.
	(vms_time_to_time_t, vms_rawtime_to_time_t): Ditto.
	(_bfd_vms_output_begin_subrec, _bfd_vms_output_end_subrec): Ditto.
	(_bfd_vms_save_sized_string, _bfd_vms_save_counted_string): Adjusted.
	(_bfd_vms_output_begin, _bfd_vms_output_alignment): Ditto.
	(_bfd_vms_output_end,_bfd_vms_output_check): Ditto.
	(_bfd_vms_output_byte, _bfd_vms_output_short): Ditto.
	(_bfd_vms_output_long, _bfd_vms_output_quad): Ditto.
	(_bfd_vms_output_counted, _bfd_vms_output_dump): Ditto.
	(_bfd_vms_output_fill): Ditto.
	(bfd_vms_set_section_flags): Ditto.
2010-04-14 09:24:59 +00:00

139 lines
4 KiB
C

/* vms.h -- Header file for VMS (Alpha and Vax) support.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007,
2008, 2009 Free Software Foundation, Inc.
Main header file.
Written by Klaus K"ampf (kkaempf@rmi.de)
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#undef vms
#ifndef VMS_H
#define VMS_H
#include <time.h>
/* Size of a VMS block on disk. */
#define VMS_BLOCK_SIZE 512
/* Miscellaneous definitions. */
#define MAX_OUTREC_SIZE 4096
#define MIN_OUTREC_LUFT 64
/* File format. */
enum file_format_enum
{
/* Not yet known. */
FF_UNKNOWN,
/* Unix format. Each record is preceeded by the record length,
on 2 bytes. */
FF_FOREIGN,
/* Native (=VMS) format. The file only contains the content of the
records. This may also appear on Unix, depending on which tool
was used to transfer files. */
FF_NATIVE
};
/* VMS records input buffer. */
struct vms_rec_rd
{
/* Buffer and its size. */
unsigned char *buf;
unsigned int buf_size;
/* Current record and its size. */
unsigned char *rec;
unsigned int rec_size;
/* Input file format. */
enum file_format_enum file_format;
};
/* VMS records output buffer. */
struct vms_rec_wr
{
/* Output buffer. */
unsigned char *buf;
/* Current length of the record. */
unsigned short int size;
/* Sub-record start offset. */
unsigned short int subrec_offset;
/* Some records must have a size that is a multiple of the alignment.
Mustn't be 0. */
unsigned short int align;
};
struct evax_private_udata_struct
{
asymbol *bsym;
asymbol *enbsym;
char *origname;
int lkindex;
};
/* vms-misc.c. */
#define VMS_DEBUG 1
#if VMS_DEBUG
extern void _bfd_vms_debug (int, char *, ...) ATTRIBUTE_PRINTF_2;
extern void _bfd_hexdump (int, unsigned char *, int, int);
#define vms_debug _bfd_vms_debug
#define vms_debug2(X) _bfd_vms_debug X
#else
#define vms_debug2(X)
#endif
extern char *vms_get_module_name (const char *filename, bfd_boolean);
extern unsigned char *get_vms_time_string (void);
extern time_t vms_time_to_time_t (unsigned int hi, unsigned int lo);
extern time_t vms_rawtime_to_time_t (unsigned char *buf);
extern char *_bfd_vms_save_sized_string (unsigned char *, int);
extern char *_bfd_vms_save_counted_string (unsigned char *);
extern void _bfd_vms_output_begin (struct vms_rec_wr *, int);
extern void _bfd_vms_output_alignment (struct vms_rec_wr *, int);
extern void _bfd_vms_output_begin_subrec (struct vms_rec_wr *, int);
extern void _bfd_vms_output_end_subrec (struct vms_rec_wr *);
extern void _bfd_vms_output_end (bfd *, struct vms_rec_wr *);
extern int _bfd_vms_output_check (struct vms_rec_wr *, int);
extern void _bfd_vms_output_byte (struct vms_rec_wr *, unsigned);
extern void _bfd_vms_output_short (struct vms_rec_wr *, unsigned);
extern void _bfd_vms_output_long (struct vms_rec_wr *, unsigned long);
extern void _bfd_vms_output_quad (struct vms_rec_wr *, bfd_vma);
extern void _bfd_vms_output_counted (struct vms_rec_wr *, char *);
extern void _bfd_vms_output_dump (struct vms_rec_wr *, unsigned char *, int);
extern void _bfd_vms_output_fill (struct vms_rec_wr *, int, int);
/* vms-alpha.c */
extern void bfd_vms_set_section_flags (bfd *, asection *, flagword, flagword);
#endif /* VMS_H */