From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5177 invoked by alias); 31 Jan 2013 04:08:47 -0000 Received: (qmail 5115 invoked by uid 22791); 31 Jan 2013 04:08:46 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,KHOP_SPAMHAUS_DROP,RCVD_IN_HOSTKARMA_YE,TW_BJ,TW_FP,TW_XP X-Spam-Check-By: sourceware.org Received: from na3sys009aog122.obsmtp.com (HELO na3sys009aog122.obsmtp.com) (74.125.149.147) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 Jan 2013 04:08:40 +0000 Received: from mx20.qnx.com ([72.1.200.103]) (using TLSv1) by na3sys009aob122.postini.com ([74.125.148.12]) with SMTP ID DSNKUQnuR5pEJ0zqLCxmbnzhfAtx+u6fU/0V@postini.com; Wed, 30 Jan 2013 20:08:39 PST Received: by mx20.qnx.com (Postfix, from userid 500) id D16CD20E4B; Wed, 30 Jan 2013 23:08:38 -0500 (EST) Received: from exhts.ott.qnx.com (exch2 [10.222.2.136]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx20.qnx.com (Postfix) with ESMTPS id 5107C20E3B for ; Wed, 30 Jan 2013 23:08:38 -0500 (EST) Received: from [10.222.41.4] (10.222.2.5) by exch2.ott.qnx.com (10.222.2.136) with Microsoft SMTP Server id 14.2.318.4; Wed, 30 Jan 2013 23:08:37 -0500 Message-ID: <5109EE44.5020605@qnx.com> Date: Thu, 31 Jan 2013 04:08:00 -0000 From: Aleksandar Ristovski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 Newsgroups: gmane.comp.gdb.patches To: "gdb-patches@sourceware.org" Subject: [patch] cleanup: Wunused coff-pe-read Content-Type: multipart/mixed; boundary="------------040408060500050303050009" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-01/txt/msg00740.txt.bz2 --------------040408060500050303050009 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 594 Hello, This is removing unused variables and allows compiling with -Wunused. Thanks, Aleksandar Ristovski QNX Software Systems ChangeLog: Aleksandar Ristovski * 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. --------------040408060500050303050009 Content-Type: text/x-patch; name="Wunused-coff-pe-read-201301300110.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Wunused-coff-pe-read-201301300110.patch" Content-length: 2772 Index: gdb/coff-pe-read.c =================================================================== RCS file: /cvs/src/src/gdb/coff-pe-read.c,v retrieving revision 1.23 diff -u -p -r1.23 coff-pe-read.c --- gdb/coff-pe-read.c 1 Jan 2013 06:32:40 -0000 1.23 +++ gdb/coff-pe-read.c 30 Jan 2013 22:25:14 -0000 @@ -158,7 +158,6 @@ add_pe_exported_sym (const char *sym_nam 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_na 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_na 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 *o 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; @@ -437,7 +432,6 @@ read_pe_exported_syms (struct objfile *o " for dll \"%s\": 0x%lx instead of 0x%lx\n"), dll_name, export_opthdrrva, vaddr); expptr = fptr + (export_opthdrrva - vaddr); - exportix = i; break; } } @@ -632,12 +626,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; @@ -664,7 +654,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)); --------------040408060500050303050009--