standard requires. */
static void
-DEFUN (ieee_write_byte, (abfd, byte),
- bfd * abfd AND
- bfd_byte byte)
+ieee_write_byte (abfd, byte)
+ bfd *abfd;
+ bfd_byte byte;
{
- bfd_write ((PTR) & byte, 1, 1, abfd);
+ if (bfd_write ((PTR) & byte, 1, 1, abfd) != 1)
+ abort ();
}
static void
-DEFUN (ieee_write_twobyte, (abfd, twobyte),
- bfd * abfd AND
- int twobyte)
+ieee_write_twobyte (abfd, twobyte)
+ bfd *abfd;
+ int twobyte;
{
bfd_byte b[2];
b[1] = twobyte & 0xff;
b[0] = twobyte >> 8;
- bfd_write ((PTR) & b[0], 1, 2, abfd);
+ if (bfd_write ((PTR) & b[0], 1, 2, abfd) != 2)
+ abort ();
}
static void
-DEFUN (ieee_write_2bytes, (abfd, bytes),
- bfd * abfd AND
- int bytes)
+ieee_write_2bytes (abfd, bytes)
+ bfd *abfd;
+ int bytes;
{
bfd_byte buffer[2];
buffer[0] = bytes >> 8;
buffer[1] = bytes & 0xff;
- bfd_write ((PTR) buffer, 1, 2, abfd);
+ if (bfd_write ((PTR) buffer, 1, 2, abfd) != 2)
+ abort ();
}
static void
-DEFUN (ieee_write_int, (abfd, value),
- bfd * abfd AND
- bfd_vma value)
+ieee_write_int (abfd, value)
+ bfd *abfd;
+ bfd_vma value;
{
if (((unsigned) value) <= 127)
{
}
static void
-DEFUN (ieee_write_id, (abfd, id),
- bfd * abfd AND
- CONST char *id)
+ieee_write_id (abfd, id)
+ bfd *abfd;
+ CONST char *id;
{
size_t length = strlen (id);
if (length <= 127)
{
BFD_FAIL ();
}
- bfd_write ((PTR) id, 1, length, abfd);
+ if (bfd_write ((PTR) id, 1, length, abfd) != length)
+ abort ();
}
\f
#define this_byte_and_next(ieee) (*((ieee)->input_p++))
static unsigned short
-DEFUN (read_2bytes, (ieee),
- common_header_type * ieee)
+read_2bytes (ieee)
+ common_header_type *ieee;
{
unsigned char c1 = this_byte_and_next (ieee);
unsigned char c2 = this_byte_and_next (ieee);
}
static void
-DEFUN (bfd_get_string, (ieee, string, length),
- common_header_type * ieee AND
- char *string AND
- size_t length)
+bfd_get_string (ieee, string, length)
+ common_header_type *ieee;
+ char *string;
+ size_t length;
{
size_t i;
for (i = 0; i < length; i++)
}
static char *
-DEFUN (read_id, (ieee),
- common_header_type * ieee)
+read_id (ieee)
+ common_header_type *ieee;
{
size_t length;
char *string;
string = bfd_alloc (ieee->abfd, length + 1);
if (!string)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return NULL;
}
bfd_get_string (ieee, string, length);
}
static void
-DEFUN (ieee_write_expression, (abfd, value, symbol, pcrel, index),
- bfd * abfd AND
- bfd_vma value AND
- asymbol * symbol AND
- boolean pcrel AND
- unsigned int index)
+ieee_write_expression (abfd, value, symbol, pcrel, index)
+ bfd *abfd;
+ bfd_vma value;
+ asymbol *symbol;
+ boolean pcrel;
+ unsigned int index;
{
unsigned int term_count = 0;
writes any integer into the buffer supplied and always takes 5 bytes
*/
static void
-DEFUN (ieee_write_int5, (buffer, value),
- bfd_byte * buffer AND
- bfd_vma value)
+ieee_write_int5 (buffer, value)
+ bfd_byte *buffer;
+ bfd_vma value;
{
buffer[0] = (bfd_byte) ieee_number_repeat_4_enum;
buffer[1] = (value >> 24) & 0xff;
}
static void
-DEFUN (ieee_write_int5_out, (abfd, value),
- bfd * abfd AND
- bfd_vma value)
+ieee_write_int5_out (abfd, value)
+ bfd *abfd;
+ bfd_vma value;
{
bfd_byte b[5];
ieee_write_int5 (b, value);
- bfd_write ((PTR) b, 1, 5, abfd);
+ if (bfd_write ((PTR) b, 1, 5, abfd) != 5)
+ abort ();
}
static boolean
-DEFUN (parse_int, (ieee, value_ptr),
- common_header_type * ieee AND
- bfd_vma * value_ptr)
+parse_int (ieee, value_ptr)
+ common_header_type *ieee;
+ bfd_vma *value_ptr;
{
int value = this_byte (ieee);
int result;
}
static int
-DEFUN (parse_i, (ieee, ok),
- common_header_type * ieee AND
- boolean * ok)
+parse_i (ieee, ok)
+ common_header_type *ieee;
+ boolean *ok;
{
bfd_vma x;
*ok = parse_int (ieee, &x);
}
static bfd_vma
-DEFUN (must_parse_int, (ieee),
- common_header_type * ieee)
+must_parse_int (ieee)
+ common_header_type *ieee;
{
bfd_vma result;
BFD_ASSERT (parse_int (ieee, &result) == true);
static void
-DEFUN (parse_expression, (ieee, value, symbol, pcrel, extra, section),
- ieee_data_type * ieee AND
- bfd_vma * value AND
- ieee_symbol_index_type * symbol AND
- boolean * pcrel AND
- unsigned int *extra AND
- asection ** section)
+parse_expression (ieee, value, symbol, pcrel, extra, section)
+ ieee_data_type *ieee;
+ bfd_vma *value;
+ ieee_symbol_index_type *symbol;
+ boolean *pcrel;
+ unsigned int *extra;
+ asection **section;
{
#define POS sp[1]
static char last_type; /* is the index for an X or a D */
static ieee_symbol_type *
-DEFUN (get_symbol, (abfd,
- ieee,
- last_symbol,
- symbol_count,
- pptr,
- max_index,
- this_type
- ),
- bfd * abfd AND
- ieee_data_type * ieee AND
- ieee_symbol_type * last_symbol AND
- unsigned int *symbol_count AND
- ieee_symbol_type *** pptr AND
- unsigned int *max_index AND
- char this_type
+get_symbol (abfd,
+ ieee,
+ last_symbol,
+ symbol_count,
+ pptr,
+ max_index,
+ this_type
)
+ bfd *abfd;
+ ieee_data_type *ieee;
+ ieee_symbol_type *last_symbol;
+ unsigned int *symbol_count;
+ ieee_symbol_type ***pptr;
+ unsigned int *max_index;
+ char this_type
+ ;
{
/* Need a new symbol */
unsigned int new_index = must_parse_int (&(ieee->h));
sizeof (ieee_symbol_type));
if (!new_symbol)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return NULL;
}
return last_symbol;
}
-static void
-DEFUN (ieee_slurp_external_symbols, (abfd),
- bfd * abfd)
+static boolean
+ieee_slurp_external_symbols (abfd)
+ bfd *abfd;
{
ieee_data_type *ieee = IEEE_DATA (abfd);
file_ptr offset = ieee->w.r.external_part;
symbol = get_symbol (abfd, ieee, symbol, &symbol_count,
&prev_symbols_ptr,
&ieee->external_symbol_max_index, 'D');
-
+ if (symbol == NULL)
+ return false;
symbol->symbol.the_bfd = abfd;
symbol->symbol.name = read_id (&(ieee->h));
symbol = get_symbol (abfd, ieee, symbol, &symbol_count,
&prev_symbols_ptr,
&ieee->external_symbol_max_index, 'D');
-
+ if (symbol == NULL)
+ return false;
BFD_ASSERT (symbol->index >= ieee->external_symbol_min_index);
symbol = get_symbol (abfd, ieee, symbol, &symbol_count,
&prev_reference_ptr,
&ieee->external_reference_max_index, 'X');
-
+ if (symbol == NULL)
+ return false;
symbol->symbol.the_bfd = abfd;
symbol->symbol.name = read_id (&(ieee->h));
*prev_symbols_ptr = (ieee_symbol_type *) NULL;
*prev_reference_ptr = (ieee_symbol_type *) NULL;
+
+ return true;
}
-static void
-DEFUN (ieee_slurp_symbol_table, (abfd),
- bfd * abfd)
+static boolean
+ieee_slurp_symbol_table (abfd)
+ bfd *abfd;
{
if (IEEE_DATA (abfd)->read_symbols == false)
{
- ieee_slurp_external_symbols (abfd);
+ if (! ieee_slurp_external_symbols (abfd))
+ return false;
IEEE_DATA (abfd)->read_symbols = true;
}
+ return true;
}
-unsigned int
-DEFUN (ieee_get_symtab_upper_bound, (abfd),
- bfd * abfd)
+long
+ieee_get_symtab_upper_bound (abfd)
+ bfd *abfd;
{
- ieee_slurp_symbol_table (abfd);
+ if (! ieee_slurp_symbol_table (abfd))
+ return -1;
return (abfd->symcount != 0) ?
(abfd->symcount + 1) * (sizeof (ieee_symbol_type *)) : 0;
extern bfd_target ieee_vec;
-unsigned int
-DEFUN (ieee_get_symtab, (abfd, location),
- bfd * abfd AND
- asymbol ** location)
+long
+ieee_get_symtab (abfd, location)
+ bfd *abfd;
+ asymbol **location;
{
ieee_symbol_type *symp;
static bfd dummy_bfd;
{
ieee_data_type *ieee = IEEE_DATA (abfd);
dummy_bfd.xvec = &ieee_vec;
- ieee_slurp_symbol_table (abfd);
+ if (! ieee_slurp_symbol_table (abfd))
+ return -1;
if (ieee->symbol_table_full == false)
{
}
static asection *
-DEFUN (get_section_entry, (abfd, ieee, index),
- bfd * abfd AND
- ieee_data_type * ieee AND
- unsigned int index)
+get_section_entry (abfd, ieee, index)
+ bfd *abfd;
+ ieee_data_type *ieee;
+ unsigned int index;
{
if (ieee->section_table[index] == (asection *) NULL)
{
if (!tmp)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return NULL;
}
sprintf (tmp, " fsec%4d", index);
}
static void
-DEFUN (ieee_slurp_sections, (abfd),
- bfd * abfd)
+ieee_slurp_sections (abfd)
+ bfd *abfd;
{
ieee_data_type *ieee = IEEE_DATA (abfd);
file_ptr offset = ieee->w.r.section_part;
*/
bfd_target *
-DEFUN (ieee_archive_p, (abfd),
- bfd * abfd)
+ieee_archive_p (abfd)
+ bfd *abfd;
{
char *library;
boolean loop;
abfd->tdata.ieee_ar_data = (ieee_ar_data_type *) bfd_alloc (abfd, sizeof (ieee_ar_data_type));
if (!abfd->tdata.ieee_ar_data)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return NULL;
}
ieee = IEEE_AR_DATA (abfd);
+ /* FIXME: Check return value. I'm not sure whether it needs to read
+ the entire buffer or not. */
bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd);
ieee->h.first_byte = buffer;
if (!obstack_begin (&ob, 128))
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return (bfd_target *) NULL;
}
{
/* Past half way, reseek and reprime */
buffer_offset += ieee_pos (abfd);
- bfd_seek (abfd, buffer_offset, SEEK_SET);
+ if (bfd_seek (abfd, buffer_offset, SEEK_SET) != 0)
+ return NULL;
+ /* FIXME: Check return value. I'm not sure whether it
+ needs to read the entire buffer or not. */
bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd);
ieee->h.first_byte = buffer;
ieee->h.input_p = buffer;
ieee->elements = (ieee_ar_obstack_type *) obstack_finish (&ob);
if (!ieee->elements)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return (bfd_target *) NULL;
}
for (i = 2; i < ieee->element_count; i++)
{
- bfd_seek (abfd, ieee->elements[i].file_offset, SEEK_SET);
+ if (bfd_seek (abfd, ieee->elements[i].file_offset, SEEK_SET) != 0)
+ return NULL;
+ /* FIXME: Check return value. I'm not sure whether it needs to
+ read the entire buffer or not. */
bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd);
ieee->h.first_byte = buffer;
ieee->h.input_p = buffer;
}
static boolean
-DEFUN (ieee_mkobject, (abfd),
- bfd * abfd)
+ieee_mkobject (abfd)
+ bfd *abfd;
{
abfd->tdata.ieee_data = (ieee_data_type *) bfd_zalloc (abfd, sizeof (ieee_data_type));
return abfd->tdata.ieee_data ? true : false;
}
bfd_target *
-DEFUN (ieee_object_p, (abfd),
- bfd * abfd)
+ieee_object_p (abfd)
+ bfd *abfd;
{
char *processor;
unsigned int part;
ieee_mkobject (abfd);
ieee = IEEE_DATA (abfd);
- bfd_seek (abfd, (file_ptr) 0, SEEK_SET);
+ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
+ goto fail;
/* Read the first few bytes in to see if it makes sense */
+ /* FIXME: Check return value. I'm not sure whether it needs to read
+ the entire buffer or not. */
bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd);
ieee->h.input_p = buffer;
+ 50);
if (!IEEE_DATA (abfd)->h.first_byte)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
goto fail;
}
- bfd_seek (abfd, (file_ptr) 0, SEEK_SET);
+ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
+ goto fail;
+ /* FIXME: Check return value. I'm not sure whether it needs to read
+ the entire buffer or not. */
bfd_read ((PTR) (IEEE_DATA (abfd)->h.first_byte), 1, ieee->w.r.me_record + 50, abfd);
ieee_slurp_sections (abfd);
}
void
-DEFUN (ieee_get_symbol_info, (ignore_abfd, symbol, ret),
- bfd * ignore_abfd AND
- asymbol * symbol AND
- symbol_info * ret)
+ieee_get_symbol_info (ignore_abfd, symbol, ret)
+ bfd *ignore_abfd;
+ asymbol *symbol;
+ symbol_info *ret;
{
bfd_symbol_info (symbol, ret);
if (symbol->name[0] == ' ')
}
void
-DEFUN (ieee_print_symbol, (ignore_abfd, afile, symbol, how),
- bfd * ignore_abfd AND
- PTR afile AND
- asymbol * symbol AND
- bfd_print_symbol_type how)
+ieee_print_symbol (ignore_abfd, afile, symbol, how)
+ bfd *ignore_abfd;
+ PTR afile;
+ asymbol *symbol;
+ bfd_print_symbol_type how;
{
FILE *file = (FILE *) afile;
}
static boolean
-DEFUN (do_one, (ieee, current_map, location_ptr, s),
- ieee_data_type * ieee AND
- ieee_per_section_type * current_map AND
- unsigned char *location_ptr AND
- asection * s)
+do_one (ieee, current_map, location_ptr, s)
+ ieee_data_type *ieee;
+ ieee_per_section_type *current_map;
+ unsigned char *location_ptr;
+ asection *s;
{
switch (this_byte (&(ieee->h)))
{
sizeof (ieee_reloc_type));
if (!r)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
/* Read in all the section data and relocation stuff too */
static boolean
-DEFUN (ieee_slurp_section_data, (abfd),
- bfd * abfd)
+ieee_slurp_section_data (abfd)
+ bfd *abfd;
{
bfd_byte *location_ptr = (bfd_byte *) NULL;
ieee_data_type *ieee = IEEE_DATA (abfd);
per->data = (bfd_byte *) bfd_alloc (ieee->h.abfd, s->_raw_size);
if (!per->data)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
/*SUPPRESS 68*/
}
boolean
-DEFUN (ieee_new_section_hook, (abfd, newsect),
- bfd * abfd AND
- asection * newsect)
+ieee_new_section_hook (abfd, newsect)
+ bfd *abfd;
+ asection *newsect;
{
newsect->used_by_bfd = (PTR)
bfd_alloc (abfd, sizeof (ieee_per_section_type));
if (!newsect->used_by_bfd)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
ieee_per_section (newsect)->data = (bfd_byte *) NULL;
return true;
}
-unsigned int
-DEFUN (ieee_get_reloc_upper_bound, (abfd, asect),
- bfd * abfd AND
- sec_ptr asect)
+long
+ieee_get_reloc_upper_bound (abfd, asect)
+ bfd *abfd;
+ sec_ptr asect;
{
- ieee_slurp_section_data (abfd);
+ if (! ieee_slurp_section_data (abfd))
+ return -1;
return (asect->reloc_count + 1) * sizeof (arelent *);
}
static boolean
-DEFUN (ieee_get_section_contents, (abfd, section, location, offset, count),
- bfd * abfd AND
- sec_ptr section AND
- PTR location AND
- file_ptr offset AND
- bfd_size_type count)
+ieee_get_section_contents (abfd, section, location, offset, count)
+ bfd *abfd;
+ sec_ptr section;
+ PTR location;
+ file_ptr offset;
+ bfd_size_type count;
{
ieee_per_section_type *p = (ieee_per_section_type *) section->used_by_bfd;
ieee_slurp_section_data (abfd);
return true;
}
-unsigned int
-DEFUN (ieee_canonicalize_reloc, (abfd, section, relptr, symbols),
- bfd * abfd AND
- sec_ptr section AND
- arelent ** relptr AND
- asymbol ** symbols)
+long
+ieee_canonicalize_reloc (abfd, section, relptr, symbols)
+ bfd *abfd;
+ sec_ptr section;
+ arelent **relptr;
+ asymbol **symbols;
{
/* ieee_per_section_type *p = (ieee_per_section_type *) section->used_by_bfd;*/
ieee_reloc_type *src = (ieee_reloc_type *) (section->relocation);
}
static int
-DEFUN (comp, (ap, bp),
- CONST PTR ap AND
- CONST PTR bp)
+comp (ap, bp)
+ CONST PTR ap;
+ CONST PTR bp;
{
arelent *a = *((arelent **) ap);
arelent *b = *((arelent **) bp);
*/
static void
-DEFUN (ieee_write_section_part, (abfd),
- bfd * abfd)
+ieee_write_section_part (abfd)
+ bfd *abfd;
{
ieee_data_type *ieee = IEEE_DATA (abfd);
asection *s;
static boolean
-DEFUN (do_with_relocs, (abfd, s),
- bfd * abfd AND
- asection * s)
+do_with_relocs (abfd, s)
+ bfd *abfd;
+ asection *s;
{
unsigned int relocs_to_go = s->reloc_count;
ieee_write_byte (abfd, ieee_load_constant_bytes_enum);
/* Output a stream of bytes */
ieee_write_int (abfd, run);
- bfd_write ((PTR) (stream + current_byte_index),
- 1,
- run,
- abfd);
+ if (bfd_write ((PTR) (stream + current_byte_index),
+ 1,
+ run,
+ abfd)
+ != run)
+ return false;
current_byte_index += run;
}
}
stream = (unsigned char *) (bfd_alloc (abfd, s->_raw_size));
if (!stream)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
memset ((PTR) stream, 0, s->_raw_size);
{
/* Output a stream of bytes */
ieee_write_int (abfd, run);
- bfd_write ((PTR) (stream + current_byte_index),
- 1,
- run,
- abfd);
+ if (bfd_write ((PTR) (stream + current_byte_index),
+ 1,
+ run,
+ abfd)
+ != run)
+ return false;
current_byte_index += run;
}
/* Output any relocations here */
bytes */
static void
-DEFUN (do_as_repeat, (abfd, s),
- bfd * abfd AND
- asection * s)
+do_as_repeat (abfd, s)
+ bfd *abfd;
+ asection *s;
{
if (s->_raw_size)
{
}
static void
-DEFUN (do_without_relocs, (abfd, s),
- bfd * abfd AND
- asection * s)
+do_without_relocs (abfd, s)
+ bfd *abfd;
+ asection *s;
{
bfd_byte *stream = ieee_per_section (s)->data;
static bfd *output_bfd;
static int output_buffer;
-static void
+static void
fill ()
{
+ /* FIXME: Check return value. I'm not sure whether it needs to read
+ the entire buffer or not. */
bfd_read ((PTR) input_ptr_start, 1, input_ptr_end - input_ptr_start, input_bfd);
input_ptr = input_ptr_start;
}
-static void
+static void
flush ()
{
- bfd_write ((PTR) (output_ptr_start), 1, output_ptr - output_ptr_start, output_bfd);
+ if (bfd_write ((PTR) (output_ptr_start), 1, output_ptr - output_ptr_start,
+ output_bfd)
+ != output_ptr - output_ptr_start)
+ abort ();
output_ptr = output_ptr_start;
output_buffer++;
}
#define NEXT() { input_ptr++; if (input_ptr == input_ptr_end) fill(); }
#define OUT(x) { *output_ptr++ = (x); if(output_ptr == output_ptr_end) flush(); }
-static void
+static void
write_int (value)
int value;
{
}
}
-static void
+static void
copy_id ()
{
int length = THIS ();
}
#define VAR(x) ((x | 0x80))
-static void
+static void
copy_expression ()
{
int stack[10];
};
static void
-DEFUN (fill_int, (buf),
- struct output_buffer_struct *buf)
+fill_int (buf)
+ struct output_buffer_struct *buf;
{
if (buf->buffer == output_buffer)
{
}
static void
-DEFUN (drop_int, (buf),
- struct output_buffer_struct *buf)
+drop_int (buf)
+ struct output_buffer_struct *buf;
{
int type = THIS ();
int ch;
OUT (0);
}
-static void
+static void
copy_int ()
{
int type = THIS ();
#define INTn(q) copy_int()
#define EXPn(q) copy_expression()
-static void
+static void
f1_record ()
{
int ch;
}
-static void
+static void
f0_record ()
{
/* Attribute record */
ID;
}
-static void
+static void
copy_till_end ()
{
int ch = THIS ();
}
-static void
+static void
f2_record ()
{
NEXT ();
static void block ();
-static void
+static void
f8_record ()
{
int ch;
}
}
-static void
+static void
e2_record ()
{
OUT (0xe2);
EXP;
}
-static void
-DEFUN_VOID (block)
+static void
+block ()
{
int ch;
while (1)
*/
static void
-DEFUN (relocate_debug, (output, input),
- bfd * output AND
- bfd * input)
+relocate_debug (output, input)
+ bfd *output;
+ bfd *input;
{
#define IBS 400
#define OBS 400
input_ptr_start = input_ptr = input_buffer;
input_ptr_end = input_buffer + IBS;
input_bfd = input;
+ /* FIXME: Check return value. I'm not sure whether it needs to read
+ the entire buffer or not. */
bfd_read ((PTR) input_ptr_start, 1, IBS, input);
block ();
}
*/
static void
-DEFUN (ieee_write_debug_part, (abfd),
- bfd * abfd)
+ieee_write_debug_part (abfd)
+ bfd *abfd;
{
ieee_data_type *ieee = IEEE_DATA (abfd);
bfd_chain_type *chain = ieee->chain_root;
ieee_data_type *entry_ieee = IEEE_DATA (entry);
if (entry_ieee->w.r.debug_information_part)
{
- bfd_seek (entry, entry_ieee->w.r.debug_information_part, SEEK_SET);
+ if (bfd_seek (entry, entry_ieee->w.r.debug_information_part,
+ SEEK_SET)
+ != 0)
+ abort ();
relocate_debug (abfd, entry);
}
/* write the data in an ieee way */
static void
-DEFUN (ieee_write_data_part, (abfd),
- bfd * abfd)
+ieee_write_data_part (abfd)
+ bfd *abfd;
{
asection *s;
ieee_data_type *ieee = IEEE_DATA (abfd);
static boolean
-DEFUN (init_for_output, (abfd),
- bfd * abfd)
+init_for_output (abfd)
+ bfd *abfd;
{
asection *s;
for (s = abfd->sections; s != (asection *) NULL; s = s->next)
ieee_per_section (s)->data = (bfd_byte *) (bfd_alloc (abfd, s->_raw_size));
if (!ieee_per_section (s)->data)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
}
* not a byte image, but a record stream.
*/
boolean
-DEFUN (ieee_set_section_contents, (abfd, section, location, offset, count),
- bfd * abfd AND
- sec_ptr section AND
- PTR location AND
- file_ptr offset AND
- bfd_size_type count)
+ieee_set_section_contents (abfd, section, location, offset, count)
+ bfd *abfd;
+ sec_ptr section;
+ PTR location;
+ file_ptr offset;
+ bfd_size_type count;
{
if (ieee_per_section (section)->data == (bfd_byte *) NULL)
{
values into indexes from the right base.
*/
static void
-DEFUN (ieee_write_external_part, (abfd),
- bfd * abfd)
+ieee_write_external_part (abfd)
+ bfd *abfd;
{
asymbol **q;
ieee_data_type *ieee = IEEE_DATA (abfd);
static
void
-DEFUN (ieee_write_me_part, (abfd),
- bfd * abfd)
+ieee_write_me_part (abfd)
+ bfd *abfd;
{
ieee_data_type *ieee = IEEE_DATA (abfd);
ieee->w.r.trailer_part = bfd_tell (abfd);
}
boolean
-DEFUN (ieee_write_object_contents, (abfd),
- bfd * abfd)
+ieee_write_object_contents (abfd)
+ bfd *abfd;
{
ieee_data_type *ieee = IEEE_DATA (abfd);
unsigned int i;
file_ptr old;
/* Fast forward over the header area */
- bfd_seek (abfd, (file_ptr) 0, SEEK_SET);
+ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
+ return false;
ieee_write_byte (abfd, ieee_module_beginning_enum);
ieee_write_id (abfd, bfd_printable_name (abfd));
(bfd_byte) (bfd_arch_bits_per_address (abfd) / bfd_arch_bits_per_byte (abfd)));
old = bfd_tell (abfd);
- bfd_seek (abfd, (file_ptr) (8 * N_W_VARIABLES), SEEK_CUR);
+ if (bfd_seek (abfd, (file_ptr) (8 * N_W_VARIABLES), SEEK_CUR) != 0)
+ return false;
ieee->w.r.extension_record = bfd_tell (abfd);
- bfd_write ((char *) exten, 1, sizeof (exten), abfd);
+ if (bfd_write ((char *) exten, 1, sizeof (exten), abfd) != sizeof (exten))
+ return false;
if (abfd->flags & EXEC_P)
ieee_write_byte (abfd, 0x1);/* Absolute */
else
ieee_write_byte (abfd, 0x2);/* Relocateable */
ieee->w.r.environmental_record = bfd_tell (abfd);
- bfd_write ((char *) envi, 1, sizeof (envi), abfd);
+ if (bfd_write ((char *) envi, 1, sizeof (envi), abfd) != sizeof (envi))
+ return false;
output_bfd = abfd;
flush ();
/* Generate the header */
- bfd_seek (abfd, old, SEEK_SET);
+ if (bfd_seek (abfd, old, SEEK_SET) != 0)
+ return false;
for (i = 0; i < N_W_VARIABLES; i++)
{
hold them all plus all the cached symbol entries. */
asymbol *
-DEFUN (ieee_make_empty_symbol, (abfd),
- bfd * abfd)
+ieee_make_empty_symbol (abfd)
+ bfd *abfd;
{
ieee_symbol_type *new =
(ieee_symbol_type *) bfd_zmalloc (sizeof (ieee_symbol_type));
if (!new)
{
- bfd_error = no_error;
+ bfd_set_error (bfd_error_no_error);
return NULL;
}
new->symbol.the_bfd = abfd;
}
static bfd *
-DEFUN (ieee_openr_next_archived_file, (arch, prev),
- bfd * arch AND
- bfd * prev)
+ieee_openr_next_archived_file (arch, prev)
+ bfd *arch;
+ bfd *prev;
{
ieee_ar_data_type *ar = IEEE_AR_DATA (arch);
/* take the next one from the arch state, or reset */
}
else
{
- bfd_error = no_more_archived_files;
+ bfd_set_error (bfd_error_no_more_archived_files);
return (bfd *) NULL;
}
ieee_ar_data_type *ar = abfd->my_archive->tdata.ieee_ar_data;
if (ar == (ieee_ar_data_type *) NULL)
{
- bfd_error = invalid_operation;
+ bfd_set_error (bfd_error_invalid_operation);
return -1;
}
else
}
static int
-DEFUN (ieee_sizeof_headers, (abfd, x),
- bfd * abfd AND
- boolean x)
+ieee_sizeof_headers (abfd, x)
+ bfd *abfd;
+ boolean x;
{
return 0;
}
+/* The debug info routines are never used. */
+#if 0
+
static void
-DEFUN (ieee_bfd_debug_info_start, (abfd),
- bfd * abfd)
+ieee_bfd_debug_info_start (abfd)
+ bfd *abfd;
{
}
static void
-DEFUN (ieee_bfd_debug_info_end, (abfd),
- bfd * abfd)
+ieee_bfd_debug_info_end (abfd)
+ bfd *abfd;
{
}
be ready to output it at close time
*/
static void
-DEFUN (ieee_bfd_debug_info_accumulate, (abfd, section),
- bfd * abfd AND
- asection * section)
+ieee_bfd_debug_info_accumulate (abfd, section)
+ bfd *abfd;
+ asection *section;
{
ieee_data_type *ieee = IEEE_DATA (section->owner);
ieee_data_type *output_ieee = IEEE_DATA (abfd);
bfd_chain_type *n = (bfd_chain_type *) bfd_alloc (abfd, sizeof (bfd_chain_type));
if (!n)
{
- bfd_error = no_memory;
- abort(); /* FIXME */
+ bfd_set_error (bfd_error_no_memory);
+ abort (); /* FIXME */
}
n->this = section->owner;
n->next = (bfd_chain_type *) NULL;
}
}
+#endif
+
+#define ieee_close_and_cleanup _bfd_generic_close_and_cleanup
+#define ieee_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
-#define FOO PROTO
-#define ieee_core_file_failing_command (char *(*)())(bfd_nullvoidptr)
-#define ieee_core_file_failing_signal (int (*)())bfd_0
-#define ieee_core_file_matches_executable_p ( FOO(boolean, (*),(bfd *, bfd *)))bfd_false
#define ieee_slurp_armap bfd_true
#define ieee_slurp_extended_name_table bfd_true
-#define ieee_truncate_arname (void (*)())bfd_nullvoidptr
-#define ieee_write_armap (FOO( boolean, (*),(bfd *, unsigned int, struct orl *, unsigned int, int))) bfd_nullvoidptr
-#define ieee_get_lineno (struct lineno_cache_entry *(*)())bfd_nullvoidptr
-#define ieee_close_and_cleanup bfd_generic_close_and_cleanup
-#define ieee_set_arch_mach bfd_default_set_arch_mach
-#define ieee_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
+#define ieee_truncate_arname bfd_dont_truncate_arname
+#define ieee_write_armap \
+ ((boolean (*) \
+ PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int))) \
+ bfd_true)
+
+#define ieee_bfd_is_local_label bfd_generic_is_local_label
+#define ieee_get_lineno _bfd_nosymbols_get_lineno
+#define ieee_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+
+#define ieee_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
+
+#define ieee_set_arch_mach _bfd_generic_set_arch_mach
+
+#define ieee_bfd_get_relocated_section_contents \
+ bfd_generic_get_relocated_section_contents
#define ieee_bfd_relax_section bfd_generic_relax_section
-#define ieee_bfd_reloc_type_lookup \
- ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr)
-#define ieee_bfd_make_debug_symbol \
- ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
#define ieee_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define ieee_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define ieee_bfd_final_link _bfd_generic_final_link
_bfd_write_archive_contents,
bfd_false,
},
- JUMP_TABLE (ieee),
+
+ BFD_JUMP_TABLE_GENERIC (ieee),
+ BFD_JUMP_TABLE_COPY (_bfd_generic),
+ BFD_JUMP_TABLE_CORE (_bfd_nocore),
+ BFD_JUMP_TABLE_ARCHIVE (ieee),
+ BFD_JUMP_TABLE_SYMBOLS (ieee),
+ BFD_JUMP_TABLE_RELOCS (ieee),
+ BFD_JUMP_TABLE_WRITE (ieee),
+ BFD_JUMP_TABLE_LINK (ieee),
+
(PTR) 0
};