From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 1788E3858CD1 for ; Mon, 8 Apr 2024 16:24:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1788E3858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1788E3858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712593449; cv=none; b=sEHr/LBIQyLZHfM0u0zygQJrUeEY6QX5ooGmH67kNo5yJx5rgCPmmshzIqN6tXKVTH10lf6STq+7KdhxXAJMUBd3HOsqWG0LjEUxcwfoI8GgBgl7LZfWDUX5Junh7qNL8RVJ0zQ/GeAT3zGHFbQXuV3otAi7y2diZX5vZoBA/P8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712593449; c=relaxed/simple; bh=ghF+e+ViZ92HkPIIBZRWbrtQ6U0h5SDLD4WizD2OY/U=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=RCFLHvwPjD/oapXpIYMy/4mIREjdIypIGvAP+SN4UtoRBu0vIHGvW2dfkH7k6VC5ltzi26EUHmLrgRSt4QF096NrjosXh06BimUGS7XplzdVjYowx3TmwuWxmWVs0YdK48nef8H2aGDVo913uTwC5pyiHCA8+qOsGt7n9M+iA4s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4155819f710so35858025e9.2 for ; Mon, 08 Apr 2024 09:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712593444; x=1713198244; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/agL+zgWaZLLndvQ8uBFXghRCghDKWRJjLX8YQ5D6sY=; b=OolG8ZjW/i59+vX9Lgo98qrW+sSK2IHMLmnBRxFsU7bZsSnoHt6XmM1AB5S5613mxv fiX7NxDEGKssGpwgha7jCuWwzVnol+4uCjyEeEbL3m0QNPHCQUBhhEMYFtggPd6wmqcK /DmM+XKn+Sk+ndpT+RzdGBX9ODXH1RNcNjoBe9YoEGPfBpaiC/ycqFFsDDfa77LCEi49 2y4/V2EHTwPUocQ+6JqDOhU/iS/TsbdyaCU+aXoUZVhy27g8Ge1/YcSXbze57NHHw5zm FF7eNAKdrHSBHPB0dFqQCqtbf0ifuT72o63DmqNLQ4pJWOuep4SQTSoz17tUO5kRZnfJ hopw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712593444; x=1713198244; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/agL+zgWaZLLndvQ8uBFXghRCghDKWRJjLX8YQ5D6sY=; b=nFhXoJl61Orpb4IM+f/kPnkbCEIZs5b5U7/k+KAwlKZMM4pBV+GUiSfEinmdKRaDX7 v+kxut3SiGtmCrlENBJeUeCK6l4ijWlhbt6hHZycd1A6icpno9tQny/e6PPz6gtv67to eH3+SWz4S5tXTUYqvGU/48rs6p75JPVU1be/gfw6uma+MclQOVCXKPpdzE1zlK0lghFE UIfUCgu4Y3ERSLwmbLKDJzs8W6RLsQ5G0IaFpwfcMqkayiW6H6qsu/Ls3uLIouTLAzAV Vr2xixuOaKhZ+nmW3czsZbRF2qgjf8kQyLuyDy0vNbEDuJAYhOBv7OdFYTfGol6klF6j z5Sw== X-Gm-Message-State: AOJu0Yy0i7xR0qx6ny8H/WQwqI+fqCmVzWeRih6GnDSqbtG7hvbJHuJ3 haFLUk0KpfWbheMKsXH2HTpq3s5JCc711vfivt62XYfHRPEShJ1Ya8d+xCUdWsA3S/bq9cUy/VX hEWrWZ1bgWTdYcA9H6pYVENQ5X8Y= X-Google-Smtp-Source: AGHT+IG363/mJHKmEoO36r3MZ92nTfO/IcAms7ER6zBvRiiEUwHGmzoQtDFWPBrKMeYbHYVdKFpDmHsE6eThHo98Hmg= X-Received: by 2002:adf:f592:0:b0:343:9d4b:d920 with SMTP id f18-20020adff592000000b003439d4bd920mr6317155wro.40.1712593444379; Mon, 08 Apr 2024 09:24:04 -0700 (PDT) MIME-Version: 1.0 References: <20240405234257.2040273-1-hjl.tools@gmail.com> In-Reply-To: <20240405234257.2040273-1-hjl.tools@gmail.com> From: Sunil Pandey Date: Mon, 8 Apr 2024 09:23:28 -0700 Message-ID: Subject: Re: [PATCH] Use crtbeginT.o and crtend.o for non-PIE static executables To: "H.J. Lu" Cc: libc-alpha@sourceware.org Content-Type: multipart/alternative; boundary="000000000000e5a2c10615983b83" X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,GIT_PATCH_0,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000e5a2c10615983b83 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Apr 5, 2024 at 4:43=E2=80=AFPM H.J. Lu wrote: > When static PIE is enabled by default, we shouldn't use crtbeginS.o and > crtendS.o for non-PIE static executables. Check $($(@F)-no-pie) to use > crtbeginT.o and crtend.o to create non-PIE static executables. > --- > Makeconfig | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/Makeconfig b/Makeconfig > index 85e00cef94..e583765712 100644 > --- a/Makeconfig > +++ b/Makeconfig > @@ -705,13 +705,15 @@ endif > +prectorS =3D `$(CC) $(sysdep-LDFLAGS) --print-file-name=3DcrtbeginS.o` > +postctorS =3D `$(CC) $(sysdep-LDFLAGS) --print-file-name=3DcrtendS.o` > # Variants of the two previous definitions for statically linking > programs. > +static-prector =3D `$(CC) $(sysdep-LDFLAGS) --print-file-name=3Dcrtbegin= T.o` > +static-postctor =3D `$(CC) $(sysdep-LDFLAGS) --print-file-name=3Dcrtend.= o` > ifeq (yes,$(enable-static-pie)) > # Static PIE must use PIE variants. > -+prectorT =3D $(+prectorS) > -+postctorT =3D $(+postctorS) > ++prectorT =3D $(if $($(@F)-no-pie),$(static-prector),$(+prectorS)) > ++postctorT =3D $(if $($(@F)-no-pie),$(static-postctor),$(+postctorS)) > else > -+prectorT =3D `$(CC) $(sysdep-LDFLAGS) --print-file-name=3DcrtbeginT.o` > -+postctorT =3D `$(CC) $(sysdep-LDFLAGS) --print-file-name=3Dcrtend.o` > ++prectorT =3D $(static-prector) > ++postctorT =3D$(static-postctor) > endif > csu-objpfx =3D $(common-objpfx)csu/ > elf-objpfx =3D $(common-objpfx)elf/ > -- > 2.44.0 > LGTM Reviewed-by: Sunil K Pandey --Sunil --000000000000e5a2c10615983b83--