From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id D18B5385781D for ; Fri, 1 Apr 2022 01:34:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D18B5385781D Received: by mail-pg1-x52d.google.com with SMTP id w21so1196001pgm.7 for ; Thu, 31 Mar 2022 18:34:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=de6BdCfpOwWd81OkVwpTNhZSctDJASWyMbGkgITsUqc=; b=yvgM9wuO95NdFdVLhNUBPZm8XgMGq30VRTtI5qc6wXkUgETVGPxtAE2xe6fIaVmjVE vkt3+WisBRFFr4ZfE2mSRfTCf/rQ1yrYImPnPCqJt3Mhm6ePBBrjyapmGMAO6+exy3sn MzGDVhP/wxZ7U6w5uDX1jo+2nwUXWtdGPiJJrydm0Cn0wM/k04927keAh5hMqpVgzBQK jjHAHatxkwQlvS8JEd8kE8J8worGiGjj6d91ncadnRWFHugZsF/zju9HEBJlZ4uTmZdr UX6Gx1qKnzXVDyUI7xeaf2VM7l+MnFFnkcQbV8AdZ8UjtpwDTGh09f4gSgIKt8d/O2kB ftzQ== X-Gm-Message-State: AOAM533pF/oXP6ToF3dBb5kLFNSpe8SoJCy+mUkB7eLfIp6AiUW7JPKf jO+xTXfLvnJUTO7Im14j+1QKG74blTA= X-Google-Smtp-Source: ABdhPJwAvLyuKfSCcTHYikSRtKM0NQLQxI+QKEJ/48C4IOzKigS5U42vv32zAxd4SZw0tO4emPq30Q== X-Received: by 2002:a65:6e0f:0:b0:382:2f78:4369 with SMTP id bd15-20020a656e0f000000b003822f784369mr12902433pgb.406.1648776861855; Thu, 31 Mar 2022 18:34:21 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:b536:b1bf:c0e2:211a]) by smtp.gmail.com with ESMTPSA id bh3-20020a056a02020300b00378b62df320sm559183pgb.73.2022.03.31.18.34.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 18:34:21 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id EDD4D114030D; Fri, 1 Apr 2022 12:04:17 +1030 (ACDT) Date: Fri, 1 Apr 2022 12:04:17 +1030 From: Alan Modra To: Luis Machado Cc: binutils@sourceware.org Subject: Re: Support AArch64 MTE memory tag dumps in core files Message-ID: References: <20220331140457.9237-1-luis.machado@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220331140457.9237-1-luis.machado@arm.com> X-Spam-Status: No, score=-3036.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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2022 01:34:24 -0000 On Thu, Mar 31, 2022 at 03:04:57PM +0100, Luis Machado via Binutils wrote: > diff --git a/bfd/section.c b/bfd/section.c > index 9a1071454f5..e8c7caf9dd4 100644 > --- a/bfd/section.c > +++ b/bfd/section.c > @@ -412,6 +412,9 @@ CODE_FRAGMENT > . {* Nonzero if this section uses RELA relocations, rather than REL. *} > . unsigned int use_rela_p:1; > . > +. {* Nonzero if this section contains memory tag data. Default is 0. *} > +. unsigned int has_memory_tags : 1; > +. > . {* Bits used by various backends. The generic code doesn't touch > . these fields. *} > . > @@ -455,6 +458,11 @@ CODE_FRAGMENT > . {* The compressed size of the section in octets. *} > . bfd_size_type compressed_size; > . > +. {* If HAS_MEMORY_TAGS is true, MEMORY_TAGS_RANGE_SIZE is the original memory > +. range size, in octets, of the memory that contained the tags stored in this > +. section. SIZE is the size of the packed tags from that memory range. *} > +. bfd_size_type memory_tags_range_size; > +. > . {* Relaxation table. *} > . struct relax_table *relax; > . Really, you shouldn't be adding fields used by just one target to struct bfd_section. The linker might be dealing with hundreds of thousands of sections. If every target added fields because it was convenient to do it that way, we'd end up with quite a non-trivial memory cost for all targets. Instead, you should look at adding the new field to _aarch64_elf_section_data. Yes, I know target specific fields have sneaked past review in the past, eg. relax and relax_count are microblaze only. I might even get around to fixing those one day. -- Alan Modra Australia Development Lab, IBM