~ubuntu-branches/debian/squeeze/binutils/squeeze

« back to all changes in this revision

Viewing changes to bfd/srec.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-09-10 17:05:30 UTC
  • mfrom: (1.4.5 upstream) (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090910170530-wa6gpju9pq5c56on
Tags: 2.19.91.20090910-1
* Snapshot, taken from the 2.20 release branch 20090910, corresponding
  to the 2.19.90 upstream snapshot.
* Fix Thumb-2 shared libraries (Daniel Jacobowitz), patch taken
  from the trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* BFD back-end for s-record objects.
2
2
   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3
 
   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 
3
   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
4
4
   Free Software Foundation, Inc.
5
5
   Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
6
6
 
198
198
 
199
199
  srec_init ();
200
200
 
201
 
  tdata = bfd_alloc (abfd, sizeof (tdata_type));
 
201
  tdata = (tdata_type *) bfd_alloc (abfd, sizeof (tdata_type));
202
202
  if (tdata == NULL)
203
203
    return FALSE;
204
204
 
271
271
{
272
272
  struct srec_symbol *n;
273
273
 
274
 
  n = bfd_alloc (abfd, sizeof (* n));
 
274
  n = (struct srec_symbol *) bfd_alloc (abfd, sizeof (* n));
275
275
  if (n == NULL)
276
276
    return FALSE;
277
277
 
363
363
                }
364
364
 
365
365
              alc = 10;
366
 
              symbuf = bfd_malloc (alc + 1);
 
366
              symbuf = (char *) bfd_malloc (alc + 1);
367
367
              if (symbuf == NULL)
368
368
                goto error_return;
369
369
 
378
378
                      char *n;
379
379
 
380
380
                      alc *= 2;
381
 
                      n = bfd_realloc (symbuf, alc + 1);
 
381
                      n = (char *) bfd_realloc (symbuf, alc + 1);
382
382
                      if (n == NULL)
383
383
                        goto error_return;
384
384
                      p = n + (p - symbuf);
395
395
                }
396
396
 
397
397
              *p++ = '\0';
398
 
              symname = bfd_alloc (abfd, (bfd_size_type) (p - symbuf));
 
398
              symname = (char *) bfd_alloc (abfd, (bfd_size_type) (p - symbuf));
399
399
              if (symname == NULL)
400
400
                goto error_return;
401
401
              strcpy (symname, symbuf);
482
482
              {
483
483
                if (buf != NULL)
484
484
                  free (buf);
485
 
                buf = bfd_malloc ((bfd_size_type) bytes * 2);
 
485
                buf = (bfd_byte *) bfd_malloc ((bfd_size_type) bytes * 2);
486
486
                if (buf == NULL)
487
487
                  goto error_return;
488
488
                bufsize = bytes * 2;
542
542
 
543
543
                    sprintf (secbuf, ".sec%d", bfd_count_sections (abfd) + 1);
544
544
                    amt = strlen (secbuf) + 1;
545
 
                    secname = bfd_alloc (abfd, amt);
 
545
                    secname = (char *) bfd_alloc (abfd, amt);
546
546
                    strcpy (secname, secbuf);
547
547
                    flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
548
548
                    sec = bfd_make_section_with_flags (abfd, secname, flags);
738
738
        {
739
739
          if (buf != NULL)
740
740
            free (buf);
741
 
          buf = bfd_malloc ((bfd_size_type) bytes * 2);
 
741
          buf = (bfd_byte *) bfd_malloc ((bfd_size_type) bytes * 2);
742
742
          if (buf == NULL)
743
743
            goto error_return;
744
744
          bufsize = bytes * 2;
838
838
      if (section->used_by_bfd == NULL)
839
839
        return FALSE;
840
840
 
841
 
      if (! srec_read_section (abfd, section, section->used_by_bfd))
 
841
      if (! srec_read_section (abfd, section,
 
842
                               (bfd_byte *) section->used_by_bfd))
842
843
        return FALSE;
843
844
    }
844
845
 
872
873
  tdata_type *tdata = abfd->tdata.srec_data;
873
874
  srec_data_list_type *entry;
874
875
 
875
 
  entry = bfd_alloc (abfd, sizeof (* entry));
 
876
  entry = (srec_data_list_type *) bfd_alloc (abfd, sizeof (* entry));
876
877
  if (entry == NULL)
877
878
    return FALSE;
878
879
 
882
883
    {
883
884
      bfd_byte *data;
884
885
 
885
 
      data = bfd_alloc (abfd, bytes_to_do);
 
886
      data = (bfd_byte *) bfd_alloc (abfd, bytes_to_do);
886
887
      if (data == NULL)
887
888
        return FALSE;
888
889
      memcpy ((void *) data, location, (size_t) bytes_to_do);
1181
1182
      asymbol *c;
1182
1183
      struct srec_symbol *s;
1183
1184
 
1184
 
      csymbols = bfd_alloc (abfd, symcount * sizeof (asymbol));
 
1185
      csymbols = (asymbol *) bfd_alloc (abfd, symcount * sizeof (asymbol));
1185
1186
      if (csymbols == NULL)
1186
1187
        return -1;
1187
1188
      abfd->tdata.srec_data->csymbols = csymbols;