From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DF6AB3858C83; Mon, 28 Feb 2022 13:15:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF6AB3858C83 From: "dichen at redhat dot com" To: elfutils-devel@sourceware.org Subject: [Bug tools/28928] New: Wrong dynamic section entry number Date: Mon, 28 Feb 2022 13:15:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: tools X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dichen at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2022 13:15:47 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28928 Bug ID: 28928 Summary: Wrong dynamic section entry number Product: elfutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: tools Assignee: unassigned at sourceware dot org Reporter: dichen at redhat dot com CC: elfutils-devel at sourceware dot org Target Milestone: --- when using `$ eu-readelf -d {file}` to get the number of dynamic section entris, It wrongly counts the padding DT_NULLs as dynamic section entries. However, DT_NULL Marks end of dynamic section. They should not be counted as dynamic section entries. ``` $ eu-readelf -d /usr/local/bin/eu-readelf=20 Dynamic segment contains 31 entries: Addr: 0x0000000000474e00 Offset: 0x073e00 Link to section: [ 7] '.dynstr' Type Value NEEDED Shared library: [libdw.so.1] NEEDED Shared library: [libelf.so.1] NEEDED Shared library: [libc.so.6] INIT 0x0000000000404000 FINI 0x000000000043d4a8 INIT_ARRAY 0x0000000000474df0 INIT_ARRAYSZ 8 (bytes) FINI_ARRAY 0x0000000000474df8 FINI_ARRAYSZ 8 (bytes) GNU_HASH 0x00000000004003a0 STRTAB 0x00000000004016b0 SYMTAB 0x00000000004003f0 STRSZ 3086 (bytes) SYMENT 24 (bytes) DEBUG=20=20=20=20=20=20=20=20=20=20=20=20=20 PLTGOT 0x0000000000475000 PLTRELSZ 4560 (bytes) PLTREL RELA JMPREL 0x00000000004026a0 RELA 0x0000000000402610 RELASZ 144 (bytes) RELAENT 24 (bytes) VERNEED 0x0000000000402450 VERNEEDNUM 3 VERSYM 0x00000000004022be NULL=20=20=20=20=20=20=20=20=20=20=20=20=20=20 NULL=20=20=20=20=20=20=20=20=20=20=20=20=20=20 NULL=20=20=20=20=20=20=20=20=20=20=20=20=20=20 NULL=20=20=20=20=20=20=20=20=20=20=20=20=20=20 NULL=20=20=20=20=20=20=20=20=20=20=20=20=20=20 NULL=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ``` --=20 You are receiving this mail because: You are on the CC list for the bug.=