From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 23AF03858407; Mon, 15 Nov 2021 03:19:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23AF03858407 From: "wcohen at redhat dot com" To: dwz@sourceware.org Subject: [Bug default/28594] New: Consider removing 0 length entries from variable and formal parameter location lists Date: Mon, 15 Nov 2021 03:19:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: dwz X-Bugzilla-Component: default X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: wcohen at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: nobody at sourceware dot 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 cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: dwz@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Dwz mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2021 03:19:07 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28594 Bug ID: 28594 Summary: Consider removing 0 length entries from variable and formal parameter location lists Product: dwz Version: unspecified Status: NEW Severity: normal Priority: P2 Component: default Assignee: nobody at sourceware dot org Reporter: wcohen at redhat dot com CC: dwz at sourceware dot org Target Milestone: --- When reviewing the kernel debuginfo of the Fedora Linux kernel I found that there were a number of places where gcc generated locations lists that had entries that are 0 length. There is a upstream gcc bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103241) that shows an examp= le of this occurring. There are a number of places in the kernel with 0 length entries that are not going to match anything due to the 0-length and the entries are just taking up space. As an alternative to fixing gcc upstream= dwz could also remove these 0-length entries. To get an idea of the number of t= imes this occurred a dwgrep (https://pmachata.github.io/dwgrep/) was written to print out each occurrence 0-length location list entries for regular and inlined functions: [wcohen@haro perf]$ dwgrep /usr/lib/debug/lib/modules/5.14.15-200.fc34.x86_64/vmlinux -e ' let A :=3D entry (?TAG_subprogram || ?TAG_inlined_subroutine) (?AT_ranges || ?AT_low_pc); let FSTART :=3D (A ?AT_ranges @AT_ranges low) || ( A low); let PARM :=3D A child (?TAG_formal_parameter || ?TAG_variable); (PARM ?AT_location @AT_location address length=3D=3D0) ([A name, FSTART, PA= RM name])' | grep \\[ |wc 93105 279315 4386700 One function in the kernel that has 0-length entries is static_protections.= =20 Took a look at it with: llvm-dwarfdump -c --name=3D"static_protection" /usr/lib/debug/lib/modules/5.14.15-200.fc34.x86_64/vmlinux | more See the following for static_protections where first entry for "prot" param= eter is 0 length and overlaps the next entry: 0x00e44d5c: DW_TAG_formal_parameter DW_AT_abstract_origin (0x00e3fb6d "prot") DW_AT_location (0x002c83db:=20 [0xffffffff8107a540, 0xffffffff8107a540): DW_OP_reg5 RDI [0xffffffff8107a540, 0xffffffff8107a569): DW_OP_reg5 RDI, DW_OP_piece 0x8 [0xffffffff8107a5a0, 0xffffffff8107a5f3): DW_OP_reg5 RDI [0xffffffff8107a617, 0xffffffff8107a65b): DW_OP_reg3 RBX [0xffffffff8107a66a, 0xffffffff8107a67e): DW_OP_reg3 RBX, DW_OP_piece 0x8 [0xffffffff8107a67e, 0xffffffff8107a68c): DW_OP_reg5 RDI [0xffffffff8107a68c, 0xffffffff8107a6a1): DW_OP_reg3 RBX, DW_OP_piece 0x8 [0xffffffff8107a6a1, 0xffffffff8107a6a1): DW_OP_reg3 RBX, DW_OP_piece 0x8 [0xffffffff8107a6a1, 0xffffffff8107a6cb): DW_OP_reg3 RBX [0xffffffff8107a6cb, 0xffffffff8107a6cb): DW_OP_reg3 RBX, DW_OP_piece 0x8 [0xffffffff81bc6967, 0xffffffff81bc6994): DW_OP_reg3 RBX, DW_OP_piece 0x8 [0xffffffff81bc69b5, 0xffffffff81bc6a24): DW_OP_reg3 RBX, DW_OP_piece 0x8) DW_AT_unknown_2137 (0x002c83c3) 0x00e44d69: DW_TAG_formal_parameter DW_AT_abstract_origin (0x00e3fb7a "start") DW_AT_location (0x002c84ed:=20 [0xffffffff8107a540, 0xffffffff8107a5a0): DW_OP_reg4 RSI [0xffffffff8107a5a0, 0xffffffff8107a65b): DW_OP_reg12 R12 [0xffffffff8107a65b, 0xffffffff8107a66a): DW_OP_GNU_entry_value(DW_OP_reg4 RSI), DW_OP_s tack_value [0xffffffff8107a66a, 0xffffffff8107a68c): DW_OP_reg4 RSI [0xffffffff8107a68c, 0xffffffff8107a6cb): DW_OP_reg12 R12 [0xffffffff8107a6cb, 0xffffffff8107a6cb): DW_OP_reg4 RSI [0xffffffff81bc6967, 0xffffffff81bc698c): DW_OP_reg4 RSI [0xffffffff81bc698c, 0xffffffff81bc6a24): DW_OP_reg12 R1= 2) DW_AT_unknown_2137 (0x002c84dd) 0x00e44d76: DW_TAG_formal_parameter DW_AT_abstract_origin (0x00e3fb87 "pfn") DW_AT_location (0x002c85a8:=20 [0xffffffff8107a540, 0xffffffff8107a5a0): DW_OP_reg1 RDX [0xffffffff8107a5a0, 0xffffffff8107a65b): DW_OP_reg15 R15 [0xffffffff8107a65b, 0xffffffff8107a66a): DW_OP_GNU_entry_value(DW_OP_reg1 RDX), DW_OP_s tack_value [0xffffffff8107a66a, 0xffffffff8107a68c): DW_OP_reg1 RDX [0xffffffff8107a68c, 0xffffffff8107a6cb): DW_OP_reg15 R15 [0xffffffff8107a6cb, 0xffffffff8107a6cb): DW_OP_reg1 RDX [0xffffffff81bc6967, 0xffffffff81bc6983): DW_OP_reg1 RDX [0xffffffff81bc6983, 0xffffffff81bc6a24): DW_OP_reg15 R1= 5) DW_AT_unknown_2137 (0x002c8598) 0x00e44d83: DW_TAG_formal_parameter DW_AT_abstract_origin (0x00e3fb94 "npg") DW_AT_location (0x002c8663:=20 [0xffffffff8107a540, 0xffffffff8107a5a0): DW_OP_reg2 RCX [0xffffffff8107a5a0, 0xffffffff8107a65b): DW_OP_reg13 R13 [0xffffffff8107a65b, 0xffffffff8107a66a): DW_OP_GNU_entry_value(DW_OP_reg2 RCX), DW_OP_s tack_value [0xffffffff8107a66a, 0xffffffff8107a68c): DW_OP_reg2 RCX [0xffffffff8107a68c, 0xffffffff8107a6cb): DW_OP_reg13 R13 [0xffffffff8107a6cb, 0xffffffff8107a6cb): DW_OP_reg2 RCX [0xffffffff81bc6967, 0xffffffff81bc6977): DW_OP_reg2 RCX [0xffffffff81bc6977, 0xffffffff81bc6a24): DW_OP_reg13 R1= 3) DW_AT_unknown_2137 (0x002c8653) 0x00e44d90: DW_TAG_formal_parameter DW_AT_abstract_origin (0x00e3fba1 "lpsize") DW_AT_location (0x002c8718:=20 [0xffffffff8107a540, 0xffffffff8107a585): DW_OP_reg8 R8 [0xffffffff8107a585, 0xffffffff8107a65b): DW_OP_reg14 R14 [0xffffffff8107a65b, 0xffffffff8107a66a): DW_OP_GNU_entry_value(DW_OP_reg8 R8), DW_OP_st ack_value [0xffffffff8107a66a, 0xffffffff8107a6cb): DW_OP_reg14 R14 [0xffffffff81bc6967, 0xffffffff81bc6a24): DW_OP_reg14 R1= 4) DW_AT_unknown_2137 (0x002c870e) 0x00e44d9d: DW_TAG_formal_parameter DW_AT_abstract_origin (0x00e3fbae "warnlvl") DW_AT_location (0x002c8798:=20 [0xffffffff8107a540, 0xffffffff8107a5a0): DW_OP_reg9 R9 [0xffffffff8107a5a0, 0xffffffff8107a66a): DW_OP_fbreg -72 [0xffffffff8107a66a, 0xffffffff8107a68c): DW_OP_reg9 R9 [0xffffffff8107a68c, 0xffffffff8107a6cb): DW_OP_fbreg -72 [0xffffffff8107a6cb, 0xffffffff8107a6cb): DW_OP_reg9 R9 [0xffffffff81bc6967, 0xffffffff81bc6974): DW_OP_reg9 R9 [0xffffffff81bc6974, 0xffffffff81bc6a24): DW_OP_fbreg -7= 2) DW_AT_unknown_2137 (0x002c878a) --=20 You are receiving this mail because: You are on the CC list for the bug.=