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] elf: In _dl_relocate_object, skip processing if object is relocated
Date: Mon, 27 Nov 2023 10:53:45 +0000 (GMT)	[thread overview]
Message-ID: <20231127105345.24E903858430@sourceware.org> (raw)

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

commit b893410be304ddcea0bd43f537a13e8b18d37cf2
Author: Florian Weimer <fweimer@redhat.com>
Date:   Mon Nov 27 11:28:07 2023 +0100

    elf: In _dl_relocate_object, skip processing if object is relocated
    
    This is just a minor optimization.  It also makes it more obvious that
    _dl_relocate_object can be called multiple times.
    
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>

Diff:
---
 elf/dl-reloc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
index e5c555d82c..72c8586d29 100644
--- a/elf/dl-reloc.c
+++ b/elf/dl-reloc.c
@@ -205,6 +205,9 @@ void
 _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
 		     int reloc_mode, int consider_profiling)
 {
+  if (l->l_relocated)
+    return;
+
   struct textrels
   {
     caddr_t start;
@@ -242,9 +245,6 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
 # define consider_symbind 0
 #endif
 
-  if (l->l_relocated)
-    return;
-
   /* If DT_BIND_NOW is set relocate all references in this object.  We
      do not do this if we are profiling, of course.  */
   // XXX Correct for auditing?

                 reply	other threads:[~2023-11-27 10:53 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=20231127105345.24E903858430@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).