From patchwork Sat Dec 20 20:28:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 4388 Received: (qmail 28178 invoked by alias); 20 Dec 2014 20:29:07 -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 28165 invoked by uid 89); 20 Dec 2014 20:29:06 -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, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f179.google.com X-Received: by 10.236.70.168 with SMTP id p28mr11721942yhd.86.1419107336652; Sat, 20 Dec 2014 12:28:56 -0800 (PST) Date: Sat, 20 Dec 2014 12:28:54 -0800 From: "H.J. Lu" To: GNU C Library Subject: [PATCH] Remove @PLT from "call _dl_init@PLT" in x86 _dl_start_user Message-ID: <20141220202854.GA14656@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) _dl_start_user in ld.so calls the local function _dl_init. There is no need to go through PLT. Tested on x86, x32 and x86-64. OK to install? Thanks. H.J. --- * sysdeps/i386/dl-machine.h (_dl_start_user): Remove @PLT from "call _dl_init@PLT". * sysdeps/x86_64/dl-machine.h (_dl_start_user): Likewise. from "call _dl_init@PLT". --- ChangeLog | 7 +++++++ sysdeps/i386/dl-machine.h | 2 +- sysdeps/x86_64/dl-machine.h | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e974ef2..a354c93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-12-20 H.J. Lu + + * sysdeps/i386/dl-machine.h (_dl_start_user): Remove @PLT + from "call _dl_init@PLT". + * sysdeps/x86_64/dl-machine.h (_dl_start_user): Likewise. + from "call _dl_init@PLT". + 2014-12-20 Chris Metcalf * sysdeps/unix/sysv/linux/tile/localplt.data: New file. diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index c10b1e5..94a6d38 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -221,7 +221,7 @@ _dl_start_user:\n\ # Clear %ebp, so that even constructors have terminated backchain.\n\ xorl %ebp, %ebp\n\ # Call the function to run the initializers.\n\ - call _dl_init@PLT\n\ + call _dl_init\n\ # Pass our finalizer function to the user in %edx, as per ELF ABI.\n\ leal _dl_fini@GOTOFF(%ebx), %edx\n\ # Restore %esp _start expects.\n\ diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h index 8316f13..5e1bb07 100644 --- a/sysdeps/x86_64/dl-machine.h +++ b/sysdeps/x86_64/dl-machine.h @@ -156,7 +156,7 @@ _dl_start_user:\n\ # Clear %rbp to mark outermost frame obviously even for constructors.\n\ xorl %ebp, %ebp\n\ # Call the function to run the initializers.\n\ - call _dl_init@PLT\n\ + call _dl_init\n\ # Pass our finalizer function to the user in %rdx, as per ELF ABI.\n\ leaq _dl_fini(%rip), %rdx\n\ # And make sure %rsp points to argc stored on the stack.\n\