From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DC4153858C83; Tue, 29 Nov 2022 00:44:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC4153858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669682640; bh=xlDuHWB1pydfeKqDwpqmt7b/D23WMoNpf4+BTTEqEQc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vHN/AehtCouFuEhx5ggIZkBftTotF/GvI618leY18Q+71mLjH7N567zcMI3E0TKfT LfiY5Qpf7h4s+Hqwkj/SDYaX1UszqY/fxtCEZ3jYTu3OwfZEXw3Q/UcYnRm2QDb8Qi ChIrBNT7WKpUckxa4s0A4RbEn1ru6ar66Vk4JR5w= From: "david.faust at oracle dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106773] libbpf: failed to find BTF info for global/extern symbol 'bpf_link_fops' Date: Tue, 29 Nov 2022 00:44:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-debug X-Bugzilla-Severity: normal X-Bugzilla-Who: david.faust at oracle dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106773 --- Comment #3 from David Faust --- There are two remaining issues: 1. We are missing support for 'linkage=3Dextern' encoding for variables, so 'bpf_link_fops' and others are incorrectly marked with 'linkage=3Dglo= bal' instead. 2. 'bpf_link_fops' variable is encoded as 'void' type not 'const void'. This is a result of the BTF being generated from internal DWARF representation. The distinction seems to be intentionally removed in dwarf2out.cc:add_type_attribute(), with the later side-effect that looking up the type DIE for the variable when generating BTF actually fails and falls back to the default 'void'. I have an implementation for (1) in progress. For (2) I need to understand why the 'void'/'const void' distinction is removed in DWARF and how to work= =20 around it.=