From patchwork Sun Apr 16 19:47:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 83922 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1715741vqo; Sun, 16 Apr 2023 12:47:23 -0700 (PDT) X-Google-Smtp-Source: AKy350bbpQK2RDKNiboxqj9enJhKT3+ff3JvDxBWLYT9dH+G/LoW/CowESx8O9cUAsP4lDULf33v X-Received: by 2002:a05:6402:1609:b0:4f9:e6f1:5c7c with SMTP id f9-20020a056402160900b004f9e6f15c7cmr12990457edv.32.1681674443226; Sun, 16 Apr 2023 12:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681674443; cv=none; d=google.com; s=arc-20160816; b=cDOSvkW7YiqXoh1icKtfYR1gyneAPgQNvW5WQapn78ijwrouTn/BuVIwqv9/up/xZ6 Tr+ZhmHq4of4299qy54Di36ex04hb0pcDbKYYqJblF7cgzNs8KjBOqrZyE1sBubu+Jl9 CcW+NcFE2Scoxq/BCUcLjGu9quVzh1vANxES5ntYZnNKn0C2J67qkhii0+Zm3nyghDp+ gwEeJAk9PGq07tFEJ0H9AWHqAQPdOj+m+TFNx8wrNE6pnvBu3LI55zKWdAzzFcoPp4mB JJm1BJ0Z8j6bSkqmKiSR9pT1XUWG0gL8nat2PC1g+easOQlA+7bc6PC4nStlFtVeU8sB WQig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :content-language:user-agent:mime-version:date:message-id :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=zX3UJ8pyukoFo2XIxDbMXnLayVwflWntkQXo/vz6YOA=; b=NMNZl5ljVr9M/qFeki1i059Iu6IvcWwgC9EONVDWgSt7QeyQP5bd6yD6D3SuYGgsUz 65yM5xYSQWMbJtyBFMAieEI2Igg0uO3+XJm5nlLxGZDKGj3rCvBR99oipGj3X+x8aiPW i6/mXiF4OQUHYz/E1297LfMyVcvaG+ifh3r5WdUNStZUJGwpmx/xYKcGbfyfXOY8RAss 5Cw1YwlEmGFrVxfPjH2uPjj8x6QNXGceKs0hNJoOWGmHo/3OPVjVdiXP8DaIseYftYH1 6kFR9tmOeQS7vgRymm00uI5AFzgOWdZ+bLRrQiUUK7NVIZ3VHUTG5ygKyJFP7xzIM6XQ d4Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="q/Nq3Uoa"; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id c12-20020a056402120c00b00501c984361fsi8373683edw.427.2023.04.16.12.47.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Apr 2023 12:47:23 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="q/Nq3Uoa"; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2C0253857707 for ; Sun, 16 Apr 2023 19:47:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C0253857707 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681674442; bh=zX3UJ8pyukoFo2XIxDbMXnLayVwflWntkQXo/vz6YOA=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=q/Nq3UoaIoQicJnuOK/Eyz26D7LCBZwUJ225CEbbEIT9nkA7beh+lfz0C1jowcYDp 7y1EjaWpqzb7Ionmfke+hxF4m6ozqxPrEKrNFYklodI9681rfnVLmk/xrvBys7TiTp rHQSNFJHDw5BTGWq91xdXJrPS0ueg/vdqR4F/QWs= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from cc-smtpout1.netcologne.de (cc-smtpout1.netcologne.de [IPv6:2001:4dd0:100:1062:25:2:0:1]) by sourceware.org (Postfix) with ESMTPS id 025D63858D1E for ; Sun, 16 Apr 2023 19:47:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 025D63858D1E Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id 093B61257A for ; Sun, 16 Apr 2023 21:47:12 +0200 (CEST) Received: from [IPV6:2a0a:a540:d5b:0:7285:c2ff:fe6c:992d] (2a0a-a540-d5b-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de [IPv6:2a0a:a540:d5b:0:7285:c2ff:fe6c:992d]) (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) (No client certificate requested) by cc-smtpin1.netcologne.de (Postfix) with ESMTPSA id CBED011D77 for ; Sun, 16 Apr 2023 21:47:11 +0200 (CEST) Message-ID: Date: Sun, 16 Apr 2023 21:47:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Content-Language: en-US To: binutils@sourceware.org Subject: [patch, gas documentation] Describe handling of opcodes for relaxation a bit better X-NetCologne-Spam: L X-Rspamd-Action: no action X-Rspamd-Queue-Id: CBED011D77 X-Spamd-Bar: / X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Thomas Koenig via Binutils From: Thomas Koenig Reply-To: Thomas Koenig Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763363460514235003?= X-GMAIL-MSGID: =?utf-8?q?1763363460514235003?= Hi, here's a patch for the documentation that I wish had been in there before I started looking at this :-) I've also left in the original advice, although that is much more complex than what I found in the ports mentioned in the patch. I've tested this patch with "texi2pdf internals.texi" and "makeinfo internals.texi" (not sure how to convince the build script to generate the file). OK? And if this (or a modified version) is OK, could somebody commit this for me? Best regards Thomas diff --git a/gas/doc/internals.texi b/gas/doc/internals.texi index cb568d6edfd..aecf3a08718 100644 --- a/gas/doc/internals.texi +++ b/gas/doc/internals.texi @@ -1824,9 +1824,11 @@ opcode field from the relaxable frag. It is not guaranteed to be the same frag. If you need to emit fixups for the opcode field from inspection of the relaxable frag, then you need to generate a common frag for both the basic opcode and relaxable fields, or you need to provide the frag for the opcode to -pass to @code{fix_new}. The latter can be done for example by defining -@code{TC_FRAG_TYPE} to include a pointer to it and defining @code{TC_FRAG_INIT} -to set the pointer. +pass to @code{fix_new}. The latter can be done by passing a pointer to the +opcode in the call to @code{frag_var} or @code{frag_variant}, and accessing +it via @code{fr_opcode}. See the @file{tc-vax.c} and @file{tc-m68k.c} for +examples. It is also possible for @code{TC_FRAG_TYPE} to include a pointer to +the opcode and defining @code{TC_FRAG_INIT} to set the pointer. Sometimes @code{fr_var} is increased instead, and @code{frag_wane} is not called. I'm not sure, but I think this is to keep @code{fr_fix} referring to