From owner-freebsd-toolchain@freebsd.org Tue Feb 2 14:26:44 2021 Return-Path: Delivered-To: freebsd-toolchain@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16372534195 for ; Tue, 2 Feb 2021 14:26:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4DVRvl736mz3MP8 for ; Tue, 2 Feb 2021 14:26:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id F035C533ED0; Tue, 2 Feb 2021 14:26:43 +0000 (UTC) Delivered-To: toolchain@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EFFFA534138 for ; Tue, 2 Feb 2021 14:26:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVRvl6Pcrz3MWN for ; Tue, 2 Feb 2021 14:26:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAB05776F for ; Tue, 2 Feb 2021 14:26:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 112EQhqk084937 for ; Tue, 2 Feb 2021 14:26:43 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 112EQh8k084936 for toolchain@FreeBSD.org; Tue, 2 Feb 2021 14:26:43 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: toolchain@FreeBSD.org Subject: [Bug 246015] readelf -S truncates section names Date: Tue, 02 Feb 2021 14:26:44 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: emaste@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: toolchain@FreeBSD.org 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: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2021 14:26:44 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D246015 --- Comment #1 from Ed Maste --- Indeed, creating a test file via $ objcopy -I binary -O elf64-x86-64 -B x86-64 --rename-section .data=3D.this-is-a-really-long-name empty output.elf ELF Tool Chain readelf by default shows: $ readelf -S output.elf There are 5 section headers, starting at offset 0x78: Section Headers: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align [ 0] NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 [ 1] .this-is-a-really PROGBITS 0000000000000000 00000040 0000000000000000 0000000000000000 WA 0 0 1 [ 2] .shstrtab STRTAB 0000000000000000 00000040 0000000000000038 0000000000000000 0 0 1 [ 3] .symtab SYMTAB 0000000000000000 000001b8 0000000000000078 0000000000000018 4 2 8 [ 4] .strtab STRTAB 0000000000000000 00000230 000000000000003a 0000000000000000 0 0 1 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings) I (info), L (link order), G (group), x (unknown) O (extra OS processing required) o (OS specific), p (processor specific) GNU readelf 2.33.1 shows: $ /usr/local/bin/readelf -S output.elf There are 5 section headers, starting at offset 0x78: Section Headers: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align [ 0] NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 [ 1] .this-is-a-really PROGBITS 0000000000000000 00000040 0000000000000000 0000000000000000 WA 0 0 1 [ 2] .shstrtab STRTAB 0000000000000000 00000040 0000000000000038 0000000000000000 0 0 1 [ 3] .symtab SYMTAB 0000000000000000 000001b8 0000000000000078 0000000000000018 4 2 8 [ 4] .strtab STRTAB 0000000000000000 00000230 000000000000003a 0000000000000000 0 0 1 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings), I (info), L (link order), O (extra OS processing required), G (group), T (TLS), C (compressed), x (unknown), o (OS specific), E (exclude), l (large), p (processor specific) (These differ only in the key.) With -W GNU readelf shows: $ /usr/local/bin/readelf -S -W output.elf=20 There are 5 section headers, starting at offset 0x78: Section Headers: [Nr] Name Type Address Off Size ES = Flg Lk Inf Al [ 0] NULL 0000000000000000 000000 000000 00= =20=20=20=20=20 0 0 0 [ 1] .this-is-a-really-long-name PROGBITS 0000000000000000 000040 000000 00 WA 0 0 1 [ 2] .shstrtab STRTAB 0000000000000000 000040 000038 00= =20=20=20=20=20 0 0 1 [ 3] .symtab SYMTAB 0000000000000000 0001b8 000078 18= =20=20=20=20=20 4 2 8 [ 4] .strtab STRTAB 0000000000000000 000230 00003a 00= =20=20=20=20=20 0 0 1 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings), I (info), L (link order), O (extra OS processing required), G (group), T (TLS), C (compressed), x (unknown), o (OS specific), E (exclude), l (large), p (processor specific) While ELF Tool Chain prints on one line but does not widen the name: $ readelf -S -W output.elf There are 5 section headers, starting at offset 0x78: Section Headers: [Nr] Name Type Addr Off Size ES = Flg Lk Inf Al [ 0] NULL 0000000000000000 000000 000000 00= =20=20=20=20=20 0 0 0 [ 1] .this-is-a-really PROGBITS 0000000000000000 000040 000000 00 = WA=20 0 0 1 [ 2] .shstrtab STRTAB 0000000000000000 000040 000038 00= =20=20=20=20=20 0 0 1 [ 3] .symtab SYMTAB 0000000000000000 0001b8 000078 18= =20=20=20=20=20 4 2 8 [ 4] .strtab STRTAB 0000000000000000 000230 00003a 00= =20=20=20=20=20 0 0 1 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings) I (info), L (link order), G (group), x (unknown) O (extra OS processing required) o (OS specific), p (processor specific) --=20 You are receiving this mail because: You are the assignee for the bug.=