From patchwork Thu Jul 5 18:24:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 28244 Received: (qmail 48892 invoked by alias); 5 Jul 2018 18:25:09 -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 48672 invoked by uid 89); 5 Jul 2018 18:24:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy= X-HELO: mx1.redhat.com Subject: Re: Why is _dl_relocate_static_pie linked into crt1.o? To: Carlos O'Donell , Andreas Schwab Cc: Szabolcs Nagy , "H.J. Lu" , nd@arm.com, GNU C Library References: <7e6296a5-854c-2aad-0dbe-fd870b2c5af8@redhat.com> <336c4123-e90f-50e1-3f20-749bac956108@redhat.com> <9f8baab5-1176-b744-88bc-412a73666a05@arm.com> <6ea9f0ef-e87e-6e37-e8c7-aa3408a7194f@redhat.com> <55a69d1b-1ca8-584f-255c-37698778af3d@redhat.com> <5de8fa97-8b4a-5931-fb3d-a57e43d24c08@redhat.com> From: Florian Weimer Message-ID: Date: Thu, 5 Jul 2018 20:24:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <5de8fa97-8b4a-5931-fb3d-a57e43d24c08@redhat.com> On 07/05/2018 04:23 PM, Carlos O'Donell wrote: > Can we fix this with a subsequent CFLAGS-static-reloc.o override? > > I'm hesitant to make any major changes now that we are in slushy freeze > fro the release. Like with the attached patch? It covers the csu/elf-init.c situation as well, assuming that we we don't want to include the startup cleanup in this release. Thanks, Florian Reviewed-by: Carlos O'Donell Subject: [PATCH] Build csu/elf-init.c and csu/static-reloc.c with stack protector To: libc-alpha@sourceware.org This does not change generated code (with -fstack-protector-strong), but is important for formal compiler flags compliance. 2018-07-05 Florian Weimer * csu/Makefile (CFLAGS-static-reloc.os): Build with stack protector. (CFLAGS-elf-init.oS): Likewise. diff --git a/csu/Makefile b/csu/Makefile index f3498960f8..250fe664bd 100644 --- a/csu/Makefile +++ b/csu/Makefile @@ -50,6 +50,19 @@ CFLAGS-.o += $(no-stack-protector) CFLAGS-.op += $(no-stack-protector) CFLAGS-.os += $(no-stack-protector) +# Dummy object not actually part of anything. +# See . +# NB: Using $(stack-protector) in this way causes a wrong definition +# STACK_PROTECTOR_LEVEL due to the preceding $(no-stack-protector), +# but it does not matter for this source file. +CFLAGS-static-reloc.os += $(stack-protector) + +# This file is not actually part of the startup code in the nonshared +# case. See , +# . +# See the NB above regarding STACK_PROTECTOR_LEVEL. +CFLAGS-elf-init.oS += $(stack-protector) + ifeq (yes,$(build-shared)) extra-objs += S$(start-installed-name) gmon-start.os ifneq ($(start-installed-name),$(static-start-installed-name))