-/* evax-etir.c -- BFD back-end for ALPHA EVAX (openVMS/AXP) files.
- Copyright 1996 Free Software Foundation, Inc.
+/* evax-etir.c -- BFD back-end for ALPHA EVAX (openVMS/Alpha) files.
+ Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
ETIR record handling functions
go and read the openVMS linker manual (esp. appendix B)
if you don't know what's going on here :-)
- Written by Klaus Kรคmpf (kkaempf@progis.de)
+ Written by Klaus K"ampf (kkaempf@progis.de)
of proGIS Softwareentwicklung, Aachen, Germany
This program is free software; you can redistribute it and/or modify
qw quadword (8 byte, 64 bit)
da data stream */
-#include <stdio.h>
#include <ctype.h>
#include "bfd.h"
psect = bfd_getl32 (ptr);
if (psect >= PRIV(egsd_sec_count))
{
- (*_bfd_error_handler) ("Bad section index in ETIR_S_C_STA_PQ");
+ (*_bfd_error_handler) (_("Bad section index in ETIR_S_C_STA_PQ"));
bfd_set_error (bfd_error_bad_value);
return false;
}
case ETIR_S_C_STA_MOD:
case ETIR_S_C_STA_CKARG:
- (*_bfd_error_handler) ("Unsupported STA cmd %d", cmd);
+ (*_bfd_error_handler) (_("Unsupported STA cmd %d"), cmd);
return false;
break;
default:
- (*_bfd_error_handler) ("Reserved STA cmd %d", cmd);
+ (*_bfd_error_handler) (_("Reserved STA cmd %d"), cmd);
return false;
break;
}
entry = (evax_symbol_entry *)bfd_hash_lookup (PRIV(evax_symbol_table), name, false, false);
if (entry == (evax_symbol_entry *)NULL)
{
- (*_bfd_error_handler) ("ETIR_S_C_STO_GBL: no symbol \"%s\"",
+ (*_bfd_error_handler) (_("ETIR_S_C_STO_GBL: no symbol \"%s\""),
name);
return false;
}
entry = (evax_symbol_entry *) bfd_hash_lookup (PRIV(evax_symbol_table), name, false, false);
if (entry == (evax_symbol_entry *)NULL)
{
- (*_bfd_error_handler) ("ETIR_S_C_STO_CA: no symbol \"%s\"",
+ (*_bfd_error_handler) (_("ETIR_S_C_STO_CA: no symbol \"%s\""),
name);
return false;
}
case ETIR_S_C_STO_RB:
case ETIR_S_C_STO_AB:
- (*_bfd_error_handler) ("ETIR_S_C_STO_RB/AB: Not supported");
+ (*_bfd_error_handler) (_("ETIR_S_C_STO_RB/AB: Not supported"));
break;
/* store offset to psect: pop stack, add low 32 bits to base of psect
/* not supported */
case ETIR_S_C_STO_LP_PSB:
- (*_bfd_error_handler) ("ETIR_S_C_STO_LP_PSB: Not supported");
+ (*_bfd_error_handler) (_("ETIR_S_C_STO_LP_PSB: Not supported"));
break;
/* */
case ETIR_S_C_STO_HINT_GBL:
- (*_bfd_error_handler) ("ETIR_S_C_STO_HINT_GBL: not implemented");
+ (*_bfd_error_handler) (_("ETIR_S_C_STO_HINT_GBL: not implemented"));
break;
/* */
case ETIR_S_C_STO_HINT_PS:
- (*_bfd_error_handler) ("ETIR_S_C_STO_HINT_PS: not implemented");
+ (*_bfd_error_handler) (_("ETIR_S_C_STO_HINT_PS: not implemented"));
break;
default:
- (*_bfd_error_handler) ("Reserved STO cmd %d", cmd);
+ (*_bfd_error_handler) (_("Reserved STO cmd %d"), cmd);
break;
}
case ETIR_S_C_OPR_INSV:
(void)_bfd_evax_pop (abfd, NULL);
- (*_bfd_error_handler) ("ETIR_S_C_OPR_INSV: Not supported");
+ (*_bfd_error_handler) (_("ETIR_S_C_OPR_INSV: Not supported"));
break;
/* arithmetic shift */
/* unsigned shift */
case ETIR_S_C_OPR_USH:
- (*_bfd_error_handler) ("ETIR_S_C_OPR_USH: Not supported");
+ (*_bfd_error_handler) (_("ETIR_S_C_OPR_USH: Not supported"));
break;
/* rotate */
case ETIR_S_C_OPR_ROT:
- (*_bfd_error_handler) ("ETIR_S_C_OPR_ROT: Not supported");
+ (*_bfd_error_handler) (_("ETIR_S_C_OPR_ROT: Not supported"));
break;
/* select */
/* redefine symbol to current location */
case ETIR_S_C_OPR_REDEF:
- (*_bfd_error_handler) ("ETIR_S_C_OPR_REDEF: Not supported");
+ (*_bfd_error_handler) (_("ETIR_S_C_OPR_REDEF: Not supported"));
break;
/* define a literal */
case ETIR_S_C_OPR_DFLIT:
- (*_bfd_error_handler) ("ETIR_S_C_OPR_DFLIT: Not supported");
+ (*_bfd_error_handler) (_("ETIR_S_C_OPR_DFLIT: Not supported"));
break;
default:
- (*_bfd_error_handler) ("Reserved OPR cmd %d", cmd);
+ (*_bfd_error_handler) (_("Reserved OPR cmd %d"), cmd);
break;
}
break;
default:
- (*_bfd_error_handler) ("Reserved CTL cmd %d", cmd);
+ (*_bfd_error_handler) (_("Reserved CTL cmd %d"), cmd);
break;
}
return true;
arg: */
case ETIR_S_C_STC_LP:
- (*_bfd_error_handler) ("ETIR_S_C_STC_LP: not supported");
+ (*_bfd_error_handler) (_("ETIR_S_C_STC_LP: not supported"));
break;
/* 201 Store-conditional Linkage Pair with Procedure Signature
cs global name */
case ETIR_S_C_STC_GBL:
- (*_bfd_error_handler) ("ETIR_S_C_STC_GBL: not supported");
+ (*_bfd_error_handler) (_("ETIR_S_C_STC_GBL: not supported"));
break;
/* 203 Store-conditional Code Address at global address
cs procedure name */
case ETIR_S_C_STC_GCA:
- (*_bfd_error_handler) ("ETIR_S_C_STC_GCA: not supported");
+ (*_bfd_error_handler) (_("ETIR_S_C_STC_GCA: not supported"));
break;
/* 204 Store-conditional Address at psect + offset
qw offset */
case ETIR_S_C_STC_PS:
- (*_bfd_error_handler) ("ETIR_S_C_STC_PS: not supported");
+ (*_bfd_error_handler) (_("ETIR_S_C_STC_PS: not supported"));
break;
/* 205 Store-conditional NOP at address of global
arg: */
case ETIR_S_C_STC_NBH_PS:
- (*_bfd_error_handler) ("ETIR_S_C_STC_xx: (%d) not supported", cmd);
+/* FIXME (*_bfd_error_handler) ("ETIR_S_C_STC_xx: (%d) not supported", cmd); */
break;
default:
asection *section;
evax_section *sptr;
int nextoffset;
- char uname[200];
- char *nptr, *uptr;
#if EVAX_DEBUG
evax_debug (2, "evax_write_etir(%p)\n", abfd);
if ((i = section->reloc_count) <= 0)
{
- (*_bfd_error_handler) ("SEC_RELOC with no relocs in section %s",
+ (*_bfd_error_handler) (_("SEC_RELOC with no relocs in section %s"),
section->name);
}
#if EVAX_DEBUG
#endif
}
- if (section->flags & SEC_HAS_CONTENTS)
+ if ((section->flags & SEC_HAS_CONTENTS)
+ && (! bfd_is_com_section (section)))
{
bfd_vma vaddr; /* virtual addr in section */
_bfd_evax_output_begin (abfd,
ETIR_S_C_STO_GBL_LW,
-1);
- uptr = uname;
- nptr = (char *)sym->name;
- while (*nptr)
- {
- if (islower (*nptr))
- *uptr = toupper (*nptr);
- else
- *uptr = *nptr;
- nptr++;
- uptr++;
- }
- *uptr = 0;
- _bfd_evax_output_counted (abfd, uname);
+ _bfd_evax_output_counted (abfd,
+ _bfd_evax_length_hash_symbol (abfd, sym->name, EOBJ_S_C_SYMSIZ));
_bfd_evax_output_flush (abfd);
}
else if (bfd_is_abs_section (sym->section))
_bfd_evax_output_begin (abfd,
ETIR_S_C_STO_GBL,
-1);
- uptr = uname;
- nptr = (char *)sym->name;
- while (*nptr)
- {
- if (islower (*nptr))
- *uptr = toupper (*nptr);
- else
- *uptr = *nptr;
- nptr++;
- uptr++;
- }
- *uptr = 0;
- _bfd_evax_output_counted (abfd, uname);
+ _bfd_evax_output_counted (abfd,
+ _bfd_evax_length_hash_symbol (abfd, sym->name, EOBJ_S_C_SYMSIZ));
_bfd_evax_output_flush (abfd);
}
else if (bfd_is_abs_section (sym->section))
evax_output_begin(abfd, ETIR_S_C_STO_HINT_GBL, -1);
evax_output_long(abfd, (unsigned long)(sec->index));
evax_output_quad(abfd, (uquad)addr);
- uptr = uname;
- nptr = (char *)(*(*rptr)->sym_ptr_ptr)->name;
- while (*nptr)
- {
- if (islower (*nptr))
- *uptr = toupper (*nptr);
- else
- *uptr = *nptr;
- nptr++;
- uptr++;
- }
- *uptr = 0;
- evax_output_counted(abfd, uname);
+ evax_output_counted(abfd, _bfd_evax_length_hash_symbol (abfd, sym->name, EOBJ_S_C_SYMSIZ));
evax_output_flush(abfd);
#endif
}
break;
-#if 0
- case ALPHA_R_BRADDR:
- break;
- case ALPHA_R_SREL16:
- break;
- case ALPHA_R_SREL32:
- break;
- case ALPHA_R_SREL64:
- break;
- case ALPHA_R_OP_PUSH:
- break;
- case ALPHA_R_OP_STORE:
- break;
- case ALPHA_R_OP_PSUB:
- break;
- case ALPHA_R_OP_PRSHIFT:
- break;
-#endif
case ALPHA_R_LINKAGE:
{
if (_bfd_evax_output_check (abfd, 64) < 0)
_bfd_evax_output_long (abfd,
(unsigned long)PRIV(evax_linkage_index));
PRIV(evax_linkage_index) += 2;
- uptr = uname;
- nptr = (char *)(*(*rptr)->sym_ptr_ptr)->name;
- while (*nptr)
+ _bfd_evax_output_counted (abfd,
+ _bfd_evax_length_hash_symbol (abfd, sym->name, EOBJ_S_C_SYMSIZ));
+ _bfd_evax_output_byte (abfd, 0);
+ _bfd_evax_output_flush (abfd);
+ }
+ break;
+
+ case ALPHA_R_CODEADDR:
+ {
+ if (_bfd_evax_output_check (abfd,
+ strlen((char *)sym->name))
+ < 0)
{
- if (islower (*nptr))
- *uptr = toupper (*nptr);
- else
- *uptr = *nptr;
- nptr++;
- uptr++;
+ end_etir_record (abfd);
+ start_etir_record (abfd,
+ section->index,
+ vaddr, false);
}
- *uptr = 0;
- _bfd_evax_output_counted (abfd, uname);
- _bfd_evax_output_byte (abfd, 0);
+ _bfd_evax_output_begin (abfd,
+ ETIR_S_C_STO_CA,
+ -1);
+ _bfd_evax_output_counted (abfd,
+ _bfd_evax_length_hash_symbol (abfd, sym->name, EOBJ_S_C_SYMSIZ));
_bfd_evax_output_flush (abfd);
}
break;
default:
- (*_bfd_error_handler) ("Unhandled relocation %s",
+ (*_bfd_error_handler) (_("Unhandled relocation %s"),
(*rptr)->howto->name);
break;
}