From patchwork Tue Oct 7 15:18:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 3125 Received: (qmail 27787 invoked by alias); 7 Oct 2014 15:20:09 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 27776 invoked by uid 89); 7 Oct 2014 15:20:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: plane.gmane.org To: libc-alpha@sourceware.org From: Stefan Liebler Subject: [PATCH] S/390: Get rid of warning unused variable in dl-machine.h. Date: Tue, 07 Oct 2014 17:18:07 +0200 Lines: 70 Message-ID: Mime-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.8.0 Hi, This patch gets rid of warning generated by compiling elf/rtld.c on s390-64: In file included from dynamic-link.h:88:0, from rtld.c:352: ../sysdeps/s390/s390-64/dl-machine.h: In function ‘elf_machine_rela’: ../sysdeps/s390/s390-64/dl-machine.h:282:30: warning: unused variable ‘refsym’ [-Wunused-variable] The refsym variable in the function elf_machine_rela is declared and used in the following lines in dl-machine.h: 281:#ifndef RESOLVE_CONFLICT_FIND_MAP 282: const Elf64_Sym *const refsym = sym; 283:#endif 348: #ifndef RTLD_BOOTSTRAP 349: # ifndef RESOLVE_CONFLICT_FIND_MAP 356: if (__builtin_expect (sym->st_size > refsym->st_size, 0) 357: || (__builtin_expect (sym->st_size < refsym->st_size, 0) 365: RTLD_PROGNAME, strtab + refsym->st_name); 368: MIN (sym->st_size, refsym->st_size)); 370:# endif 406:#endif This patch adds the #if !defined RTLD_BOOTSTRAP around the variable declaration. This patch for s390-64 is equal to the patch for s390-32 with patch "S/390: Get rid of unused variable warning in dl-machine.h" (c5eebdd084b77b0b581a3aa02213fa7cc5851216 by Andreas Krebbel 2014-01-07 09:40:00). Bye Stefan --- 2014-10-07 Stefan Liebler * sysdeps/s390/s390-64/dl-machine.h (elf_machine_rela): Gate the definition of refsym additionally with !RTLD_BOOTSTRAP to get rid of unused variable warning. diff --git a/sysdeps/s390/s390-64/dl-machine.h b/sysdeps/s390/s390-64/dl-machine.h index e48d355..16a17bb 100644 --- a/sysdeps/s390/s390-64/dl-machine.h +++ b/sysdeps/s390/s390-64/dl-machine.h @@ -278,7 +278,8 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, return; else { -#ifndef RESOLVE_CONFLICT_FIND_MAP +#if !defined RTLD_BOOTSTRAP && !defined RESOLVE_CONFLICT_FIND_MAP + /* Only needed for R_390_COPY below. */ const Elf64_Sym *const refsym = sym; #endif struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);