Update copyright years
[deliverable/binutils-gdb.git] / bfd / srec.c
index 1251a7e93c9c353382590203ec8315645c6fe2ea..1045d9918fe30d3a406fb89e67d041d27ac8f45e 100644 (file)
@@ -1,7 +1,5 @@
 /* BFD back-end for s-record objects.
-   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-   Free Software Foundation, Inc.
+   Copyright (C) 1990-2014 Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -870,6 +868,7 @@ srec_set_section_contents (bfd *abfd,
                           file_ptr offset,
                           bfd_size_type bytes_to_do)
 {
+  int opb = bfd_octets_per_byte (abfd);
   tdata_type *tdata = abfd->tdata.srec_data;
   srec_data_list_type *entry;
 
@@ -892,16 +891,16 @@ srec_set_section_contents (bfd *abfd,
         regardless of the siez of the addresses.  */
       if (S3Forced)
        tdata->type = 3;
-      else if ((section->lma + offset + bytes_to_do - 1) <= 0xffff)
+      else if ((section->lma + (offset + bytes_to_do) / opb - 1) <= 0xffff)
        ;  /* The default, S1, is OK.  */
-      else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffff
+      else if ((section->lma + (offset + bytes_to_do) / opb - 1) <= 0xffffff
               && tdata->type <= 2)
        tdata->type = 2;
       else
        tdata->type = 3;
 
       entry->data = data;
-      entry->where = section->lma + offset;
+      entry->where = section->lma + offset / opb;
       entry->size = bytes_to_do;
 
       /* Sort the records by address.  Optimize for the common case of
@@ -1252,6 +1251,7 @@ srec_print_symbol (bfd *abfd,
 #define srec_bfd_get_relocated_section_contents   bfd_generic_get_relocated_section_contents
 #define srec_bfd_relax_section                    bfd_generic_relax_section
 #define srec_bfd_gc_sections                      bfd_generic_gc_sections
+#define srec_bfd_lookup_section_flags             bfd_generic_lookup_section_flags
 #define srec_bfd_merge_sections                   bfd_generic_merge_sections
 #define srec_bfd_is_group_section                 bfd_generic_is_group_section
 #define srec_bfd_discard_group                    bfd_generic_discard_group
@@ -1280,6 +1280,7 @@ const bfd_target srec_vec =
   0,                           /* Leading underscore.  */
   ' ',                         /* AR_pad_char.  */
   16,                          /* AR_max_namelen.  */
+  0,                           /* match priority.  */
   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.  */
@@ -1335,6 +1336,7 @@ const bfd_target symbolsrec_vec =
   0,                           /* Leading underscore.  */
   ' ',                         /* AR_pad_char.  */
   16,                          /* AR_max_namelen.  */
+  0,                           /* match priority.  */
   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.  */
This page took 0.025556 seconds and 4 git commands to generate.