From owner-freebsd-toolchain@freebsd.org Sat Jan 30 19:20:30 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 297B94F6647 for ; Sat, 30 Jan 2021 19:20:30 +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 4DSkZ56Xktz3CNS for ; Sat, 30 Jan 2021 19:20:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id E03DC4F6896; Sat, 30 Jan 2021 19:20:29 +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 DFDAE4F64D6 for ; Sat, 30 Jan 2021 19:20:29 +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 4DSkZ55Fylz3CHX for ; Sat, 30 Jan 2021 19:20:29 +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 A06431B025 for ; Sat, 30 Jan 2021 19:20:29 +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 10UJKT6i042741 for ; Sat, 30 Jan 2021 19:20:29 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 10UJKTbI042740 for toolchain@FreeBSD.org; Sat, 30 Jan 2021 19:20:29 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 216316] objcopy (elfcopy) in 11 appears to have a regression compared to the version in 10 Date: Sat, 30 Jan 2021 19:20:29 +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: 11.0-STABLE X-Bugzilla-Keywords: regression X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: mcb30@ipxe.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: cc 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: Sat, 30 Jan 2021 19:20:30 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D216316 Michael Brown changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mcb30@ipxe.org --- Comment #7 from Michael Brown --- I have updated the iPXE build process to place the (meaningless) load addre= sses for the various NOLOAD sections earlier than the .zinfo section. This chan= ge is in commit https://github.com/ipxe/ipxe/commit/fe52f8e8b and eliminates t= he harmless "moving loadable section" warning. However, there seems to be something else very broken in the elftoolchain implementation of "objcopy -O binary". Extracting a single section using e= .g. objcopy -O binary -j .zinfo bin/ipxe.pxe.tmp bin/ipxe.pxe.zinfo works as expected. Extracting multiple sections using e.g. objcopy -O binary -R .zinfo bin/ipxe.pxe.tmp bin/ipxe.pxe.bin or even just objcopy -O binary bin/ipxe.pxe.tmp wtf produces a binary file with no discernible relation to the input. It looks vaguely as though objcopy is ignoring the load addresses and just placing t= he sections semi-randomly within the output file. For now, I've modified the iPXE build process to check for the elftoolchain version of objcopy and refuse to use it (https://github.com/ipxe/ipxe/commit/1fea8ce06). It would be good to get a proper fix for this, if anyone has time to dig in= to how the elftoolchain objcopy is handling "-O binary". Michael --=20 You are receiving this mail because: You are the assignee for the bug.=