#include "obstack.h"
-#define obstack_chunk_alloc bfd_xmalloc
+#define obstack_chunk_alloc bfd_xmalloc_by_size_t
#define obstack_chunk_free free
/* Functions for writing to ieee files in the strange way that the
CONST char *id)
{
size_t length = strlen(id);
- if (length >= 0 && length <= 127) {
+ if (length <= 127) {
ieee_write_byte(abfd, (bfd_byte)length);
}
else if (length < 255) {
size_t length;
char *string;
length = this_byte_and_next(ieee);
- if (length >= 0x00 && length <= 0x7f) {
+ if (length <= 0x7f) {
/* Simple string of length 0 to 127 */
}
else if (length == 0xde) {
static
reloc_howto_type abs32_howto
- = HOWTO(1,0,2,32,false,0,false,true,0,"abs32",true,0xffffffff, 0xffffffff,false);
+ = HOWTO(1,0,2,32,false,0,complain_overflow_bitfield,0,"abs32",true,0xffffffff, 0xffffffff,false);
static
reloc_howto_type abs16_howto
- = HOWTO(1,0,1,16,false,0,false,true,0,"abs16",true,0x0000ffff, 0x0000ffff,false);
+ = HOWTO(1,0,1,16,false,0,complain_overflow_bitfield,0,"abs16",true,0x0000ffff, 0x0000ffff,false);
static
reloc_howto_type abs8_howto
- = HOWTO(1,0,0,8,false,0,false,true,0,"abs8",true,0x000000ff, 0x000000ff,false);
+ = HOWTO(1,0,0,8,false,0,complain_overflow_bitfield,0,"abs8",true,0x000000ff, 0x000000ff,false);
static
reloc_howto_type rel32_howto
- = HOWTO(1,0,2,32,true,0,false,true,0,"rel32",true,0xffffffff,
+ = HOWTO(1,0,2,32,true,0,complain_overflow_signed,0,"rel32",true,0xffffffff,
0xffffffff,false);
static
reloc_howto_type rel16_howto
- = HOWTO(1,0,1,16,true,0,false,true,0,"rel16",true,0x0000ffff, 0x0000ffff,false);
+ = HOWTO(1,0,1,16,true,0,complain_overflow_signed,0,"rel16",true,0x0000ffff, 0x0000ffff,false);
static
reloc_howto_type rel8_howto
- = HOWTO(1,0,0,8,true,0,false,true,0,"rel8",true,0x000000ff, 0x000000ff,false);
+ = HOWTO(1,0,0,8,true,0,complain_overflow_signed,0,"rel8",true,0x000000ff, 0x000000ff,false);
static ieee_symbol_index_type NOSYMBOL = { 0, 0};
{
ieee_data_type *ieee = IEEE_DATA(abfd);
file_ptr offset = ieee->w.r.section_part;
-
asection *section = (asection *)NULL;
+ char *name;
if (offset != 0) {
bfd_byte section_type[3];
boolean loop;
unsigned int i;
-uint8e_type buffer[512];
+ unsigned char buffer[512];
struct obstack ob;
file_ptr buffer_offset = 0;
ieee_ar_data_type *save = abfd->tdata.ieee_ar_data;
ieee_ar_obstack_type t;
int rec =read_2bytes(&(ieee->h));
if (rec ==(int)ieee_assign_value_to_variable_enum) {
- int record_number = must_parse_int(&(ieee->h));
+ must_parse_int(&(ieee->h));
t.file_offset = must_parse_int(&(ieee->h));
t.abfd = (bfd *)NULL;
ieee->element_count++;
char *processor;
unsigned int part;
ieee_data_type *ieee;
- uint8e_type buffer[300];
+ unsigned char buffer[300];
ieee_data_type *save = IEEE_DATA(abfd);
+
abfd->tdata.ieee_data = 0;
ieee_mkobject(abfd);
quickly. We can work out how big the file is from the trailer
record */
- IEEE_DATA(abfd)->h.first_byte = (uint8e_type *) bfd_alloc(ieee->h.abfd, ieee->w.r.me_record
+ IEEE_DATA(abfd)->h.first_byte = (unsigned char *) bfd_alloc(ieee->h.abfd, ieee->w.r.me_record
+ 50);
bfd_seek(abfd, (file_ptr) 0, SEEK_SET);
bfd_read((PTR)(IEEE_DATA(abfd)->h.first_byte), 1, ieee->w.r.me_record+50, abfd);
return (bfd_target *)NULL;
}
+void
+DEFUN(ieee_get_symbol_info,(ignore_abfd, symbol, ret),
+ bfd *ignore_abfd AND
+ asymbol *symbol AND
+ symbol_info *ret)
+{
+ bfd_symbol_info (symbol, ret);
+ if (symbol->name[0] == ' ')
+ ret->name = "* empty table entry ";
+ if (!symbol->section)
+ ret->type = (symbol->flags & BSF_LOCAL) ? 'a' : 'A';
+}
void
DEFUN(ieee_print_symbol,(ignore_abfd, afile, symbol, how),
#endif
BFD_FAIL();
break;
- case bfd_print_symbol_nm:
case bfd_print_symbol_all:
{
CONST char *section_name = symbol->section == (asection *)NULL ?
DEFUN(do_one,(ieee, current_map, location_ptr,s),
ieee_data_type *ieee AND
ieee_per_section_type *current_map AND
- uint8e_type *location_ptr AND
+ unsigned char *location_ptr AND
asection *s)
{
switch (this_byte(&(ieee->h)))
*/
unsigned int iterations ;
- uint8e_type *start ;
+ unsigned char *start ;
next_byte(&(ieee->h));
iterations = must_parse_int(&(ieee->h));
start = ieee->h.input_p;
if ((PTR)stream == (PTR)NULL) {
/* Outputting a section without data, fill it up */
- stream = (uint8e_type *)(bfd_alloc(abfd, s->_raw_size));
+ stream = (unsigned char *)(bfd_alloc(abfd, s->_raw_size));
memset((PTR)stream, 0, s->_raw_size);
}
while (current_byte_index < s->_raw_size) {
' ', /* ar_pad_char */
16, /* ar_max_namelen */
1, /* minimum alignment */
-_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* data */
-_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* hdrs */
+bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
+bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
{ _bfd_dummy_target,
ieee_object_p, /* bfd_check_format */