From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F27583858C62; Wed, 3 Jan 2024 20:54:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F27583858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704315281; bh=q7EZ84r2yh5U6DjESVutoAr/fBNN+ciAieJ+0/OZdsc=; h=From:To:Subject:Date:From; b=DGlncs8koLjcyqXeoNcavo2rGEC+0u7c7N2iZXAvR2TA4oPCJ1MqjAMuP331sOH3x Zonhoz1rlvriNgc/CGEFMS0cxMVsJ+cAU1MJi8Eop6bjennPVWb2SJqK3O79ODSYCL yiqIppMr0v65U+AENqND1CzOT/I8Xs241sMaZ4wk= From: "cupertino.miranda at oracle dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113225] New: bpf: attributekernel_helper function declarations create a BTF_FUNC_EXTERN. Date: Wed, 03 Jan 2024 20:54:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cupertino.miranda 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D113225 Bug ID: 113225 Summary: bpf: attributekernel_helper function declarations create a BTF_FUNC_EXTERN. Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: cupertino.miranda at oracle dot com Target Milestone: --- When using attribute kernel_helper such as the one in the example: extern int foo (int arg) __attribute__((kernel_helper (666))); int bar () { return foo (20); } The following BTF entries are created:=20 [1] int 'int'(1U#B) size=3D4U#B offset=3D0UB#b bits=3D32UB#b SIGNED=20 [2] func_proto type=3D1 param '' type=3D1 [3] func_proto type=3D1 [4] func 'foo'(5U#B) type=3D2 linkage=3D0 (extern) [5] func 'bar'(9U#B) type=3D3 linkage=3D1 (global) BTF information is generated for the extern function declaration, imposing = some problem to tools such as bpftool that relies on BTF information to validate completeness of the BTF information. Since kernel helpers are not true functions the BTF information created, although accurate with how the function is declared, it is not accurate with its semantics. Plan resolution is to skip btf output to any attributed kernel_helper funct= ion declaration, since the BTF information in this case is not really required.=