From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3B0DE3858409; Thu, 16 Feb 2023 17:42:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3B0DE3858409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676569340; bh=a3FwXXll4eCjmEd1gKknaOLKZX+VoKW8r3VK+43m2+I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=csAvK3qTuU3gyGFmH+VsQ+IKqKw+4YyOUcx56MIJvIrzaLv9a7JVz+JgSjXm+FHt6 iPqDOH3PZrzJSb3nD8tL7lWCFPccZl3WoodnW0YVgMy0fEICJBi1OJTpmzkbXrjaqi g0hPOxGhFb4fNmIAKSDoYcO5V+icZylnOfe8IrAU= From: "i at maskray dot me" To: gdb-prs@sourceware.org Subject: [Bug gdb/29584] gdb: support zstd compressed .gnu_debugdata Date: Thu, 16 Feb 2023 17:42:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: i at maskray dot me 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: Message-ID: In-Reply-To: References: 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=3D29584 --- Comment #5 from Fangrui Song --- (In reply to Mark Wielaard from comment #4) > If we are changing the format, Can't we use standard ELF section compress= ion? > That supports zstd these days. Then the .gnu_debugdata can be just a norm= al > ELF section, that is a mini-ELF image, which happens to be zstd compresse= d. We can do that but it likely doesn't provide an overall advantage. The .gnu_debugdata content is an ELF file, not a regular section. We don't benefit from information like ch_type/ch_size/ch_addrline in the Chdr header. To embed an ELF file (with .symtab, .strtab, and optionally .debug_*), we n= eed one `objcopy --add-section` command, then one `eu-elfcompress -n` command (= with no binutils equivalent https://sourceware.org/bugzilla/show_bug.cgi?id=3D27= 452). Even eu-elfcompress -n doesn't provide the various zstd options that a distribution may toggle. Also, this process involves two binary manipulation commands on the ELF file. If we use `zstd a.debug; objcopy -S --add-section=3D.gnu_debugdata=3Da.debu= g.zstd a a.stripped`, there is just one binary manipulation command, and we can toggle zstd optio= ns easily. --=20 You are receiving this mail because: You are on the CC list for the bug.=