From patchwork Thu Aug 17 11:57:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 22186 Received: (qmail 64833 invoked by alias); 17 Aug 2017 11:57:25 -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 63152 invoked by uid 89); 17 Aug 2017 11:57:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-oi0-f68.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sxKsuSoiyQj/m3djw02psxuTnouguYo14PWBoL7ncc0=; b=P/aXZDs3X+UlomHxZSrjkdbb+1n64ANgh/DhwxfcUW8O6Ld/oVILMVhXn5kEyIVxkw VrosximMBrGzSRveCegxKV1JECwa3lttTFl8QWqBERKYptv2wjbg9C/QDnwLzzl1EQhW RoqaUkmRn5Auxgp+PzDjcddWGtLDhUVGGmHFRSA3c5cYzM97tI2VUFILeZMmqqwXeHDE XZ7VG+jmvRfZffJr2fiDc+gu4IjLX6pNraT6LyHYI9PuORWbSzIcY5mUW+WwglldHfEI ufstga6ZQWjoCPJI4YH6ByPTvc5dbNKgO40KnGvyMafQSm8NL7CstvigCsWpVEcEwTw6 nLbQ== X-Gm-Message-State: AHYfb5hOlhWymybOS2IpZ2RGCM0mV4A6tTIO6kzkWYuB2p/cTaKWvPs2 k2ElMl6luL0npRRxIpLz7xMZS69Q0Ude X-Received: by 10.202.219.198 with SMTP id s189mr6995721oig.103.1502971041135; Thu, 17 Aug 2017 04:57:21 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <4d15086e-9e54-014b-1a50-16534f287e24@redhat.com> <539fb6f1-9d96-01d5-0f35-f3c312c0ecbb@redhat.com> <87b76487-16d3-78b4-9651-f6d375b9b137@redhat.com> <36b6ab73-342d-0886-8767-ff7fd6dd4d79@redhat.com> <907f751a-3916-64c9-f650-df182fb3cdce@redhat.com> <93df1f7c-b5f9-4ab7-5fe8-87baf94e4d34@redhat.com> <40ca3281-c22c-954d-b11d-5312782971e3@redhat.com> <357353c9-2633-a1a5-4d78-49862087a8a5@redhat.com> From: "H.J. Lu" Date: Thu, 17 Aug 2017 04:57:20 -0700 Message-ID: Subject: Re: [PATCH] Test for profiling support (_mcount/gprof) To: Florian Weimer Cc: Andreas Schwab , GNU C Library On Thu, Aug 17, 2017 at 12:44 AM, Florian Weimer wrote: > On 08/16/2017 11:19 PM, H.J. Lu wrote: >> -pg and -pie are mutually exclusive since they need different crt1.o, >> gcrrt1.o vs Scrt1.o. Make -pg overrdies -pie. >> >> * Makeconfig (+link-pie-before-libc): Add CRT-* hook to override >> the startup object. > > Typo (gcrrt1.o), and the commit message is confusing. There is no -pg > involved at the linking stage. > > gcrt1.o is deliberately compiled so that it is compatible with PIE, so > the patch itself is okay. This is what I checked in. diff --git a/Makeconfig b/Makeconfig index 5f2469116c..b51904b797 100644 --- a/Makeconfig +++ b/Makeconfig @@ -409,7 +409,7 @@ ifndef +link-pie +link-pie-before-libc = $(CC) -pie -Wl,-O1 -nostdlib -nostartfiles -o $@ \ $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \ $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \ - $(addprefix $(csu-objpfx),S$(start-installed-name)) \ + $(firstword $(CRT-$(@F)) $(csu-objpfx)S$(start-installed-name)) \ $(+preinit) $(+prectorS) \ $(filter-out $(addprefix $(csu-objpfx),start.o \ S$(start-installed-name))\