From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa2f.google.com (mail-vk1-xa2f.google.com [IPv6:2607:f8b0:4864:20::a2f]) by sourceware.org (Postfix) with ESMTPS id 717B1385840E for ; Wed, 24 Nov 2021 11:34:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 717B1385840E Received: by mail-vk1-xa2f.google.com with SMTP id f7so1262139vkf.10 for ; Wed, 24 Nov 2021 03:34:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=An3JTNlDvz4jnvWJl68cIWch45E365zOUAKNZpKSh4A=; b=c6cNKEfBjkSgwdiFkIj2zLkwWi43TpkEAZ0SIa/ODiWjAlVMUEc9YQMBShKe8WtbmC jz76hb32gj6Xk9jzIF2+dPOHwurHNR1CK4fPkeEVfenUUxRJoqURDciLG59jvmMV5qQE eI/dhSJR6EiIqzhdRl6ZUs6sBF2LaryUmefCzGwEzmxj626t52rfgxc3tltv4RSuICas 56cnAslCf29ufjTVL3ML4F20X4TkPCLa7EVJ6S1WwA+9xljf/y8wNlQ8ijZfpEITwjpg 8rjCH3bzJDL2wNasRSeLZL4AaX59rad2yqEG0Xgl8rks90UFVGsFulSmpXEMkxQtRTHL KAPQ== X-Gm-Message-State: AOAM5331sMtZEUDWOomXQMDpl5GUOs0FDbzC6ijVOSoJg9pKOuJa+T06 je9dS91pAElc3n+uZkalfMcJ0jrxLXp0/FFzeDCY9A== X-Google-Smtp-Source: ABdhPJxfciLPdeSm34EnfYd1CjTsa69QlblXw3dObXbQqvVcxOpBlDvZeeZpJwP6mjam4USx0MRDos8nUPdH6odIE50= X-Received: by 2002:a05:6122:98d:: with SMTP id g13mr26479063vkd.15.1637753662774; Wed, 24 Nov 2021 03:34:22 -0800 (PST) MIME-Version: 1.0 References: <20210827185755.953243-1-gprocida@google.com> <20211119150138.2930800-1-gprocida@google.com> <87ilwiu72o.fsf@seketeli.org> In-Reply-To: From: Giuliano Procida Date: Wed, 24 Nov 2021 11:33:44 +0000 Message-ID: Subject: Re: [PATCH v3] Bug 28191 - Interpret DWARF 5 addrx locations To: Dodji Seketeli Cc: libabigail@sourceware.org, kernel-team@android.com, maennich@google.com, mjw@redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-22.1 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Nov 2021 11:34:24 -0000 Hi. On Wed, 24 Nov 2021 at 11:11, Giuliano Procida wrote: > > Hi Dodji. > > On Tue, 23 Nov 2021 at 17:15, Dodji Seketeli wrote: > > > > [I am adding Mark to the list recipients as I am going to ask him a > > question below] > > > > Indeed, I forgot to CC him on the patch. Hi Mark. > > > > > Hello, > > > > Giuliano Procida a =C3=A9crit: > > > > > This change uses libdw facilities to interpret location expressions > > > instead of using libabigail's own mini-interpreter. With the fix for > > > elfutils https://sourceware.org/bugzilla/show_bug.cgi?id=3D28220 in > > > elfutils-0.186, abidw will correctly interpret Clang DWARF 5 symbol > > > addresses. Without that fix many declarations will not be linked to > > > their corresponding symbols due to the incorrect interpretation of > > > location attribute data. > > > > > > * src/abg-dwarf-reader.cc (die_location_address): Use > > > dwarf_attr_integrate, dwarf_getlocation and > > > dwarf_getlocation_attr to decode addreses, instead of > > > die_location_expr and eval_last_constant_dwarf_sub_expr. > > > * tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.= 0.0.abi: > > > Refresh test reference output; two more symbols have types. > > > > Thanks for looking into that. > > > > It seems to me that we can also do away with the use of eval_last_const= ant_dwarf_sub_expr from > > die_member_offset. Would that work on your testing binaries? > > > > I think I originally wrote the code just before a trip away and didn't > have the time to look into the other callers then. > > > > > From what I am seeing, dwarf_getlocation_attr and dwarf_getlocation are > > present in elfutils 0.176 which is the oldest version that we need to > > support, so we should be able to ditch eval_last_constant_dwarf_sub_exp= r > > and its dependencies altogether. > > > > Or what am I missing? > > > > I think it would be good if we could rely on elfutils for this functional= ity. > > I've had a go at die_member_offset and I think I have it working (at > least with the test suite). I'll clean up what I have and post it. > There is considerable overlap with the address function. > > I haven't been able to get die_virtual_function_index to work as > dwarf_getlocation_attr fails. There may be a simpler recipe to follow > here. > My mistake, the problem is with base-class offsets, not vtable indexes, so I don't have die_member_offset working after all. It's possible an extra specialisation of the function for the right DWARF "form" will fix this. Giuliano. > If/when the 3 existing callers are working, there may be some code in > common to factor out as a new die_location_expr function. > > Regards, > Giuliano. > > > > > [...] > > > > Cheers, > > > > -- > > Dodji