OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [binutils-2.18.50/] [bfd/] [vms-hdr.c] - Diff between revs 38 and 156

Only display areas with differences | Details | Blame | View Log

Rev 38 Rev 156
/* vms-hdr.c -- BFD back-end for VMS/VAX (openVMS/VAX) and
/* vms-hdr.c -- BFD back-end for VMS/VAX (openVMS/VAX) and
   EVAX (openVMS/Alpha) files.
   EVAX (openVMS/Alpha) files.
   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006,
   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006,
   2007 Free Software Foundation, Inc.
   2007 Free Software Foundation, Inc.
 
 
   HDR record handling functions
   HDR record handling functions
   EMH record handling functions
   EMH record handling functions
   and
   and
   EOM record handling functions
   EOM record handling functions
   EEOM record handling functions
   EEOM record handling functions
 
 
   Written by Klaus K"ampf (kkaempf@rmi.de)
   Written by Klaus K"ampf (kkaempf@rmi.de)
 
 
   This program is free software; you can redistribute it and/or modify
   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
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.
   (at your option) any later version.
 
 
   This program is distributed in the hope that it will be useful,
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   GNU General Public License for more details.
 
 
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
   MA 02110-1301, USA.  */
   MA 02110-1301, USA.  */
 
 
#include "sysdep.h"
#include "sysdep.h"
#include "bfd.h"
#include "bfd.h"
#include "bfdver.h"
#include "bfdver.h"
#include "bfdlink.h"
#include "bfdlink.h"
#include "safe-ctype.h"
#include "safe-ctype.h"
#include "libbfd.h"
#include "libbfd.h"
 
 
#include "vms.h"
#include "vms.h"
 
 
#ifdef HAVE_ALLOCA_H
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#include <alloca.h>
#endif
#endif
 
 
/* Read & process emh record
/* Read & process emh record
   return 0 on success, -1 on error.  */
   return 0 on success, -1 on error.  */
 
 
int
int
_bfd_vms_slurp_hdr (bfd *abfd, int objtype)
_bfd_vms_slurp_hdr (bfd *abfd, int objtype)
{
{
  unsigned char *ptr;
  unsigned char *ptr;
  unsigned char *vms_rec;
  unsigned char *vms_rec;
  int subtype;
  int subtype;
 
 
  vms_rec = PRIV(vms_rec);
  vms_rec = PRIV(vms_rec);
 
 
#if VMS_DEBUG
#if VMS_DEBUG
  vms_debug(2, "HDR/EMH\n");
  vms_debug(2, "HDR/EMH\n");
#endif
#endif
 
 
  switch (objtype)
  switch (objtype)
    {
    {
    case OBJ_S_C_HDR:
    case OBJ_S_C_HDR:
      subtype = vms_rec[1];
      subtype = vms_rec[1];
      break;
      break;
    case EOBJ_S_C_EMH:
    case EOBJ_S_C_EMH:
      subtype = bfd_getl16 (vms_rec + 4) + EVAX_OFFSET;
      subtype = bfd_getl16 (vms_rec + 4) + EVAX_OFFSET;
      break;
      break;
    default:
    default:
      subtype = -1;
      subtype = -1;
    }
    }
 
 
#if VMS_DEBUG
#if VMS_DEBUG
  vms_debug(3, "subtype %d\n", subtype);
  vms_debug(3, "subtype %d\n", subtype);
#endif
#endif
 
 
  switch (subtype)
  switch (subtype)
    {
    {
    case MHD_S_C_MHD:
    case MHD_S_C_MHD:
      /* Module header.  */
      /* Module header.  */
      PRIV (hdr_data).hdr_b_strlvl = vms_rec[2];
      PRIV (hdr_data).hdr_b_strlvl = vms_rec[2];
      PRIV (hdr_data).hdr_l_recsiz = bfd_getl16 (vms_rec + 3);
      PRIV (hdr_data).hdr_l_recsiz = bfd_getl16 (vms_rec + 3);
      PRIV (hdr_data).hdr_t_name = _bfd_vms_save_counted_string (vms_rec + 5);
      PRIV (hdr_data).hdr_t_name = _bfd_vms_save_counted_string (vms_rec + 5);
      ptr = vms_rec + 5 + vms_rec[5] + 1;
      ptr = vms_rec + 5 + vms_rec[5] + 1;
      PRIV (hdr_data).hdr_t_version = _bfd_vms_save_counted_string (ptr);
      PRIV (hdr_data).hdr_t_version = _bfd_vms_save_counted_string (ptr);
      ptr += *ptr + 1;
      ptr += *ptr + 1;
      PRIV (hdr_data).hdr_t_date = _bfd_vms_save_sized_string (ptr, 17);
      PRIV (hdr_data).hdr_t_date = _bfd_vms_save_sized_string (ptr, 17);
      break;
      break;
 
 
    case MHD_S_C_LNM:
    case MHD_S_C_LNM:
      PRIV (hdr_data).hdr_c_lnm = _bfd_vms_save_sized_string (vms_rec, PRIV (rec_length - 2));
      PRIV (hdr_data).hdr_c_lnm = _bfd_vms_save_sized_string (vms_rec, PRIV (rec_length - 2));
      break;
      break;
 
 
    case MHD_S_C_SRC:
    case MHD_S_C_SRC:
      PRIV (hdr_data).hdr_c_src = _bfd_vms_save_sized_string (vms_rec, PRIV (rec_length - 2));
      PRIV (hdr_data).hdr_c_src = _bfd_vms_save_sized_string (vms_rec, PRIV (rec_length - 2));
      break;
      break;
 
 
    case MHD_S_C_TTL:
    case MHD_S_C_TTL:
      PRIV (hdr_data).hdr_c_ttl = _bfd_vms_save_sized_string (vms_rec, PRIV (rec_length - 2));
      PRIV (hdr_data).hdr_c_ttl = _bfd_vms_save_sized_string (vms_rec, PRIV (rec_length - 2));
      break;
      break;
 
 
    case EMH_S_C_MHD + EVAX_OFFSET:
    case EMH_S_C_MHD + EVAX_OFFSET:
      /* Module header.  */
      /* Module header.  */
      PRIV (hdr_data).hdr_b_strlvl = vms_rec[6];
      PRIV (hdr_data).hdr_b_strlvl = vms_rec[6];
      PRIV (hdr_data).hdr_l_arch1  = bfd_getl32 (vms_rec + 8);
      PRIV (hdr_data).hdr_l_arch1  = bfd_getl32 (vms_rec + 8);
      PRIV (hdr_data).hdr_l_arch2  = bfd_getl32 (vms_rec + 12);
      PRIV (hdr_data).hdr_l_arch2  = bfd_getl32 (vms_rec + 12);
      PRIV (hdr_data).hdr_l_recsiz = bfd_getl32 (vms_rec + 16);
      PRIV (hdr_data).hdr_l_recsiz = bfd_getl32 (vms_rec + 16);
      PRIV (hdr_data).hdr_t_name   = _bfd_vms_save_counted_string (vms_rec + 20);
      PRIV (hdr_data).hdr_t_name   = _bfd_vms_save_counted_string (vms_rec + 20);
      ptr = vms_rec + 20 + vms_rec[20] + 1;
      ptr = vms_rec + 20 + vms_rec[20] + 1;
      PRIV (hdr_data).hdr_t_version =_bfd_vms_save_counted_string (ptr);
      PRIV (hdr_data).hdr_t_version =_bfd_vms_save_counted_string (ptr);
      ptr += *ptr + 1;
      ptr += *ptr + 1;
      PRIV (hdr_data).hdr_t_date = _bfd_vms_save_sized_string (ptr, 17);
      PRIV (hdr_data).hdr_t_date = _bfd_vms_save_sized_string (ptr, 17);
      break;
      break;
 
 
    case EMH_S_C_LNM + EVAX_OFFSET:
    case EMH_S_C_LNM + EVAX_OFFSET:
      PRIV (hdr_data).hdr_c_lnm = _bfd_vms_save_sized_string (vms_rec, PRIV (rec_length - 6));
      PRIV (hdr_data).hdr_c_lnm = _bfd_vms_save_sized_string (vms_rec, PRIV (rec_length - 6));
      break;
      break;
 
 
    case EMH_S_C_SRC + EVAX_OFFSET:
    case EMH_S_C_SRC + EVAX_OFFSET:
      PRIV (hdr_data).hdr_c_src = _bfd_vms_save_sized_string (vms_rec, PRIV (rec_length - 6));
      PRIV (hdr_data).hdr_c_src = _bfd_vms_save_sized_string (vms_rec, PRIV (rec_length - 6));
      break;
      break;
 
 
    case EMH_S_C_TTL + EVAX_OFFSET:
    case EMH_S_C_TTL + EVAX_OFFSET:
      PRIV (hdr_data).hdr_c_ttl = _bfd_vms_save_sized_string (vms_rec, PRIV (rec_length - 6));
      PRIV (hdr_data).hdr_c_ttl = _bfd_vms_save_sized_string (vms_rec, PRIV (rec_length - 6));
      break;
      break;
 
 
    case MHD_S_C_CPR:
    case MHD_S_C_CPR:
    case MHD_S_C_MTC:
    case MHD_S_C_MTC:
    case MHD_S_C_GTX:
    case MHD_S_C_GTX:
    case EMH_S_C_CPR + EVAX_OFFSET:
    case EMH_S_C_CPR + EVAX_OFFSET:
    case EMH_S_C_MTC + EVAX_OFFSET:
    case EMH_S_C_MTC + EVAX_OFFSET:
    case EMH_S_C_GTX + EVAX_OFFSET:
    case EMH_S_C_GTX + EVAX_OFFSET:
      break;
      break;
 
 
    default:
    default:
      bfd_set_error (bfd_error_wrong_format);
      bfd_set_error (bfd_error_wrong_format);
      return -1;
      return -1;
    }
    }
 
 
  return 0;
  return 0;
}
}
 
 
/* Output routines.  */
/* Output routines.  */
 
 
/* Manufacture a VMS like time on a unix based system.
/* Manufacture a VMS like time on a unix based system.
   stolen from obj-vms.c.  */
   stolen from obj-vms.c.  */
 
 
static unsigned char *
static unsigned char *
get_vms_time_string (void)
get_vms_time_string (void)
{
{
  static unsigned char tbuf[18];
  static unsigned char tbuf[18];
#ifndef VMS
#ifndef VMS
#include <time.h>
#include <time.h>
 
 
  char *pnt;
  char *pnt;
  time_t timeb;
  time_t timeb;
 
 
  time (& timeb);
  time (& timeb);
  pnt = ctime (&timeb);
  pnt = ctime (&timeb);
  pnt[3] = 0;
  pnt[3] = 0;
  pnt[7] = 0;
  pnt[7] = 0;
  pnt[10] = 0;
  pnt[10] = 0;
  pnt[16] = 0;
  pnt[16] = 0;
  pnt[24] = 0;
  pnt[24] = 0;
  sprintf ((char *) tbuf, "%2s-%3s-%s %s",
  sprintf ((char *) tbuf, "%2s-%3s-%s %s",
           pnt + 8, pnt + 4, pnt + 20, pnt + 11);
           pnt + 8, pnt + 4, pnt + 20, pnt + 11);
#else
#else
#include <starlet.h>
#include <starlet.h>
  struct
  struct
  {
  {
    int Size;
    int Size;
    unsigned char *Ptr;
    unsigned char *Ptr;
  } Descriptor;
  } Descriptor;
  Descriptor.Size = 17;
  Descriptor.Size = 17;
  Descriptor.Ptr = tbuf;
  Descriptor.Ptr = tbuf;
  SYS$ASCTIM (0, &Descriptor, 0, 0);
  SYS$ASCTIM (0, &Descriptor, 0, 0);
#endif /* not VMS */
#endif /* not VMS */
 
 
#if VMS_DEBUG
#if VMS_DEBUG
  vms_debug (6, "vmstimestring:'%s'\n", tbuf);
  vms_debug (6, "vmstimestring:'%s'\n", tbuf);
#endif
#endif
 
 
  return tbuf;
  return tbuf;
}
}
 
 
/* Write object header for bfd abfd.  */
/* Write object header for bfd abfd.  */
 
 
int
int
_bfd_vms_write_hdr (bfd *abfd, int objtype)
_bfd_vms_write_hdr (bfd *abfd, int objtype)
{
{
  asymbol *symbol;
  asymbol *symbol;
  unsigned int symnum;
  unsigned int symnum;
  int had_case = 0;
  int had_case = 0;
  int had_file = 0;
  int had_file = 0;
 
 
#if VMS_DEBUG
#if VMS_DEBUG
  vms_debug (2, "vms_write_hdr (%p)\n", abfd);
  vms_debug (2, "vms_write_hdr (%p)\n", abfd);
#endif
#endif
 
 
  _bfd_vms_output_alignment (abfd, 2);
  _bfd_vms_output_alignment (abfd, 2);
 
 
  /* MHD.  */
  /* MHD.  */
  if (objtype != OBJ_S_C_HDR)
  if (objtype != OBJ_S_C_HDR)
    {
    {
      _bfd_vms_output_begin (abfd, EOBJ_S_C_EMH, EMH_S_C_MHD);
      _bfd_vms_output_begin (abfd, EOBJ_S_C_EMH, EMH_S_C_MHD);
      _bfd_vms_output_short (abfd, EOBJ_S_C_STRLVL);
      _bfd_vms_output_short (abfd, EOBJ_S_C_STRLVL);
      _bfd_vms_output_long (abfd, 0);
      _bfd_vms_output_long (abfd, 0);
      _bfd_vms_output_long (abfd, 0);
      _bfd_vms_output_long (abfd, 0);
      _bfd_vms_output_long (abfd, MAX_OUTREC_SIZE);
      _bfd_vms_output_long (abfd, MAX_OUTREC_SIZE);
    }
    }
 
 
  if (bfd_get_filename (abfd) != 0)
  if (bfd_get_filename (abfd) != 0)
    {
    {
      /* Strip path and suffix information.  */
      /* Strip path and suffix information.  */
      char *fname, *fout, *fptr;
      char *fname, *fout, *fptr;
 
 
      fptr = bfd_get_filename (abfd);
      fptr = bfd_get_filename (abfd);
      fname = alloca (strlen (fptr) + 1);
      fname = alloca (strlen (fptr) + 1);
      strcpy (fname, fptr);
      strcpy (fname, fptr);
      fout = strrchr (fname, ']');
      fout = strrchr (fname, ']');
      if (fout == 0)
      if (fout == 0)
        fout = strchr (fname, ':');
        fout = strchr (fname, ':');
      if (fout != 0)
      if (fout != 0)
        fout++;
        fout++;
      else
      else
        fout = fname;
        fout = fname;
 
 
      /* Strip .obj suffix.  */
      /* Strip .obj suffix.  */
      fptr = strrchr (fname, '.');
      fptr = strrchr (fname, '.');
      if ((fptr != 0)
      if ((fptr != 0)
          && (strcasecmp (fptr, ".OBJ") == 0))
          && (strcasecmp (fptr, ".OBJ") == 0))
        *fptr = 0;
        *fptr = 0;
 
 
      fptr = fout;
      fptr = fout;
      while (*fptr != 0)
      while (*fptr != 0)
        {
        {
          *fptr = TOUPPER (*fptr);
          *fptr = TOUPPER (*fptr);
          fptr++;
          fptr++;
          if ((*fptr == ';')
          if ((*fptr == ';')
             || ((fptr - fout) > 31))
             || ((fptr - fout) > 31))
            *fptr = 0;
            *fptr = 0;
        }
        }
      _bfd_vms_output_counted (abfd, fout);
      _bfd_vms_output_counted (abfd, fout);
    }
    }
  else
  else
    _bfd_vms_output_counted (abfd, "NONAME");
    _bfd_vms_output_counted (abfd, "NONAME");
 
 
  _bfd_vms_output_counted (abfd, BFD_VERSION_STRING);
  _bfd_vms_output_counted (abfd, BFD_VERSION_STRING);
  _bfd_vms_output_dump (abfd, get_vms_time_string (), 17);
  _bfd_vms_output_dump (abfd, get_vms_time_string (), 17);
  _bfd_vms_output_fill (abfd, 0, 17);
  _bfd_vms_output_fill (abfd, 0, 17);
  _bfd_vms_output_flush (abfd);
  _bfd_vms_output_flush (abfd);
 
 
  /* LMN.  */
  /* LMN.  */
  _bfd_vms_output_begin (abfd, EOBJ_S_C_EMH, EMH_S_C_LNM);
  _bfd_vms_output_begin (abfd, EOBJ_S_C_EMH, EMH_S_C_LNM);
  _bfd_vms_output_dump (abfd, (unsigned char *) STRING_COMMA_LEN ("GAS proGIS"));
  _bfd_vms_output_dump (abfd, (unsigned char *) STRING_COMMA_LEN ("GAS proGIS"));
  _bfd_vms_output_flush (abfd);
  _bfd_vms_output_flush (abfd);
 
 
  /* SRC.  */
  /* SRC.  */
  _bfd_vms_output_begin (abfd, EOBJ_S_C_EMH, EMH_S_C_SRC);
  _bfd_vms_output_begin (abfd, EOBJ_S_C_EMH, EMH_S_C_SRC);
 
 
  for (symnum = 0; symnum < abfd->symcount; symnum++)
  for (symnum = 0; symnum < abfd->symcount; symnum++)
    {
    {
      symbol = abfd->outsymbols[symnum];
      symbol = abfd->outsymbols[symnum];
 
 
      if (symbol->flags & BSF_FILE)
      if (symbol->flags & BSF_FILE)
        {
        {
          if (CONST_STRNEQ ((char *)symbol->name, "<CASE:"))
          if (CONST_STRNEQ ((char *)symbol->name, "<CASE:"))
            {
            {
              PRIV (flag_hash_long_names) = symbol->name[6] - '0';
              PRIV (flag_hash_long_names) = symbol->name[6] - '0';
              PRIV (flag_show_after_trunc) = symbol->name[7] - '0';
              PRIV (flag_show_after_trunc) = symbol->name[7] - '0';
 
 
              if (had_file)
              if (had_file)
                break;
                break;
              had_case = 1;
              had_case = 1;
              continue;
              continue;
            }
            }
 
 
          _bfd_vms_output_dump (abfd, (unsigned char *) symbol->name,
          _bfd_vms_output_dump (abfd, (unsigned char *) symbol->name,
                                (int) strlen (symbol->name));
                                (int) strlen (symbol->name));
          if (had_case)
          if (had_case)
            break;
            break;
          had_file = 1;
          had_file = 1;
        }
        }
    }
    }
 
 
  if (symnum == abfd->symcount)
  if (symnum == abfd->symcount)
    _bfd_vms_output_dump (abfd, (unsigned char *) STRING_COMMA_LEN ("noname"));
    _bfd_vms_output_dump (abfd, (unsigned char *) STRING_COMMA_LEN ("noname"));
 
 
  _bfd_vms_output_flush (abfd);
  _bfd_vms_output_flush (abfd);
 
 
  /* TTL.  */
  /* TTL.  */
  _bfd_vms_output_begin (abfd, EOBJ_S_C_EMH, EMH_S_C_TTL);
  _bfd_vms_output_begin (abfd, EOBJ_S_C_EMH, EMH_S_C_TTL);
  _bfd_vms_output_dump (abfd, (unsigned char *) STRING_COMMA_LEN ("TTL"));
  _bfd_vms_output_dump (abfd, (unsigned char *) STRING_COMMA_LEN ("TTL"));
  _bfd_vms_output_flush (abfd);
  _bfd_vms_output_flush (abfd);
 
 
  /* CPR.  */
  /* CPR.  */
  _bfd_vms_output_begin (abfd, EOBJ_S_C_EMH, EMH_S_C_CPR);
  _bfd_vms_output_begin (abfd, EOBJ_S_C_EMH, EMH_S_C_CPR);
  _bfd_vms_output_dump (abfd,
  _bfd_vms_output_dump (abfd,
                         (unsigned char *)"GNU BFD ported by Klaus Kämpf 1994-1996",
                         (unsigned char *)"GNU BFD ported by Klaus Kämpf 1994-1996",
                         39);
                         39);
  _bfd_vms_output_flush (abfd);
  _bfd_vms_output_flush (abfd);
 
 
  return 0;
  return 0;
}
}
 
 
/* Process EOM/EEOM record
/* Process EOM/EEOM record
   return 0 on success, -1 on error.  */
   return 0 on success, -1 on error.  */
 
 
int
int
_bfd_vms_slurp_eom (bfd *abfd, int objtype)
_bfd_vms_slurp_eom (bfd *abfd, int objtype)
{
{
  unsigned char *vms_rec;
  unsigned char *vms_rec;
 
 
#if VMS_DEBUG
#if VMS_DEBUG
  vms_debug(2, "EOM/EEOM\n");
  vms_debug(2, "EOM/EEOM\n");
#endif
#endif
 
 
  vms_rec = PRIV (vms_rec);
  vms_rec = PRIV (vms_rec);
 
 
  if ((objtype == OBJ_S_C_EOM)
  if ((objtype == OBJ_S_C_EOM)
     || (objtype == OBJ_S_C_EOMW))
     || (objtype == OBJ_S_C_EOMW))
    {
    {
    }
    }
  else
  else
    {
    {
      PRIV (eom_data).eom_l_total_lps = bfd_getl32 (vms_rec + 4);
      PRIV (eom_data).eom_l_total_lps = bfd_getl32 (vms_rec + 4);
      PRIV (eom_data).eom_b_comcod = *(vms_rec + 8);
      PRIV (eom_data).eom_b_comcod = *(vms_rec + 8);
 
 
      if (PRIV (eom_data).eom_b_comcod > 1)
      if (PRIV (eom_data).eom_b_comcod > 1)
        {
        {
          (*_bfd_error_handler) (_("Object module NOT error-free !\n"));
          (*_bfd_error_handler) (_("Object module NOT error-free !\n"));
          bfd_set_error (bfd_error_bad_value);
          bfd_set_error (bfd_error_bad_value);
          return -1;
          return -1;
        }
        }
      PRIV (eom_data).eom_has_transfer = FALSE;
      PRIV (eom_data).eom_has_transfer = FALSE;
      if (PRIV (rec_size) > 10)
      if (PRIV (rec_size) > 10)
        {
        {
           PRIV (eom_data).eom_has_transfer = TRUE;
           PRIV (eom_data).eom_has_transfer = TRUE;
           PRIV (eom_data).eom_b_tfrflg = *(vms_rec + 9);
           PRIV (eom_data).eom_b_tfrflg = *(vms_rec + 9);
           PRIV (eom_data).eom_l_psindx = bfd_getl32 (vms_rec + 12);
           PRIV (eom_data).eom_l_psindx = bfd_getl32 (vms_rec + 12);
           PRIV (eom_data).eom_l_tfradr = bfd_getl32 (vms_rec + 16);
           PRIV (eom_data).eom_l_tfradr = bfd_getl32 (vms_rec + 16);
 
 
           abfd->start_address = PRIV (eom_data).eom_l_tfradr;
           abfd->start_address = PRIV (eom_data).eom_l_tfradr;
        }
        }
    }
    }
  return 0;
  return 0;
}
}
 
 
/* Write eom record for bfd abfd.  */
/* Write eom record for bfd abfd.  */
 
 
int
int
_bfd_vms_write_eom (bfd *abfd, int objtype)
_bfd_vms_write_eom (bfd *abfd, int objtype)
{
{
#if VMS_DEBUG
#if VMS_DEBUG
  vms_debug (2, "vms_write_eom (%p, %d)\n", abfd, objtype);
  vms_debug (2, "vms_write_eom (%p, %d)\n", abfd, objtype);
#endif
#endif
 
 
  _bfd_vms_output_begin (abfd, objtype, -1);
  _bfd_vms_output_begin (abfd, objtype, -1);
  _bfd_vms_output_long (abfd, (unsigned long) (PRIV (vms_linkage_index) >> 1));
  _bfd_vms_output_long (abfd, (unsigned long) (PRIV (vms_linkage_index) >> 1));
  _bfd_vms_output_byte (abfd, 0);        /* Completion code.  */
  _bfd_vms_output_byte (abfd, 0);        /* Completion code.  */
  _bfd_vms_output_byte (abfd, 0);        /* Fill byte.  */
  _bfd_vms_output_byte (abfd, 0);        /* Fill byte.  */
 
 
  if (bfd_get_start_address (abfd) != (bfd_vma)-1)
  if (bfd_get_start_address (abfd) != (bfd_vma)-1)
    {
    {
      asection *section;
      asection *section;
 
 
      section = bfd_get_section_by_name (abfd, ".link");
      section = bfd_get_section_by_name (abfd, ".link");
      if (section == 0)
      if (section == 0)
        {
        {
          bfd_set_error (bfd_error_nonrepresentable_section);
          bfd_set_error (bfd_error_nonrepresentable_section);
          return -1;
          return -1;
        }
        }
      _bfd_vms_output_short (abfd, 0);
      _bfd_vms_output_short (abfd, 0);
      _bfd_vms_output_long (abfd, (unsigned long) (section->index));
      _bfd_vms_output_long (abfd, (unsigned long) (section->index));
      _bfd_vms_output_long (abfd,
      _bfd_vms_output_long (abfd,
                             (unsigned long) bfd_get_start_address (abfd));
                             (unsigned long) bfd_get_start_address (abfd));
      _bfd_vms_output_long (abfd, 0);
      _bfd_vms_output_long (abfd, 0);
    }
    }
 
 
  _bfd_vms_output_end (abfd);
  _bfd_vms_output_end (abfd);
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.