Fix coff-pe-read.c to compile with Wunused.
authorAleksandar Ristovski <aristovski@qnx.com>
Mon, 1 Apr 2013 12:53:01 +0000 (12:53 +0000)
committerAleksandar Ristovski <aristovski@qnx.com>
Mon, 1 Apr 2013 12:53:01 +0000 (12:53 +0000)
* coff-pe-read.c (add_pe_exported_sym): Remove unused 'dll_name_len'.
(add_pe_forwarded_sym): Remove unused 'section', 'dll_name_len'.
(read_pe_exported_syms): Remove unused 'exportix'.
(pe_text_section_offset): Remove unused 'opthdr_ofs', 'num_entries',
'export_rva', 'export_size', 'expptr', 'exp_funcbase', 'expdata',
'erva', 'name_rvas', 'ordinals', 'nexp', 'ordbase', 'dll_name'.

Reference: http://sourceware.org/ml/gdb-patches/2013-03/msg01081.html

gdb/ChangeLog
gdb/coff-pe-read.c

index 00739df9938b5e23b3ff9a06afece84b02aa8b0a..a871c399a3aa7653c2f38f9df4942ca8d3d8f5a4 100644 (file)
@@ -1,3 +1,13 @@
+2013-04-01  Aleksandar Ristovski <aristovski@qnx.com>
+
+       * coff-pe-read.c (add_pe_exported_sym): Remove unused 'dll_name_len'.
+       (add_pe_forwarded_sym): Remove unused 'section', 'dll_name_len'.
+       (read_pe_exported_syms): Remove unused 'exportix'.
+       (pe_text_section_offset): Remove unused 'opthdr_ofs', 'num_entries',
+       'export_rva', 'export_size', 'expptr', 'exp_funcbase', 'expdata',
+       'erva', 'name_rvas', 'ordinals', 'nexp', 'ordbase', 'dll_name'.
+
+
 2013-04-01  Aleksandar Ristovski  <aristovski@qnx.com>
 
        * breakpoint.c (parse_cond_to_aexpr): Remove unused 'old_chain'.
index 4be349d1ff4cb48b6c209216512c846398693e82..3f06f681d094e66076acebd9c79df8516cbe10db 100644 (file)
@@ -158,7 +158,6 @@ add_pe_exported_sym (const char *sym_name,
   char *qualified_name, *bare_name;
   /* Add the stored offset to get the loaded address of the symbol.  */
   CORE_ADDR vma = func_rva + section_data->vma_offset;
-  int dll_name_len = strlen (dll_name);
 
   /* Generate a (hopefully unique) qualified name using the first part
      of the dll name, e.g. KERNEL32!AddAtomA.  This matches the style
@@ -205,9 +204,7 @@ add_pe_forwarded_sym (const char *sym_name, const char *forward_dll_name,
   CORE_ADDR vma;
   struct objfile *forward_objfile;
   struct minimal_symbol *msymbol;
-  short section;
   enum minimal_symbol_type msymtype;
-  int dll_name_len = strlen (dll_name);
   char *qualified_name, *bare_name;
   int forward_dll_name_len = strlen (forward_dll_name);
   int forward_func_name_len = strlen (forward_func_name);
@@ -247,7 +244,6 @@ add_pe_forwarded_sym (const char *sym_name, const char *forward_dll_name,
                        sym_name, dll_name, forward_qualified_name);
 
   vma = SYMBOL_VALUE_ADDRESS (msymbol);
-  section = SYMBOL_SECTION (msymbol);
   msymtype = MSYMBOL_TYPE (msymbol);
 
   /* Generate a (hopefully unique) qualified name using the first part
@@ -336,7 +332,6 @@ read_pe_exported_syms (struct objfile *objfile)
   unsigned long name_rvas, ordinals, nexp, ordbase;
   char *dll_name = (char *) dll->filename;
   int otherix = PE_SECTION_TABLE_SIZE;
-  int exportix = -1;
   int is_pe64 = 0;
   int is_pe32 = 0;
 
@@ -439,7 +434,6 @@ read_pe_exported_syms (struct objfile *objfile)
                                " for dll \"%s\": 0x%lx instead of 0x%lx\n"),
                                dll_name, export_opthdrrva, vaddr);
          expptr = fptr + (export_opthdrrva - vaddr);
-         exportix = i;
          break;
        }
     }
@@ -635,12 +629,8 @@ CORE_ADDR
 pe_text_section_offset (struct bfd *abfd)
 
 {
-  unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
-  unsigned long export_rva, export_size, nsections, secptr, expptr;
-  unsigned long exp_funcbase;
-  unsigned char *expdata, *erva;
-  unsigned long name_rvas, ordinals, nexp, ordbase;
-  char *dll_name;
+  unsigned long pe_header_offset, i;
+  unsigned long nsections, secptr;
   int is_pe64 = 0;
   int is_pe32 = 0;
   char const *target;
@@ -667,7 +657,6 @@ pe_text_section_offset (struct bfd *abfd)
 
   /* Get pe_header, optional header and numbers of sections.  */
   pe_header_offset = pe_get32 (abfd, 0x3c);
-  opthdr_ofs = pe_header_offset + 4 + 20;
   nsections = pe_get16 (abfd, pe_header_offset + 4 + 2);
   secptr = (pe_header_offset + 4 + 20 +
            pe_get16 (abfd, pe_header_offset + 4 + 16));