From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id F2D343858C98 for ; Wed, 20 Mar 2024 23:15:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F2D343858C98 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F2D343858C98 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=45.83.234.184 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710976532; cv=none; b=UduNFDQoz+23p4I83vSTeV8Q14aozuYo+1p092xb/CHktWLEzUEaNEw3BLlfzjfXzrRA3wB4QKGcDXf8m4ZrekfmZoIXRPE9YG0eCZ+u5Pba9ktqZDmHCkCEfHKleI5GLIXMVoopEBW2zw51sDNy01iPm5IivXflZJqamVIK+OY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710976532; c=relaxed/simple; bh=Kq090jtJegV4EIgdC6wK+eZmgY0mflQoEKRGBm6CsiU=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=MpPtfCc4ZPZ4vLhUubiM28Ft+uc2nhSwjdS+mw8zAVZ80bqBAxNTXY1gIkitjH00Cx5EX3UCGP6ZeBCbyyZ9XFVFFTWl9r3SZNdCt0sPTqVi3l594kVPz5+rrqHp2PYVH7F8lCLNknO2/WsWYJlhDYXgPiAWY/mFTynJ7v1Aks8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by gnu.wildebeest.org (Postfix, from userid 1000) id 2A7D13000472; Thu, 21 Mar 2024 00:15:30 +0100 (CET) Date: Thu, 21 Mar 2024 00:15:30 +0100 From: Mark Wielaard To: Palmer Dabbelt Cc: elfutils-devel@sourceware.org Subject: Re: [PATCH] riscv: Partial implementation of flatten_aggregate Message-ID: <20240320231530.GM8319@gnu.wildebeest.org> References: <20240320150312.169280-1-mark@klomp.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Palmer, On Wed, Mar 20, 2024 at 01:17:14PM -0700, Palmer Dabbelt wrote: > >+flatten_aggregate_arg (Dwarf_Die *typedie, > >+ Dwarf_Word size, > >+ Dwarf_Die *arg0, > >+ Dwarf_Die *arg1) > > { > >- /* ??? */ > >+ int tag0, tag1; > >+ Dwarf_Die member; > >+ Dwarf_Word encoding0, encoding1; > >+ Dwarf_Attribute attr; > >+ Dwarf_Word size0, size1; > >+ > >+ if (size < 8 || size > 16) > >+ return 0; > > IIUC elfutils only supports riscv64? Assuming that's the case this > looks fine. Yes, at the moment we only support riscv64, we do accept 32bit riscv ELF files, but don't know anything about how it handles calling conventions, core file layout, etc. > >+ tag1 = dwarf_peeled_die_type (arg1, arg1); > >+ if (tag1 != DW_TAG_base_type) > >+ return 0; /* We can only handle two equal base types for now. */ > >+ > >+ if (dwarf_attr_integrate (arg1, DW_AT_encoding, &attr) == NULL > >+ || dwarf_formudata (&attr, &encoding1) != 0 > >+ || encoding0 != encoding1) > >+ return 0; /* We can only handle two of the same for now. */ > > We have that special case in the psABI where "struct { int; float; > }" gets split into int/FP registers. I don't really understand > elfutils, but I think it'll be possible to trip this up with > something along those lines. aha, I see... "A struct containing one floating-point real and one integer (or bitfield), in either order, is passed in a floating-point register and an integer register, provided the floating-point real is no more than ABI_FLEN bits wide and the integer is no more than XLEN bits wide." Yes, that isn't currently recognized. I'll try to add an update to handle this specific case. Thanks, Mark