bfd/
[deliverable/binutils-gdb.git] / bfd / ihex.c
index fb2ab96c99ed602ebbedb1558fca12fdcb50945d..d2875dce8b8e7b61977b7c59728f9dd2adbb6a37 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD back-end for Intel Hex objects.
-   Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-   Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+   2006 Free Software Foundation, Inc.
    Written by Ian Lance Taylor of Cygnus Support <ian@cygnus.com>.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -355,6 +355,7 @@ ihex_scan (bfd *abfd)
                  char secbuf[20];
                  char *secname;
                  bfd_size_type amt;
+                 flagword flags;
 
                  sprintf (secbuf, ".sec%d", bfd_count_sections (abfd) + 1);
                  amt = strlen (secbuf) + 1;
@@ -362,10 +363,10 @@ ihex_scan (bfd *abfd)
                  if (secname == NULL)
                    goto error_return;
                  strcpy (secname, secbuf);
-                 sec = bfd_make_section (abfd, secname);
+                 flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
+                 sec = bfd_make_section_with_flags (abfd, secname, flags);
                  if (sec == NULL)
                    goto error_return;
-                 sec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
                  sec->vma = extbase + segbase + addr;
                  sec->lma = extbase + segbase + addr;
                  sec->size = len;
@@ -553,7 +554,6 @@ ihex_read_section (bfd *abfd, asection *section, bfd_byte *contents)
     {
       char hdr[8];
       unsigned int len;
-      bfd_vma addr;
       unsigned int type;
       unsigned int i;
 
@@ -568,7 +568,6 @@ ihex_read_section (bfd *abfd, asection *section, bfd_byte *contents)
        goto error_return;
 
       len = HEX2 (hdr);
-      addr = HEX4 (hdr + 2);
       type = HEX2 (hdr + 6);
 
       /* We should only see type 0 records here.  */
@@ -900,7 +899,8 @@ ihex_set_arch_mach (bfd *abfd,
 /* Get the size of the headers, for the linker.  */
 
 static int
-ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean exec ATTRIBUTE_UNUSED)
+ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
+                    struct bfd_link_info *info ATTRIBUTE_UNUSED)
 {
   return 0;
 }
This page took 0.025493 seconds and 4 git commands to generate.