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