* Many files: Changes to avoid gcc warnings: Remove unused local
[deliverable/binutils-gdb.git] / bfd / binary.c
index 819d5315224b4917a0fe43cb948b5b4470398eb4..b5b2fad3fbc7b1d74dbbe2ba2055bba643f945de 100644 (file)
@@ -58,7 +58,7 @@ static int binary_sizeof_headers PARAMS ((bfd *, boolean));
 
 static boolean
 binary_mkobject (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
   return true;
 }
@@ -112,7 +112,7 @@ binary_object_p (abfd)
 static boolean
 binary_get_section_contents (abfd, section, location, offset, count)
      bfd *abfd;
-     asection *section;
+     asection *section ATTRIBUTE_UNUSED;
      PTR location;
      file_ptr offset;
      bfd_size_type count;
@@ -127,7 +127,7 @@ binary_get_section_contents (abfd, section, location, offset, count)
 
 static long
 binary_get_symtab_upper_bound (abfd)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
 {
   return (BIN_SYMS + 1) * sizeof (asymbol *);
 }
@@ -222,7 +222,7 @@ binary_make_empty_symbol (abfd)
 
 static void
 binary_get_symbol_info (ignore_abfd, symbol, ret)
-     bfd *ignore_abfd;
+     bfd *ignore_abfd ATTRIBUTE_UNUSED;
      asymbol *symbol;
      symbol_info *ret;
 {
@@ -280,6 +280,13 @@ binary_set_section_contents (abfd, sec, data, offset, size)
        {
          s->filepos = s->lma - low;
 
+         /* Skip following warning check for sections that will not
+            occupy file space.  */ 
+         if ((s->flags
+              & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_NEVER_LOAD))
+             != (SEC_HAS_CONTENTS | SEC_ALLOC))
+           continue;
+
          /* If attempting to generate a binary file from a bfd with
             LMA's all over the place, huge (sparse?) binary files may
             result.  This condition attempts to detect this situation
@@ -288,7 +295,7 @@ binary_set_section_contents (abfd, sec, data, offset, size)
 
          if (s->filepos < 0)
            (*_bfd_error_handler)
-             (_("Warning: Writing section `%s' to huge offset %lu."),
+             (_("Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx."),
               bfd_get_section_name (abfd, s),
               (unsigned long) s->filepos);
        }
@@ -311,8 +318,8 @@ binary_set_section_contents (abfd, sec, data, offset, size)
 
 static int
 binary_sizeof_headers (abfd, exec)
-     bfd *abfd;
-     boolean exec;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     boolean exec ATTRIBUTE_UNUSED;
 {
   return 0;
 }
This page took 0.023826 seconds and 4 git commands to generate.