public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] S/390: Get rid of warning unused variable in dl-machine.h.
@ 2014-10-07 15:20 Stefan Liebler
  2014-10-15  6:35 ` Stefan Liebler
  2014-11-13  9:47 ` Andreas Krebbel
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Liebler @ 2014-10-07 15:20 UTC (permalink / raw)
  To: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1418 bytes --]

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  <stli@linux.vnet.ibm.com>

	* 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.

[-- Attachment #2: dl-machine_unusedvariable_20141007 --]
[-- Type: text/plain, Size: 579 bytes --]

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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] S/390: Get rid of warning unused variable in dl-machine.h.
  2014-10-07 15:20 [PATCH] S/390: Get rid of warning unused variable in dl-machine.h Stefan Liebler
@ 2014-10-15  6:35 ` Stefan Liebler
  2014-11-13  9:47 ` Andreas Krebbel
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Liebler @ 2014-10-15  6:35 UTC (permalink / raw)
  To: libc-alpha

ping

On 10/07/2014 05:18 PM, Stefan Liebler wrote:
> 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  <stli@linux.vnet.ibm.com>
>
>      * 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] S/390: Get rid of warning unused variable in dl-machine.h.
  2014-10-07 15:20 [PATCH] S/390: Get rid of warning unused variable in dl-machine.h Stefan Liebler
  2014-10-15  6:35 ` Stefan Liebler
@ 2014-11-13  9:47 ` Andreas Krebbel
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Krebbel @ 2014-11-13  9:47 UTC (permalink / raw)
  To: Stefan Liebler, libc-alpha

On 10/07/2014 05:18 PM, Stefan Liebler wrote:
> 2014-10-07  Stefan Liebler  <stli@linux.vnet.ibm.com>
> 
> 	* 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.
> 

Applied. Thanks!

-Andreas-

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-13  9:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-07 15:20 [PATCH] S/390: Get rid of warning unused variable in dl-machine.h Stefan Liebler
2014-10-15  6:35 ` Stefan Liebler
2014-11-13  9:47 ` Andreas Krebbel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).