along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
/* The following type abbreviations are used:
cs counted string (ascii string with length byte)
return;
}
-
/* Increment image buffer pointer by offset */
static void
return;
}
-
/* Dump multiple bytes to section image */
static void
return;
}
-
/* Write byte to section image */
static void
return;
}
-
/* Write 2-byte word to image */
static void
return;
}
-
/* Write 4-byte long to image */
static void
return;
}
-
/* Write 8-byte quad to image */
static void
#define HIGHBIT(op) ((op & 0x80000000L) == 0x80000000L)
/* etir_sta
-
+
vms stack commands
-
+
handle sta_xxx commands in etir section
ptr points to data area in record
-
+
see table B-8 of the openVMS linker manual */
static boolean
}
else
{
- _bfd_vms_push (abfd, (uquad)(entry->symbol->value), -1);
+ _bfd_vms_push (abfd, (uquad) (entry->symbol->value), -1);
}
}
break;
return true;
}
-
/*
etir_sto
-
+
vms store commands
-
+
handle sto_xxx commands in etir section
ptr points to data area in record
-
+
see table B-9 of the openVMS linker manual */
static boolean
return false;
}
else
- image_write_q (abfd, (uquad)(entry->symbol->value)); /* FIXME, reloc */
+ image_write_q (abfd, (uquad) (entry->symbol->value)); /* FIXME, reloc */
}
break;
return false;
}
else
- image_write_q (abfd, (uquad)(entry->symbol->value)); /* FIXME, reloc */
+ image_write_q (abfd, (uquad) (entry->symbol->value)); /* FIXME, reloc */
}
break;
image_write_l (abfd, (unsigned long)0); /* FIXME, reloc */
}
else
- image_write_l (abfd, (unsigned long)(entry->symbol->value)); /* FIXME, reloc */
+ image_write_l (abfd, (unsigned long) (entry->symbol->value)); /* FIXME, reloc */
}
break;
all 32 bit signed arithmetic
all word just like a stack calculator
arguments are popped from stack, results are pushed on stack
-
+
see table B-10 of the openVMS linker manual */
static boolean
case ETIR_S_C_OPR_ADD:
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(op1 + op2), -1);
+ _bfd_vms_push (abfd, (uquad) (op1 + op2), -1);
break;
/* subtract */
case ETIR_S_C_OPR_SUB:
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(op2 - op1), -1);
+ _bfd_vms_push (abfd, (uquad) (op2 - op1), -1);
break;
/* multiply */
case ETIR_S_C_OPR_MUL:
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(op1 * op2), -1);
+ _bfd_vms_push (abfd, (uquad) (op1 * op2), -1);
break;
/* divide */
if (op2 == 0)
_bfd_vms_push (abfd, (uquad)0L, -1);
else
- _bfd_vms_push (abfd, (uquad)(op2 / op1), -1);
+ _bfd_vms_push (abfd, (uquad) (op2 / op1), -1);
break;
/* logical and */
case ETIR_S_C_OPR_AND:
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(op1 & op2), -1);
+ _bfd_vms_push (abfd, (uquad) (op1 & op2), -1);
break;
/* logical inclusive or */
case ETIR_S_C_OPR_IOR:
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(op1 | op2), -1);
+ _bfd_vms_push (abfd, (uquad) (op1 | op2), -1);
break;
/* logical exclusive or */
case ETIR_S_C_OPR_EOR:
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(op1 ^ op2), -1);
+ _bfd_vms_push (abfd, (uquad) (op1 ^ op2), -1);
break;
/* negate */
case ETIR_S_C_OPR_NEG:
op1 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(-op1), -1);
+ _bfd_vms_push (abfd, (uquad) (-op1), -1);
break;
/* complement */
case ETIR_S_C_OPR_COM:
op1 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(op1 ^ -1L), -1);
+ _bfd_vms_push (abfd, (uquad) (op1 ^ -1L), -1);
break;
/* insert field */
return true;
}
-
/* control commands
-
+
see table B-11 of the openVMS linker manual */
static boolean
return true;
}
-
/* store conditional commands
-
+
see table B-12 and B-13 of the openVMS linker manual */
static boolean
return true;
}
-
static asection *
new_section (abfd, idx)
bfd *abfd ATTRIBUTE_UNUSED;
return section;
}
-
static int
alloc_section (abfd, idx)
bfd *abfd;
return 0;
}
-
/*
* tir_sta
*
if (entry == (vms_symbol_entry *)NULL)
return 0;
- _bfd_vms_push (abfd, (unsigned long)(entry->symbol->value), -1);
+ _bfd_vms_push (abfd, (unsigned long) (entry->symbol->value), -1);
ptr += *ptr + 1;
}
break;
return ptr;
}
-
/*
* tir_sto
*
return ptr;
}
-
/*
* stack operator commands
* all 32 bit signed arithmetic
*/
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(op1 + op2), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op1 + op2), -1);
break;
case TIR_S_C_OPR_SUB:
*/
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(op2 - op1), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op2 - op1), -1);
break;
case TIR_S_C_OPR_MUL:
*/
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(op1 * op2), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op1 * op2), -1);
break;
case TIR_S_C_OPR_DIV:
if (op2 == 0)
_bfd_vms_push (abfd, (unsigned long)0L, -1);
else
- _bfd_vms_push (abfd, (unsigned long)(op2 / op1), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op2 / op1), -1);
break;
case TIR_S_C_OPR_AND:
*/
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(op1 & op2), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op1 & op2), -1);
break;
case TIR_S_C_OPR_IOR:
* logical inclusive or
*/
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(op1 | op2), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op1 | op2), -1);
break;
case TIR_S_C_OPR_EOR:
*/
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(op1 ^ op2), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op1 ^ op2), -1);
break;
case TIR_S_C_OPR_NEG:
* negate
*/
op1 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(-op1), -1);
+ _bfd_vms_push (abfd, (unsigned long) (-op1), -1);
break;
case TIR_S_C_OPR_COM:
* complement
*/
op1 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(op1 ^ -1L), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op1 ^ -1L), -1);
break;
case TIR_S_C_OPR_INSV:
return ptr;
}
-
static unsigned char *
tir_ctl (bfd *abfd, unsigned char *ptr)
/*
return ptr;
}
-
/*
* handle command from TIR section
*/
struct {
int mincod;
int maxcod;
- unsigned char * (*explain)(bfd *, unsigned char *);
+ unsigned char * (*explain) (bfd *, unsigned char *);
} tir_table[] = {
{ 0, TIR_S_C_MAXSTACOD, tir_sta }
,{ TIR_S_C_MINSTOCOD, TIR_S_C_MAXSTOCOD, tir_sto }
{
while (tir_table[i].mincod >= 0)
{
- if ( (tir_table[i].mincod <= *ptr)
+ if ( (tir_table[i].mincod <= *ptr)
&& (*ptr <= tir_table[i].maxcod))
{
ptr = tir_table[i].explain (abfd, ptr);
return ptr;
}
-
/* handle command from ETIR section */
static int
while (etir_table[i].mincod >= 0)
{
- if ( (etir_table[i].mincod <= cmd)
+ if ( (etir_table[i].mincod <= cmd)
&& (cmd <= etir_table[i].maxcod))
{
if (!etir_table[i].explain (abfd, cmd, ptr))
return 0;
}
-
/* Text Information and Relocation Records (OBJ$C_TIR)
handle tir record */
return 0;
}
-
/* Text Information and Relocation Records (EOBJ$C_ETIR)
handle etir record */
return result;
}
-
/* process ETIR record
-
+
return 0 on success, -1 on error */
int
return result;
}
-
/* process EDBG record
return 0 on success, -1 on error
-
+
not implemented yet */
int
return 0;
}
-
/* process ETBT record
return 0 on success, -1 on error
-
+
not implemented yet */
int
return 0;
}
-
/* process LNK record
return 0 on success, -1 on error
-
+
not implemented yet */
int
}
_bfd_vms_output_begin (abfd, ETIR_S_C_STO_IMM, -1);
- _bfd_vms_output_long (abfd, (unsigned long)(size));
+ _bfd_vms_output_long (abfd, (unsigned long) (size));
_bfd_vms_output_dump (abfd, cptr, size);
_bfd_vms_output_flush (abfd);
return;
}
-
/* end etir record */
static void
end_etir_record (abfd)
bfd *abfd;
{
_bfd_vms_output_pop (abfd);
- _bfd_vms_output_end (abfd);
+ _bfd_vms_output_end (abfd);
}
/* write section contents for bfd abfd */
{
#if VMS_DEBUG
- _bfd_vms_debug (4, "writing %d. section '%s' (%d bytes)\n", section->index, section->name, (int)(section->_raw_size));\r
+ _bfd_vms_debug (4, "writing %d. section '%s' (%d bytes)\n", section->index, section->name, (int) (section->_raw_size));\r
#endif
if (section->flags & SEC_RELOC)
_bfd_vms_debug (4, "sym %s in sec %s, value %08lx, addr %08lx, off %08lx, len %d: %s\n",
(*(*rptr)->sym_ptr_ptr)->name,
(*(*rptr)->sym_ptr_ptr)->section->name,
- (long)(*(*rptr)->sym_ptr_ptr)->value,
+ (long) (*(*rptr)->sym_ptr_ptr)->value,
(*rptr)->address, (*rptr)->addend,
bfd_get_reloc_size((*rptr)->howto),
(*rptr)->howto->name);
return -1;
}
- vaddr = (bfd_vma)(sptr->offset);
+ vaddr = (bfd_vma) (sptr->offset);
start_etir_record (abfd, section->index, (uquad) sptr->offset,
false);
ETIR_S_C_STA_PQ,
-1);
_bfd_vms_output_long (abfd,
- (unsigned long)(sec->index));
+ (unsigned long) (sec->index));
_bfd_vms_output_quad (abfd,
- ((uquad)(*rptr)->addend
+ ((uquad) (*rptr)->addend
+ (uquad)sym->value));
_bfd_vms_output_flush (abfd);
_bfd_vms_output_begin (abfd,
ETIR_S_C_STA_PQ,
-1);
_bfd_vms_output_long (abfd,
- (unsigned long)(sec->index));
+ (unsigned long) (sec->index));
_bfd_vms_output_quad (abfd,
- ((uquad)(*rptr)->addend
+ ((uquad) (*rptr)->addend
+ (uquad)sym->value));
_bfd_vms_output_flush (abfd);
_bfd_vms_output_begin (abfd,
sptr->size = hint_size;
#if 0
vms_output_begin(abfd, ETIR_S_C_STO_HINT_GBL, -1);
- vms_output_long(abfd, (unsigned long)(sec->index));
+ vms_output_long(abfd, (unsigned long) (sec->index));
vms_output_quad(abfd, (uquad)addr);
vms_output_counted(abfd, _bfd_vms_length_hash_symbol (abfd, sym->name, EOBJ_S_C_SYMSIZ));
return 0;
}
-
/* write traceback data for bfd abfd */
int
return 0;
}
-
/* write debug info for bfd abfd */
int