From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CB76E3858417; Sun, 17 Mar 2024 14:46:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB76E3858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1710686807; bh=v4iFsNZuFRsVsHX72jWqcfn7PGMMVQZ8pDH2QReV+ck=; h=From:To:Subject:Date:From; b=nXQKocrqPEOyEoDR+SIih4xdjmmgLd7vzLy+2R05p3l6FlCYWyWMXIEUrqPIf7N29 5nWs7jNpgwGq8jYTM9vPnCOLYWs9nRAhVoOW1ryZ0VcJxpt02xmymWDKKvgwHjvibX z4DrdNdEw1yD0XBpGsE1PrgvQp4DA5lLYj5ad2aA= From: "mark at klomp dot org" To: debugedit@sourceware.org Subject: [Bug debugedit/31504] New: debugedit writes out ELF file even when nothing has been updated Date: Sun, 17 Mar 2024 14:46:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: debugedit X-Bugzilla-Component: debugedit X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mark at klomp dot org 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31504 Bug ID: 31504 Summary: debugedit writes out ELF file even when nothing has been updated Product: debugedit Version: unspecified Status: NEW Severity: normal Priority: P2 Component: debugedit Assignee: unassigned at sourceware dot org Reporter: mark at klomp dot org CC: debugedit at sourceware dot org Target Milestone: --- See also https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/issues/1= 9#note_171380 (warning javascript) Basically what happens is that these .net ELF files are not really ELF file= s, but are ELF files with some extra data tagged on. Since libelf doesn't know anything about this extra data in the file it will simply truncate it after= all known ELF data structures are written out. This is normally harmless because elf_update ELF_C_WRITE doesn't really write out anything that hasn't change= d. But in this case it does. What we could do at the end of main () is to check needs_update, and probab= ly all needs_xxx_update flags, and simply not call elf_update if all of them a= re false. Note that this doesn't help if anything does really (need) updates. This is really not a valid ELF file. But it will help if someone only wants the build-id or file list. --=20 You are receiving this mail because: You are on the CC list for the bug.=