| Message ID | 20260313151119.3918323-2-jremus@linux.ibm.com |
|---|---|
| State | New |
| Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id EDC864B3589B for <patchwork@sourceware.org>; Fri, 13 Mar 2026 15:14:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EDC864B3589B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=YFvGHUg9 X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 8CA664B7A1DF for <binutils@sourceware.org>; Fri, 13 Mar 2026 15:11:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8CA664B7A1DF Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8CA664B7A1DF Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773414692; cv=none; b=d7q2tNrhDdWB5qEE8vVlBN71O+SFEb8pFBjQBK6CHuOkbwRUf+6mCWOPW4thHdxg2PSbmBugm9QBLgR0VtrStLAn5c+pCXTJTA/WyspeLEmdgtTI8VUVOjU54XuAUqYwfOwupgizvQD1uQTpcQ5aGfEzunhb6J7y1+/8iSmvhgk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773414692; c=relaxed/simple; bh=WyUjZU5/BgiY+eh34CVXIVmW6kc+Fm1ACKhzIApIwqs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dn5mS94eTIvsgIMPpeQaKqNtlv7W7YYuUxanIH8MTC87ae5IVNkLkTOJj9QKjxEoeNv8XM/oqW2RZBbJurclYmwk+1E6RMB6Phf4k3zaQy76C8imSHqD1kWC8+Z+bhdIIFOf6CaEnMky4+LCkkr4LCZSFRi4U7Hnlkq01e+7bAM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8CA664B7A1DF Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62D4nWnX2256577 for <binutils@sourceware.org>; Fri, 13 Mar 2026 15:11:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=kRWRIwSCMkMvy2nSB gcoluZKbzmeEFP6B+ekjirExdg=; b=YFvGHUg9THS40OySEurqHGpzxZorgl2qz 00lHQSzmBcnV0jt5eg3xIL8wgDWQIP7Y6VvmM8lbGQsQEJPnKdDUCfxRzfSCkQb8 BA8cu8UhssFbtLc4s6Tr3zZ0ZmHeTd1VYVrsAUD/4E830VNsvFpNCeaveyuS2evC L2yJEnIncx222FbhCWpU+qOONBsL2kq0V2t19nycXWHQNQDDqK343XBD+lCUJUFd vbu+IXDdlABIPF/QrJAw/C21uGRpx0FciLvAHMs+7Xp3R6qydFbVoKHxFQyfnLIt nJzp1zjxCYfng64SFtCwEaG2q/+UYYGlkmS0BZbTvgorzUqvGCT6g== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4cuh92gd21-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Mar 2026 15:11:30 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 62DEwTKK021245; Fri, 13 Mar 2026 15:11:29 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4cuha9q4q8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Mar 2026 15:11:29 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 62DFBPel49152482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Mar 2026 15:11:25 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9AF5620040; Fri, 13 Mar 2026 15:11:25 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7B83B2004B; Fri, 13 Mar 2026 15:11:25 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 13 Mar 2026 15:11:25 +0000 (GMT) From: Jens Remus <jremus@linux.ibm.com> To: binutils@sourceware.org, Andreas Krebbel <krebbel@linux.ibm.com>, Alan Modra <amodra@gmail.com> Cc: Jens Remus <jremus@linux.ibm.com>, Ilya Leoshkevich <iii@linux.ibm.com> Subject: [PATCH 1/1] s390: Un-XFAIL some non-PIC load offset ELF visibility tests Date: Fri, 13 Mar 2026 16:11:19 +0100 Message-ID: <20260313151119.3918323-2-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260313151119.3918323-1-jremus@linux.ibm.com> References: <20260313151119.3918323-1-jremus@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-ORIG-GUID: XtcNmoWo4XT0pK2EIJZ47XXKM1pUewiK X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzEzMDEyMCBTYWx0ZWRfXyfFeHdM9Jy4O W0M8RpDE3B8mRuWtCJua6UQdL0hEvYuc2PuoYoP3rb+KEmVLUerqiB3KqOhezLW/dlLkG3RnA7K vmqPp1vH4URJsRBrRM82JPndjQtSUvDHb1EvWf/G/P1q37+Mb+BILz8nZiLbxAi3GMIF5ow1NHH THAAYO9XRK/5dTyLeBcx/i+kQ8ILBa99GKPreZ4oCxHqAUqOfrgGzMffvBkXMQOsWLmrWFPr3D8 nrQkbR9ni3oN0P/7s4TJH7jeOGS9+0GnROxFGPj3bS73M7s3Yu9IReppOUqSnJY7lElTWXmnSjy 6SmE3SzPoqFAga3EoW/HAf8ksoFb4JM+4pZSEhJDGk4yng7GTN/1kxrxSrwgD/mHkyPKhpzaMqC J82Yf6tmUjx6gUVuUcdbA/mGrMgBcMLPNonD6niif4fxWTH5JbRw9N2uawWaXwkAUAu7Jzwb49P aIrpEH3DYnYyQavHVBg== X-Proofpoint-GUID: LuJrepgueG07eYGA6-3d-TtDALVaYnU7 X-Authority-Analysis: v=2.4 cv=XNk9iAhE c=1 sm=1 tr=0 ts=69b42923 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VnNF1IyMAAAA:8 a=DJ419dd7jfYU-ErAC7MA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-13_02,2026-03-13_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 adultscore=0 bulkscore=0 phishscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603130120 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, 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 sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
s390: Un-XFAIL some non-PIC load offset ELF visibility tests
|
|
Checks
| Context | Check | Description |
|---|---|---|
| linaro-tcwg-bot/tcwg_binutils_build--master-arm | success | Build passed |
| linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 | success | Build passed |
| linaro-tcwg-bot/tcwg_binutils_check--master-arm | success | Test passed |
| linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 | success | Test passed |
Commit Message
Jens Remus
March 13, 2026, 3:11 p.m. UTC
Some of the ELF visibility tests that use a non-PIC shared library with
load offset (first load segment has a non-zero virtual address) XPASS on
s390 64-bit (s390x):
PASS: visibility (hidden) (non PIC, load offset)
XFAIL: visibility (hidden_normal) (non PIC, load offset)
PASS: visibility (hidden_undef) (non PIC, load offset)
PASS: visibility (hidden_undef_def) (non PIC, load offset)
XPASS: visibility (hidden_weak) (non PIC, load offset)
XPASS: visibility (protected) (non PIC, load offset)
PASS: visibility (protected_undef) (non PIC, load offset)
XPASS: visibility (protected_undef_def) (non PIC, load offset)
XPASS: visibility (protected_weak) (non PIC, load offset)
XFAIL: visibility (normal) (non PIC, load offset)
This is due to Alan Modra's commit 125c64931b97 from 2006, which moved
overriddenvar, shlib_overriddencall2, and shared_data from sh1.c to
sh2.c, if the shared library is build non-PIC. This prevents GCC from
treating them as local symbols, preventing the executable from
overriding them, causing the tests to fail because interposition did
not work.
This actually only became visible due to H.J. Lu's commit fd7728c8a4aa
("ld: Update function prototypes for compilers defaulting to -std=gnu23")
from 2025, that fixed the ELF visibility test's function prototypes.
Previously all of the "visibility" tests would appear as UNSUPPORTED, as
the prerequisite compile of main.c would fail due to the function
prototypes not matching with their definitions.
In general creating shared libraries from non-PIC compiled code is not
supported on s390 64-bit (s390x). This is because shared libraries are
inherently position independent. The Glibc dynamic loader common code
passes the virtual address from the first load segment as hint to
mmap(). As a result a shared library with "load offset" may be loaded
at the virtual address used at link-time, but this is not guaranteed.
The following ELF visibility tests using a non-PIC shared library with
load offset XPASS, if the non-PIC shared library is loaded at its link-
time "load offset". This causes the tests to PASS by chance. Un-XFAIL
them.
XPASS: visibility (hidden_weak) (non PIC, load offset)
XPASS: visibility (protected) (non PIC, load offset)
XPASS: visibility (protected_undef_def) (non PIC, load offset)
XPASS: visibility (protected_weak) (non PIC, load offset)
The following ELF visibility tests using a non-PIC shared library with
load offset still XFAIL:
XFAIL: visibility (hidden_normal) (non PIC, load offset)
XFAIL: visibility (normal) (non PIC, load offset)
This is because visibility_var is local in sh1.c, preventing the
executable from overriding it, causing the tests to fail because
interposition does not work.
Note that all of the ELF visibility tests using a non-PIC shared library
without load offset XFAIL, as they are loaded at a random address, which
is incompatible with non-PIC code.
ld/testsuite/
* ld-vsb/vsb.exp: Un-XFAIL some non-PIC load offset ELF
visibility tests on s390 64-bit (s390x).
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
---
ld/testsuite/ld-vsb/vsb.exp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
On Fri, Mar 13, 2026 at 04:11:19PM +0100, Jens Remus wrote: > In general creating shared libraries from non-PIC compiled code is not > supported on s390 64-bit (s390x). Then don't run what are senseless tests for s390. It really isn't worth wasting time trying to make these tests work. Even x86 (which is where this non-pic shared library nonsense originated) xfails a bunch of the non-pic shared tests. In my opinion they all ought to be removed unless they use assembly source files, because there is a fundamental gcc conflation of two separate concepts: "compile for a shared library" and "compile non-pic". Yes, non-pic shared libraries can be supported via dynamic text relocations if you control your gag reflex, but you surely want "compile for a shared library" in shared library tests. Thus the compiled non-pic shared library ld tests are all invalid.
On 3/14/2026 1:01 AM, Alan Modra wrote: > On Fri, Mar 13, 2026 at 04:11:19PM +0100, Jens Remus wrote: >> In general creating shared libraries from non-PIC compiled code is not >> supported on s390 64-bit (s390x). > > Then don't run what are senseless tests for s390. It really isn't > worth wasting time trying to make these tests work. Even x86 (which > is where this non-pic shared library nonsense originated) xfails a > bunch of the non-pic shared tests. I simply did not dare. Given many targets run those tests I felt like there must be a hidden sense that I just did not realize yet. Thanks for your feedback! I'll send a v2 that skips the non-PIC shared library visibility tests on s390 64-bit (s390x). > In my opinion they all ought to be removed unless they use assembly > source files, because there is a fundamental gcc conflation of two > separate concepts: "compile for a shared library" and "compile > non-pic". Yes, non-pic shared libraries can be supported via dynamic > text relocations if you control your gag reflex, but you surely want > "compile for a shared library" in shared library tests. Thus the > compiled non-pic shared library ld tests are all invalid. Regards, Jens
diff --git a/ld/testsuite/ld-vsb/vsb.exp b/ld/testsuite/ld-vsb/vsb.exp index 03bfd1b241fa..b48e6353eb07 100644 --- a/ld/testsuite/ld-vsb/vsb.exp +++ b/ld/testsuite/ld-vsb/vsb.exp @@ -370,11 +370,14 @@ proc visibility_run {visibility} { || [ string match $visibility "protected_weak" ] || [ string match $visibility "normal" ] } { setup_xfail "powerpc-*-linux*" - setup_xfail "s390x-*-linux*" if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainnp.o] } { setup_xfail "sparc*-*-linux*" } } + if { [ string match $visibility "hidden_normal" ] + || [ string match $visibility "normal" ] } { + setup_xfail "s390x-*-linux*" + } if { ![ string match $visibility "hidden_undef" ] && ![ string match $visibility "protected_undef" ] } { setup_xfail "ia64-*-linux*"