public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Florian Weimer <fw@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/fw/builtin-syscalls-4] powerpc: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214]
Date: Tue, 31 Dec 2019 10:46:00 -0000	[thread overview]
Message-ID: <20191231104622.63901.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0331bffe1be698d32c3b4a93b6e7f02d1f1b47fb

commit 0331bffe1be698d32c3b4a93b6e7f02d1f1b47fb
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Dec 17 15:55:59 2019 -0300

    powerpc: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214]
    
    This patch adds the missing bits for powerpc and fixes both
    tst-ifunc-fault-lazy and tst-ifunc-fault-bindnow failures on
    powerpc-linux-gnu.
    
    Checked on powerpc-linux-gnu and powerpc-linux-gnu-power4.
    
    Reviewed-by: Florian Weimer <fweimer@redhat.com>
    Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>

Diff:
---
 sysdeps/powerpc/powerpc32/dl-machine.c | 5 +++--
 sysdeps/powerpc/powerpc32/dl-machine.h | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/sysdeps/powerpc/powerpc32/dl-machine.c b/sysdeps/powerpc/powerpc32/dl-machine.c
index d3ce2c1..a90cbc1 100644
--- a/sysdeps/powerpc/powerpc32/dl-machine.c
+++ b/sysdeps/powerpc/powerpc32/dl-machine.c
@@ -414,7 +414,7 @@ __process_machine_rela (struct link_map *map,
 			const Elf32_Sym *refsym,
 			Elf32_Addr *const reloc_addr,
 			Elf32_Addr const finaladdr,
-			int rinfo)
+			int rinfo, bool skip_ifunc)
 {
   union unaligned
     {
@@ -434,7 +434,8 @@ __process_machine_rela (struct link_map *map,
       return;
 
     case R_PPC_IRELATIVE:
-      *reloc_addr = ((Elf32_Addr (*) (void)) finaladdr) ();
+      if (__glibc_likely (!skip_ifunc))
+	*reloc_addr = ((Elf32_Addr (*) (void)) finaladdr) ();
       return;
 
     case R_PPC_UADDR32:
diff --git a/sysdeps/powerpc/powerpc32/dl-machine.h b/sysdeps/powerpc/powerpc32/dl-machine.h
index 5286901..4b12652 100644
--- a/sysdeps/powerpc/powerpc32/dl-machine.h
+++ b/sysdeps/powerpc/powerpc32/dl-machine.h
@@ -273,7 +273,8 @@ extern void __process_machine_rela (struct link_map *map,
 				    const Elf32_Sym *refsym,
 				    Elf32_Addr *const reloc_addr,
 				    Elf32_Addr finaladdr,
-				    int rinfo) attribute_hidden;
+				    int rinfo, bool skip_ifunc)
+  attribute_hidden;
 
 /* Call _dl_signal_error when a resolved value overflows a relocated area.  */
 extern void _dl_reloc_overflow (struct link_map *map,
@@ -436,7 +437,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
 
     default:
       __process_machine_rela (map, reloc, sym_map, sym, refsym,
-			      reloc_addr, value, r_type);
+			      reloc_addr, value, r_type, skip_ifunc);
     }
 }


                 reply	other threads:[~2019-12-31 10:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191231104622.63901.qmail@sourceware.org \
    --to=fw@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).