From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /AJIBo74hWqYATEAWB0awg (envelope-from ) for ; Wed, 19 Aug 2026 14:40:14 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=DjzhA3Om; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 0518F1E0A3; Wed, 19 Aug 2026 14:40:14 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 773951E09B for ; Wed, 19 Aug 2026 14:40:13 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 083344BAE7EB for ; Wed, 19 Aug 2026 18:40:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 083344BAE7EB 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=DjzhA3Om Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id BA5914BA2E26 for ; Wed, 19 Aug 2026 18:39:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BA5914BA2E26 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 BA5914BA2E26 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787164786; cv=none; b=A7xAxlfpLp7Dr1aceEkTFj5Kc+opwHk43/v5D0ouunTlfZ2Xjs0d5UFI3aP01JhS4lXOkZMC9mHF71GtOxnWutqGjbsB61ikyPvINHOMNIvoH7mye//UyPF7jox13M0Q8iSUjK2mCTWrrx933PXFQUdmy7StkKecadynjmRW+Ns= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787164786; c=relaxed/simple; bh=tS/LBDMCzyJxw7Q1i1JW2LGBfaKNlrpnvHDP64ODjI8=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=QyNpecsBl1UhFYq5ZSMzxoeEFkYk83ky3CRv91l9x6DGco+hm5hZwL2LgB0z/BeBp2aNJMrvFQ9RaOaigL8kt7TI4kvGB1EXQyxYxY/dZ11UosOGqeEU31OQnpX7kbEiYaNqqswcByYdVuZ3IMEwXh3NQM4fZWAs8hRMtXCDoA0= ARC-Authentication-Results: i=1; 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=DjzhA3Om DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA5914BA2E26 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67JI1fHg048173 for ; Wed, 19 Aug 2026 18:39:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=pp1; bh=EKUGvyz93aH45/zNxkt08SZlbdRTri lDYHM9Tjbk/0A=; b=DjzhA3OmluEYG06PKTZHuxAfiXKu6yPNxG+E+LmiJ7sNgt JFwWTB13RSthvF9h1YgEJBsEDCCdPQu5HyVPrP6XOvt/uDyL665uCzVbXEU+O7WI xDIgZlytWF5mCGuBICmKsI5QPfEUrG74YY7T3yJA9f8QApwogFcA8yD3hlZtKLMm cmm0R2yREQFZrjZdsfNjbI1fFntpYwdI94jm7NXxkKWwz5VGyNnF8Mn3n2FckTpq I2tFIn08zkKwC9o+WixHgqkAvhLYBYhMKecrv9qERtPM5Es4hU7eZHOb8z2BrQ3+ wNAa6xGtDqJc6vFvZvFe8Fnf2Gk43nwcZlcViamw== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4g4yu45f5m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 19 Aug 2026 18:39:45 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 67JIQJSZ025526 for ; Wed, 19 Aug 2026 18:39:45 GMT Received: from smtprelay04.wdc07v.mail.ibm.com ([172.16.1.71]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4g32twag7g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 19 Aug 2026 18:39:45 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (smtpav03.wdc07v.mail.ibm.com [10.39.53.230]) by smtprelay04.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 67JIdgfC46662126 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Aug 2026 18:39:42 GMT Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A6BBD5805F; Wed, 19 Aug 2026 18:39:42 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DC8D95805C; Wed, 19 Aug 2026 18:39:40 +0000 (GMT) Received: from [9.124.213.60] (unknown [9.124.213.60]) by smtpav03.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 19 Aug 2026 18:39:40 +0000 (GMT) Content-Type: multipart/alternative; boundary="------------hKg0cwZfWKG2eUHNX18FLYCi" Message-ID: <8bd56e49-bedd-4f5b-9362-63b369d49aa5@linux.ibm.com> Date: Thu, 20 Aug 2026 00:09:39 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCHi v1] PowerPC: Create call stubs for compiled modules To: Ulrich Weigand , "gdb-patches@sourceware.org" Cc: Abhay Kandpal , "cel@linux.ibm.com" References: <20260813092829.262470-1-abhay@linux.ibm.com> <1a31198de71abfc8f36c893cc97c81b72c6112a7.camel@de.ibm.com> <9f77ef3d-f40d-4887-9984-2f18447fbadd@linux.ibm.com> From: Abhay Kandpal Content-Language: en-GB In-Reply-To: X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=CpuPtH4D c=1 sm=1 tr=0 ts=6a85f871 cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=Sv0fKeRqtYgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=r77TgQKjGQsHNAKrUKIA:9 a=VnNF1IyMAAAA:8 a=bjtY7i8NfAN54PLHcogA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=WvB_-MxE-hHMtqybd60A:9 a=PVDP8YIwmKe_ZKu5:21 a=_W_S_7VecoQA:10 a=lqcHg5cX4UMA:10 X-Proofpoint-ORIG-GUID: gTsHHk07iTM3fn0_vFflz7ao7JTx8aQ9 X-Proofpoint-GUID: gTsHHk07iTM3fn0_vFflz7ao7JTx8aQ9 X-Proofpoint-Spam-Info: AW1haW4tMjYwODE5MDE0MyBTYWx0ZWRfX3Vqohz2Z7r9r 8cUdlN48sie18vfPUHGnls6nIrLcW/1/CutNNj9L9k7m9BsH+QxpPEYrBBobNoaKF41OMNpH0Nz MGA4MsHftRRPaSyuxCF0TEHwVe/j+8Y= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE5MDE0MyBTYWx0ZWRfXykEHeTVl8lme hn35zSgpvkJvy4jMb+m4tLo12B//PF0ooPDMrTB0RnRcAmuFLDcisGF5AIfbDBHTJwcjPoyQCFm 55sMxHeEUubWqRNqxYjuV5lKF8memuRvPLH/67FNxvq9K/uvy3PbDX0mlJCPLPl3etGkpCVBJQ9 L03G4UuXPJMhIXg6dQSQ/ylZjP8t8K7B9srx3o5zzFifwG7rL3e2rSaOEhOVAfQgDrca6805ChA Wy8X3B6XNwtRKxOrIc0Xcgiw/O/gcRXprL5MxFWSyo4l8PTzv8ub9rx5zQv5M4ThyJXgxXCwEP3 1xz7nV4iEg6MhbIQ2c9yboRaK0G/C/+5WEj20ve57Hwexg6LJfhwUHxF5orzua+cMLSE5UgIgZL +cISjVNY4Px/EOdQU+kxD3D2V4Zun8u54mPONc+y7W04HEOdbvyXqVC725FhfBHuUbc0XXncabO FvQA/RWEAMcSYO2ExlA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-19_05,2026-08-19_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 priorityscore=1501 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608190143 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org This is a multi-part message in MIME format. --------------hKg0cwZfWKG2eUHNX18FLYCi Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Ulrich, That was it, thanks.|-mlongcall -mno-pltseq| fixes the problem. GCC now loads the target from the module's own .toc via TOC16_HA/TOC16_LO_DS, which BFD resolves normally, and emits the r2 save and restore around the call itself. I have created a new patch which adds these to the PowerPC compile options; I've dropped the call stub patch. Tested on powerpc64le-linux, no unexpected failures in the full testsuite. Thanks, Abhay On 19/08/26 18:09, Ulrich Weigand wrote: > Abhay Kandpal wrote: > >> 24:    std     r2,24(r1) >>   30:    addis   r12,r2,0 >>             30: R_PPC64_PLT16_HA    _setjmp >>   34:    ld      r12,0(r12) >>             34: R_PPC64_PLT16_LO_DS    _setjmp >> 80:    mtctr   r12 >>             80: R_PPC64_PLTSEQ    longjmp >> 84:    bctrl >>             84: R_PPC64_PLTCALL    longjmp >>   88:    ld      r2,24(r1) > I think you also need the -mno-pltseq option to get rid of > this inlined PLT sequence. >> > Bye, > Ulrich --------------hKg0cwZfWKG2eUHNX18FLYCi Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Hi Ulrich,
That was it, thanks. -mlongcall -mno-pltseq fixes the problem. 
GCC now loads the target from the module's own .toc via TOC16_HA/TOC16_LO_DS, 
which BFD resolves normally, and emits the r2 save and restore around the call itself.
I have created a new patch which adds these to the PowerPC compile options;
I've dropped the call stub patch. Tested on powerpc64le-linux,
no unexpected failures in the full testsuite.
Thanks,
Abhay


On 19/08/26 18:09, Ulrich Weigand wrote:
Abhay Kandpal <abhay@linux.ibm.com> wrote:

  24:    std     r2,24(r1)
  30:    addis   r12,r2,0
            30: R_PPC64_PLT16_HA    _setjmp
  34:    ld      r12,0(r12)
            34: R_PPC64_PLT16_LO_DS    _setjmp
80:    mtctr   r12
            80: R_PPC64_PLTSEQ    longjmp
84:    bctrl
            84: R_PPC64_PLTCALL    longjmp
  88:    ld      r2,24(r1)
I think you also need the -mno-pltseq option to get rid of
this inlined PLT sequence.

Bye,
Ulrich
--------------hKg0cwZfWKG2eUHNX18FLYCi--