From patchwork Sun May 24 11:18:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 135519 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4A6AB4B99F50 for ; Sun, 24 May 2026 11:19:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4A6AB4B99F50 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=eu7Jz10B X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by sourceware.org (Postfix) with ESMTPS id 1F31F4BAE7F8 for ; Sun, 24 May 2026 11:18:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1F31F4BAE7F8 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1F31F4BAE7F8 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1035 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779621532; cv=none; b=Yp8D+rsmoRvr6RaryiMoQHnKD0w7R/Wj0uUHag9VhIwmpXIAAb/+utuo9fbxSphOHnAUOwJuY6N2bczjtry79sqr0wVXL5z0DYi/0FEcA6+6nVnyJEXcYSLp+YUvXVhSJAmBJeySCfcd2HmUI/lp9E3bVB45mV6JZff2u8Fe/rk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779621532; c=relaxed/simple; bh=2hag1ThfK79wZyx10yYxU9NyipnHVZ8X3dClqJb3d/o=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=WMRk1nHwcn+J2qsmZhLHZO9UlgohdrpO5F1bcDT5nxN9D72nwNSEGEPGPvtWeNVCDpTmPiqY0YlmS+MOl2BJAGa8lRM9vdNvA7LXJr5IM+CLLNrDlj8tWGkyOPbLjSfbV4Lya/xmUoknSEItC/szun5XXyAphrcZ7buGEQIOeig= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=eu7Jz10B DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F31F4BAE7F8 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-3699cdeec05so3640712a91.3 for ; Sun, 24 May 2026 04:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779621531; x=1780226331; darn=sourceware.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=SrNxJXgdjt2ODC+8bbVbq2J7WwQxQgxizuHZVeolQhk=; b=eu7Jz10BsAoBQsoX1Actzi5CDBXxg7LD7X4sL2ZwPT/ScSFNM224JTkVRwfcqPxKSN +J4wesBS6GTQGYa/uKX0nu/1IQ2ZrDq/b36xBwxdCQtd7qzOMRNrahH/90RBNWS3v9v7 DQcwmeu94SqYqW54g6iwx/PYxUFiouFl/vaQk7jE/mkNhFZfyCOetdCBFGgoD1TAhoj0 RkqvS5m0K1Gg7MFdUNyTvV5WUQQnB03IxEigqKYFoVYYgFRp9ZTbPH/GF3FEbotworGR Bov4VLoc2RSSep4iqpCKYhOAyrfD/VBrq/vSpLK0QiHdVh8MF170ywTjrsxTFtoUT6b/ RBoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779621531; x=1780226331; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SrNxJXgdjt2ODC+8bbVbq2J7WwQxQgxizuHZVeolQhk=; b=YSnwPjihxWJ55W0oR34UJ3IQMkoETIULPnyH9lyG0cfIgNXiJkDqob8LwM++zwVpgS CJ/4Ym4L6IDqtdecZqIK1VcrIlmJWNHBzEexOSw7J9UFPsGdaMFaAuw82D9FA5kNfMFp Upsg8fLweValdjcYN6/DMlRtOaeg+TkjcoepWNsnp4xZI8EF1K28rQD8ctZAQi5X/63b ewO44IEWq5RyeXGq8CW/M3vRmb79dRFZkaTSSs0nkjT2Pu3W0ugFK839l5CHOmY9513W gq0sxXynMl+VTP9qRw6Ly4HQpJbFkjJ6vUsAcCrhVj+Ngq07JIhxfs04CFjndQrlMcQB Nnxg== X-Gm-Message-State: AOJu0YwDth7yB84Wwjm+8d8tJc1dHpwBWhMQnlF5XlmfYjxQR6lz/Jeo iZfsrGKywkFzgh0BGFHNJoDuZLhGnWCRPEHO3leSywyuVCbJtT5mCE8sjF2PhQ== X-Gm-Gg: Acq92OFHY1diipFqvEDyfgbArbFgRr1sC2q9Sk00DXs8TdrvyCSDIyOhvuBYoYWZiWU VDWbvTMCP/f3lUQOHfZY6gHZ4e9vpfv54p+oClGMdJRTOIjKVanl9EugJk+XR9ILTungTz5SIAq 7V4+4riAzIvfWrblGeXLEtcOW3kjQFfRDe+3NkvM9kTalrM6kTuVcmDcD1uoyjfSPJuqK3ZF9in O9cL6pUkYYcdf4OBS2yxD45flEzyhQNguzfOwxn9j8xDSPIXp6AezKGEenALzOxTxWeEF6vTbk6 SekUW4OTp0B8NrlE04yF4T+ekEHYB0j3nwoQldjFCWV+DyiQuM/J2i/TxoeuA6Yj7AFzYlh12jn nM49sKly97R09vLlfDfenMH3F8nwizpxtFwiXxXqbcYoYcxlbmgJqkrhgocR3SlsYZ1dJ61ybME IHZy6Hv/v+kPYwd982Rth1SXmTxUSlzYxEUc1ga/KBnX6Kmzw= X-Received: by 2002:a17:903:24c:b0:2b2:ec46:dfed with SMTP id d9443c01a7336-2beb067a16emr110080895ad.31.1779621530885; Sun, 24 May 2026 04:18:50 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:4c35:2db4:4c3e:6591]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2beb58fa422sm69873115ad.72.2026.05.24.04.18.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2026 04:18:50 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id C9A281141A4A; Sun, 24 May 2026 20:48:47 +0930 (ACST) Date: Sun, 24 May 2026 20:48:47 +0930 From: Alan Modra To: binutils@sourceware.org Subject: mips: section .note.gnu.build-id can't be allocated in segment Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3029.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org After modifying test_build_id_debuglink, mips-linux fails objcopy --only-keep-debug tmpdir/testprog tmpdir/testprog.debug with the above error. This is due to .MIPS.abiflags and .reginfo being made SHT_NOBITS but the .note.gnu.build-id which follows is SHT_PROGBITS. That tickles a bug in file offset tracking. * elf.c (assign_file_positions_for_load_sections): When resetting "off_adjust" for sections with contents following sections without contents, put back "off" too. diff --git a/bfd/elf.c b/bfd/elf.c index dcf8f61e043..1c88c379ea0 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -6335,6 +6335,7 @@ assign_file_positions_for_load_sections (bfd *abfd, { if (this_hdr->sh_type != SHT_NOBITS) { + off -= off_adjust; off_adjust = 0; if (p->p_filesz + adjust < p->p_memsz) {