From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id A1483385E836; Thu, 9 May 2024 21:25:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A1483385E836 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 A1483385E836 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715289931; cv=none; b=FEfmL71/C8by5OkYg6w9jlUU4QaSNHwQqhHbmndHoaHKVpMQVOpdDUkuOj5c1q3VLmuyrSJu6+hzNRZIwau1TWujl1J/s6jMgMc5wIUG/qsXNRC/1eFC4Qmz6MLgsVYLeAA1jnCrWGM96m2rO4eEb7FWJ6k+e/sz4L5QwBuIoe4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715289931; c=relaxed/simple; bh=d/ls5ZsQGGwkaOj3eMXq4apJ3nZc6wx2ybBShQ0j4TM=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=s/xsJlspUAyRLkNJY6jEDeuXuXZGsTBhZveEEyj3+NV9oUqB6kcbIuz2Bsl1sHz+bajYY6E+LdD1Yeo+wz3vnVyVCFLDhQpGXTXMtnMOjjhx4AGmO8V0c2h54+GZE6+QiJHV56/tPACyzFoNBdb+/oPFws8GFfUopN//8wxOAWk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-41fd5dc0508so7355245e9.0; Thu, 09 May 2024 14:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715289927; x=1715894727; 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=bQx4f8KrbzBHat0JctTyLm2aY2KSU7sIMrnXwgBkzxs=; b=BqMKXK2/xqt11ox7TkTJ2tQL2UaDW6sUiCfwGI0tnVxq2LyIE47S1W64+DN7+w4+BA JkdrYvkqQAbhSAG3WTS0M973REsHhCq8+qTc2UHkS9hrY5J2seJvxYCdPNulaCPkz1hB Q8Z2/LI6zpOYUZe/MsauuPbXkDCrqilUBBUTL/7/zACD9ibXFFq0Z6Brew3KIk8WAfqG U/kp2ip78COHd2ZVHDbTPei83+7yoTG2EeEWAhYAtzrJaiN6dsKxdDw5u6N1rJMPUsDO bVJc0P35o5M1NGqNfHVtFdtbA7ZmuYzWX+GUY2hnGlxoNYDBadppbaB7IkRjrCIR3xQy HRjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715289927; x=1715894727; 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=bQx4f8KrbzBHat0JctTyLm2aY2KSU7sIMrnXwgBkzxs=; b=MzbvDSD8kNFi9xP1YhEmqW8awt/JE0Wi+42c3d9LROyuyuJZOSP/AgV0cJIbleZPn9 4rgZbdSM2MoVagFkGdXZaN3NlIWZrPYPXWc/TU67e+E50zGg4gDVSmxduU3urAMEocWi EMMCee58uJP1ZV4Idy75PjSz3FZE0JlxYKu1hHlPTdaXefZ5VNG7SolcJqlYj7N85OGR xC08P+2YQZfN9gNm9VJnwxP4MJiTv1X5VxV+iuMBJsv4xYjfarPf0sDXX7i6PtSzJJNY GIfYksMMv89IfJvuClYpwa1E4SDAnfB8usuTSPCgeKVnEkRVFdPN5P3Hwssa7tJVSnTO abtA== X-Forwarded-Encrypted: i=1; AJvYcCW0H6ieMdIl+Ycq4rr9bV7xvkqyG07KQoAaHxBeahyN6xafKruGChcLXRrNg5myUFJRbCcp+SqaMYt2l7FNwR7sqfbZHttoeYfXOQ== X-Gm-Message-State: AOJu0YypdvTuB/giYEVLaPhxX4gak2naLK31+JtdO3CmmTo+m9KIKS+E xqxOAN6ivV2Ydc+FFV/mPlUJL/WM4UPJTLytI+voeAhbfrE/jbhFNbFoFfy8qnBVlC3GW9DyPC7 HTOYxiCjjPR42v7xG93HIRom4e+8= X-Google-Smtp-Source: AGHT+IG7uqBuHvruZ8xDqIxaP1plVK21Vwl8XcqBFztxIPw+3LO5vYwhlcdCZ/mp4z0f91ywEwQeEPIBCZ2y5Wi+mgA= X-Received: by 2002:a5d:6604:0:b0:34a:2d0c:4463 with SMTP id ffacd0b85a97d-3504a62fb07mr506714f8f.4.1715289926967; Thu, 09 May 2024 14:25:26 -0700 (PDT) MIME-Version: 1.0 References: <87fseyy3s7.fsf@oldenburg.str.redhat.com> In-Reply-To: <87fseyy3s7.fsf@oldenburg.str.redhat.com> From: Sunil Pandey Date: Thu, 9 May 2024 14:24:50 -0700 Message-ID: Subject: Re: [PATCH] elf: Disable some subtests of ifuncmain1, ifuncmain5 for !PIE To: Florian Weimer , Hongjiu Lu , Libc-stable Mailing List Cc: GNU C Library Content-Type: multipart/alternative; boundary="000000000000c8ae5b06180c0e7a" X-Spam-Status: No, score=-8.0 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: --000000000000c8ae5b06180c0e7a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I would like to backport this patch to release branches(from 2.33 to 2.28) Any comments or objections? --Sunil On Fri, Nov 4, 2022 at 11:27=E2=80=AFAM Florian Weimer via Libc-alpha < libc-alpha@sourceware.org> wrote: > Tested on i686-linux-gnu, x86_64-linux-gnu (with glibc defaults on a > toolchain which is not PIE-by-default). Built with build-many-glibcs.py > defaults (so GCC 12 and binutils 2.39). The x86 failures are gone. > > --- > elf/ifuncmain1.c | 13 +++++++++++++ > elf/ifuncmain5.c | 9 +++++++++ > 2 files changed, 22 insertions(+) > > diff --git a/elf/ifuncmain1.c b/elf/ifuncmain1.c > index 747fc02648..6effce3d77 100644 > --- a/elf/ifuncmain1.c > +++ b/elf/ifuncmain1.c > @@ -19,7 +19,14 @@ typedef int (*foo_p) (void); > #endif > > foo_p foo_ptr =3D foo; > + > +/* Address-significant access to protected symbols is not supported in > + position-dependent mode on several architectures because GCC > + generates relocations that assume that the address is local to the > + main program. */ > +#ifdef __PIE__ > foo_p foo_procted_ptr =3D foo_protected; > +#endif > > extern foo_p get_foo_p (void); > extern foo_p get_foo_hidden_p (void); > @@ -37,12 +44,16 @@ main (void) > if ((*foo_ptr) () !=3D -1) > abort (); > > +#ifdef __PIE__ > if (foo_procted_ptr !=3D foo_protected) > abort (); > +#endif > if (foo_protected () !=3D 0) > abort (); > +#ifdef __PIE__ > if ((*foo_procted_ptr) () !=3D 0) > abort (); > +#endif > > p =3D get_foo_p (); > if (p !=3D foo) > @@ -55,8 +66,10 @@ main (void) > abort (); > > p =3D get_foo_protected_p (); > +#ifdef __PIE__ > if (p !=3D foo_protected) > abort (); > +#endif > if (ret_foo_protected !=3D 0 || (*p) () !=3D ret_foo_protected) > abort (); > > diff --git a/elf/ifuncmain5.c b/elf/ifuncmain5.c > index f398085cb4..6fda768fb6 100644 > --- a/elf/ifuncmain5.c > +++ b/elf/ifuncmain5.c > @@ -14,12 +14,19 @@ get_foo (void) > return foo; > } > > + > +/* Address-significant access to protected symbols is not supported in > + position-dependent mode on several architectures because GCC > + generates relocations that assume that the address is local to the > + main program. */ > +#ifdef __PIE__ > foo_p > __attribute__ ((noinline)) > get_foo_protected (void) > { > return foo_protected; > } > +#endif > > int > main (void) > @@ -30,9 +37,11 @@ main (void) > if ((*p) () !=3D -1) > abort (); > > +#ifdef __PIE__ > p =3D get_foo_protected (); > if ((*p) () !=3D 0) > abort (); > +#endif > > return 0; > } > > base-commit: 2ff48a4025515e93d722947a9eabb114f4a65b22 > > --000000000000c8ae5b06180c0e7a--