From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 0F0FE3858C50 for ; Fri, 10 Feb 2023 01:21:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0F0FE3858C50 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 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31A1Ie3j027665; Fri, 10 Feb 2023 01:20:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=pp1; bh=FKKx+jBRgYw/VGGpt44TJLcAmrzaMG6J1wKeRv2YFHI=; b=ej2756F/wwgxbZXq6EOIs724zH6CN5asBZeM++3Gyu9gxT91VyY29pLVDSXgaVpzCe+x VZHKEmFwmjjMQjnuWllhsD9a55/xlm0bjxuPS2+MGCsRKXjCyKzikgzvGpmakn2DScI7 rq7x+FArzkTKOE++MXKMlNjEwgIUhXIslHUc3jiPaPrvXmetLCIdsRCQX1vJOyz3h4RV Y215wlKYSGrpak+nlX/uM8bceglNs65F+BFNzm/NMS54SVlSCQMvzVkGGLRLoVfsCTtH bXehPX4CFGe73ikKQqF9lHf2OvtWK3HeVbbTkzeDV8jhk7GP8ibfXbsupWOuZLkcMBo6 qQ== Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nnc57g0pr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Feb 2023 01:20:44 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 319E1Hm2015745; Fri, 10 Feb 2023 01:20:42 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma03fra.de.ibm.com (PPS) with ESMTPS id 3nhf06mvkb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Feb 2023 01:20:42 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 31A1KeWa43385302 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 01:20:40 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EC0EC20040; Fri, 10 Feb 2023 01:20:39 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AE4E92004B; Fri, 10 Feb 2023 01:20:39 +0000 (GMT) Received: from [9.171.74.186] (unknown [9.171.74.186]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 10 Feb 2023 01:20:39 +0000 (GMT) Message-ID: <2292f8459429df853955d044b01d47e73f2e7d49.camel@linux.ibm.com> Subject: Re: [PATCH v2 4/7] x86_64_return_value_location: Support lvalue and rvalue references From: Ilya Leoshkevich To: Mark Wielaard Cc: elfutils-devel@sourceware.org Date: Fri, 10 Feb 2023 02:20:39 +0100 In-Reply-To: <2c67601b72f61c1394e1248aaeecc8c403692dca.camel@klomp.org> References: <20230208195226.144143-1-iii@linux.ibm.com> <20230208195226.144143-5-iii@linux.ibm.com> <2c67601b72f61c1394e1248aaeecc8c403692dca.camel@klomp.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.3 (3.46.3-1.fc37) MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 5_TPh1-tgbHjrMjgkIXR6g94Pnna1Nvh X-Proofpoint-GUID: 5_TPh1-tgbHjrMjgkIXR6g94Pnna1Nvh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-09_17,2023-02-09_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 mlxlogscore=999 adultscore=0 mlxscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302100007 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H2,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: On Thu, 2023-02-09 at 14:45 +0100, Mark Wielaard wrote: > Hi Ilya, >=20 > On Wed, 2023-02-08 at 20:52 +0100, Ilya Leoshkevich wrote: > > On the low level, they are the same as pointers. >=20 > Yes, I can see how that would work for return types. > Do you happen to have a testcase for this? You can trigger the issue by compiling the following: $ cat 1.cpp int &foo() { throw; } int &&bar() { throw; } $ g++ -g 1.cpp -c and then running $ LD_LIBRARY_PATH=3D../libelf:../libdw ./funcretval -e 1.o What would be a good way to integrate such a testcase? Currently all tests are built with gcc, is it okay to add one built with g++? If not, I guess the alternative would be to check in multiple compressed object files built for different platforms? > Right below this code is a check whether the type has a > DW_AT_byte_size, and if not we'll assume 8 as (address) size if the > type is either DW_TAG_pointer_type or DW_TAG_ptr_to_member_type. > Should the same be done for DW_TAG_reference_type and > DW_TAG_rvalue_reference_type? Sounds reasonable. Here is what I have on x86_64: <1><5a>: Abbrev Number: 1 (DW_TAG_reference_type) <5b> DW_AT_byte_size : 8 <1><80>: Abbrev Number: 7 (DW_TAG_rvalue_reference_type) <81> DW_AT_byte_size : 8 IIUC these checks handle weird compilers that do not emit DW_AT_byte_size. > This doesn't seem x86_64 specific, other backends have similar code, > I > assume they all need a similar update? Oh, right, this issue seems to affect all of them. > Thanks, >=20 > Mark >=20 > > Signed-off-by: Ilya Leoshkevich > > --- > > =C2=A0backends/x86_64_retval.c | 2 ++ > > =C2=A01 file changed, 2 insertions(+) > >=20 > > diff --git a/backends/x86_64_retval.c b/backends/x86_64_retval.c > > index f9114cb1..e668eacc 100644 > > --- a/backends/x86_64_retval.c > > +++ b/backends/x86_64_retval.c > > @@ -106,6 +106,8 @@ x86_64_return_value_location (Dwarf_Die > > *functypedie, const Dwarf_Op **locp) > > =C2=A0=C2=A0=C2=A0=C2=A0 case DW_TAG_enumeration_type: > > =C2=A0=C2=A0=C2=A0=C2=A0 case DW_TAG_pointer_type: > > =C2=A0=C2=A0=C2=A0=C2=A0 case DW_TAG_ptr_to_member_type: > > +=C2=A0=C2=A0=C2=A0 case DW_TAG_reference_type: > > +=C2=A0=C2=A0=C2=A0 case DW_TAG_rvalue_reference_type: > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Dwarf_Attribute attr_me= m; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (dwarf_formudata (dw= arf_attr_integrate (typedie, > > DW_AT_byte_size, >=20