From patchwork Mon Sep 15 08:21:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 389237 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3FA5A1400A3 for ; Mon, 15 Sep 2014 18:21:24 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=a9KLnf9YLW3Dc2HV07HNSL29+7UUmAZ uqyiihCxXO3eOj0BM5B2LZSjv1yLepWaj6aKyMdMwvap9FLfBz3QgIu1ul83UdiG Rl87s0elMzsxB407ICWcQrLVNmmjTNSlrDijW+opP635AiaPQlp36TfEr5WGEB1D ICuFaDHKDA1c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=9MFG28MjPKDSflXv9uK1EPx6gFw=; b=ohbvz rj0518jN5vDU0pAEANy3dlsks+MInDx+2Wpp+WsvaLsTl0iFSnDIBHCfB3LnGRxK 0x4ry7xoR48tXAMLVaCd3fIENyF7HX244JtdEfGKRlAMThSbpCJoTx2oyYKXjXTi 7quqZV4+ZPXt3muQbRTNMcEEKDDvLKeqcN3SlY= Received: (qmail 3555 invoked by alias); 15 Sep 2014 08:21:19 -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 3546 invoked by uid 89); 15 Sep 2014 08:21:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Cc: Roland McGrath , Siddhesh Poyarekar Subject: [PATCH] Remove CFLAGS for interp.c Date: Mon, 15 Sep 2014 13:51:07 +0530 Message-Id: <1410769267-24689-1-git-send-email-siddhesh@redhat.com> In-Reply-To: <20140905225447.97A952C3984@topped-with-meat.com> References: <20140905225447.97A952C3984@topped-with-meat.com> Replace it with including an auto-generated linker-runtime.h. Build-tested on x86_64 and found that there was no change in the generated code. * elf/Makefile (CFLAGS-interp.c): Remove. ($(elf-objpfx)runtime-linker.h): Generate header with linker path string. * elf/interp.c: Include generated runtime-linker.h --- elf/Makefile | 13 ++++++++++--- elf/interp.c | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/elf/Makefile b/elf/Makefile index e3bd692..bf4fda1 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -353,9 +353,16 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map) | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }' mv -f $@.new $@ -# interp.c exists just to get this string into the libraries. -CFLAGS-interp.c = -D'RUNTIME_LINKER="$(rtlddir)/$(rtld-installed-name)"' -$(objpfx)interp.os: $(common-objpfx)config.make +# interp.c exists just to get the runtime linker path into libc.so. +$(objpfx)interp.os: $(elf-objpfx)runtime-linker.h + +$(elf-objpfx)runtime-linker.h: $(elf-objpfx)runtime-linker.st; @: +$(elf-objpfx)runtime-linker.st: $(common-objpfx)config.make + $(name-target-directory) + echo "#define RUNTIME_LINKER \"$(rtlddir)/$(rtld-installed-name)\"" \ + > ${@:st=T} + $(move-if-change) ${@:st=T} ${@:st=h} + touch $@ ifneq (ld.so,$(rtld-installed-name)) # Make sure ld.so.1 exists in the build directory so we can link diff --git a/elf/interp.c b/elf/interp.c index 49c92f5..a2492bf 100644 --- a/elf/interp.c +++ b/elf/interp.c @@ -16,5 +16,7 @@ License along with the GNU C Library; if not, see . */ +#include + const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp"))) = RUNTIME_LINKER;