From patchwork Mon Dec 16 10:57:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 103167 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 670EC3858429 for ; Mon, 16 Dec 2024 10:59:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 670EC3858429 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=P98Nc5v7 X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id 54DCC3858415 for ; Mon, 16 Dec 2024 10:57:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 54DCC3858415 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 54DCC3858415 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734346635; cv=none; b=ZdQwZSXh9w6rQjBYf3t4+3rsVNwZ4LePvSPyvHoHhE6qLF9wpppkrIrPjFtFd+6bwEh+V+yRE/MldSXko/d0AtqNkjHOZXCy4bgQhzNjSC+9CCW8iMliTNEjatJZg36jV8jvrx8exQArt7yOWXLa1nl6gblsUKFh/vGV5pOGukI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734346635; c=relaxed/simple; bh=HxPfeMgip+iwJHO8EPHBLT3mOMdeyKSNhp3k5ODXvbk=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=p9IWD1KNlv+b2Ix15RNTt4AZ8G6hn7ed8YqxPs2mJQbFG/4Emc9ypJE8voq0/sBiJVEanIsEIECGxvmvZD5w92Lb+B72ei0KRSJQbrL7I7WuzlAgLcBrohw5pDdejCU6dFe1RRmkJFH8q+c7kyskvxxp4k0yLiGPueHcAM8wZl4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54DCC3858415 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-2166360285dso32720195ad.1 for ; Mon, 16 Dec 2024 02:57:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734346634; x=1734951434; darn=sourceware.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=qx+VBH/WLj2t0VqndEOV2X7hZ3fdVvxRZUZgoTmw8YQ=; b=P98Nc5v79gEC+qu/ptGURKMIDjK0E1ksg8Dlv6s2N9OW8I5UCggNGCwXfm+XVhKJSq 7tju2gtG6tbzQahgNld2topzqBYo233NnFFsYvVlkaH1K6C/A1FwUjfpdsSvkK7d3bcX HJP65o8OKUpKzR3qPGPJkKOpW89CDokrpCJ/cJF+BHk3/qQmDgCo6ADhIIoTmeBpdn/8 zUkGV2mACoRhuvKwtvZQO4Lhv4yrIj7EFqr1tmss7ut1bfpnkYxa2zlJbQeEtgEtIVya SzKGT0Dn+NR2X2nOMhmVGSXZaJXnm4aNUG3dLq0iuu3IWG39MCDaTz0hfOCYg4JtVLh7 cGQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734346634; x=1734951434; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qx+VBH/WLj2t0VqndEOV2X7hZ3fdVvxRZUZgoTmw8YQ=; b=dNjH4up1BmrLwiVLLsgD6k43Uy9Fu1QYnRQZ3NHNbG2gtO48ECeJ4hdKbr/sHa2mXA Z0SHURA1FG2pOKaf5DjVXZJwnwgl3Pqr7Rtuc21+p8ax8gLu/ObgsYWydr6u4dmbMk+r Z9ZkLOz3x8HSUcQvwZRQCfyNKYGtQj7o0DaOBw4IrdLIQVrWn22IsuxKESlAq8PkrRGS XgU3XZlnnGa3NAgUKPD1zPyjuOjOBYa6JZuR86F+V18UcGrQnSbNjMkeNLvHwsxYqdug TfkiRIjgEDQ7CA51MDBkHiQ8Dz3PyP/22CkZjROcuiHfbFKNMu97Jnk+J1xhmwP8C6+T Vh8A== X-Gm-Message-State: AOJu0Yz3ALUjqHoMNYfXGLccSlDDcTYHpCET9n+UEQy4U8nyKYdWg26p 1Dq16yU+9RfJoEmsFVtn7qE+VEQDxA5XPiyW4NyQHpW3qc9XNpiuJTWgSQ== X-Gm-Gg: ASbGncv22NeLWfOWTivabndfRqE5WXK19stKMNw3ixcILT3X3hUICfs0zlaRR8K93xv E9YMMbWULSZB0gqPLUGyYEge/qKVn3OwgYm5xTKs6NMf+/1ABZjkSNoL2qjYXi7gBMnJnafpFtw WTjrJbrSPjLkPXEu70kzOb8KKqm4bYhQ8MVKBapoSEyL2GQfA6I2Ztx4TUfhyFgaxyNlh3lPI5c qN63Hh/FJfqCBrtevL7TJgTNDWfhGF/Ez94TJwrh+cxZtRYuaNKB7CD1bE8e8xE1HZeYgJ9kItp z6H3heT2n5dX1BGL0Uo6Np8dSZ0= X-Google-Smtp-Source: AGHT+IGaNdqHbs7Ud/7JZwlNva2XZ+wa7ANGeJdOJd3bJFjZUdY2ozNYTXOgpGWo13kJmR2eELHbfw== X-Received: by 2002:a17:902:e541:b0:20d:cb6:11e with SMTP id d9443c01a7336-218929ee8cbmr133904505ad.26.1734346634081; Mon, 16 Dec 2024 02:57:14 -0800 (PST) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e4ff90sm40200655ad.169.2024.12.16.02.57.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 02:57:13 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 932981140C8F; Mon, 16 Dec 2024 21:27:11 +1030 (ACDT) Date: Mon, 16 Dec 2024 21:27:11 +1030 From: Alan Modra To: binutils@sourceware.org Subject: goodbye aout_section_data Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3032.9 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.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 aout_section_data->relocs isn't set by anything, so delete it. diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 5f62ac67cfd..2639655c7f9 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -4723,19 +4723,12 @@ aout_link_input_section (struct aout_final_link_info *flaginfo, (file_ptr) 0, input_size)) return false; - /* Read in the relocs if we haven't already done it. */ - if (aout_section_data (input_section) != NULL - && aout_section_data (input_section)->relocs != NULL) - relocs = aout_section_data (input_section)->relocs; - else + relocs = flaginfo->relocs; + if (rel_size > 0) { - relocs = flaginfo->relocs; - if (rel_size > 0) - { - if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0 - || bfd_read (relocs, rel_size, input_bfd) != rel_size) - return false; - } + if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0 + || bfd_read (relocs, rel_size, input_bfd) != rel_size) + return false; } /* Relocate the section contents. */ diff --git a/bfd/libaout.h b/bfd/libaout.h index 05b5e13bcd8..abdabfa8902 100644 --- a/bfd/libaout.h +++ b/bfd/libaout.h @@ -449,21 +449,6 @@ struct aout_data_struct macro is only ever applied to an asymbol. */ #define aout_symbol(asymbol) ((aout_symbol_type *)(&(asymbol)->the_bfd)) -/* Information we keep for each a.out section. This is currently only - used by the a.out backend linker. */ - -struct aout_section_data_struct -{ - /* The unswapped relocation entries for this section. */ - void * relocs; -}; - -#define aout_section_data(s) \ - ((struct aout_section_data_struct *) (s)->used_by_bfd) - -#define set_aout_section_data(s,v) \ - ((s)->used_by_bfd = (void *)&(v)->relocs) - /* Prototype declarations for functions defined in aoutx.h. */ extern bool NAME (aout, squirt_out_relocs) diff --git a/bfd/pdp11.c b/bfd/pdp11.c index f65760f9ee6..8fa3a545761 100644 --- a/bfd/pdp11.c +++ b/bfd/pdp11.c @@ -3655,19 +3655,12 @@ aout_link_input_section (struct aout_final_link_info *flaginfo, (file_ptr) 0, input_size)) return false; - /* Read in the relocs if we haven't already done it. */ - if (aout_section_data (input_section) != NULL - && aout_section_data (input_section)->relocs != NULL) - relocs = aout_section_data (input_section)->relocs; - else + relocs = flaginfo->relocs; + if (rel_size > 0) { - relocs = flaginfo->relocs; - if (rel_size > 0) - { - if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0 - || bfd_read (relocs, rel_size, input_bfd) != rel_size) - return false; - } + if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0 + || bfd_read (relocs, rel_size, input_bfd) != rel_size) + return false; } /* Relocate the section contents. */