public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "CHIGOT, CLEMENT" <clement.chigot@atos.net>
To: Alan Modra <amodra@gmail.com>
Cc: "binutils@sourceware.org" <binutils@sourceware.org>
Subject: Re: [PATCH] gas: update csect alignment for PPC prefixed instructions on XCOFF
Date: Wed, 23 Jun 2021 06:49:04 +0000	[thread overview]
Message-ID: <PA4PR02MB668699F0F3C890BD7558331FEA089@PA4PR02MB6686.eurprd02.prod.outlook.com> (raw)
In-Reply-To: <YNKKWqchbZ5lM7KO@squeak.grove.modra.org>

[-- Attachment #1: Type: text/plain, Size: 710 bytes --]

>> +++ b/gas/config/tc-ppc.c
>> @@ -4039,6 +4039,10 @@ md_assemble (char *str)
>>         boundaries.  */
>>        frag_align_code (6, 4);
>>        record_alignment (now_seg, 6);
>> +#ifdef OBJ_XCOFF
>> +      /* Update alignment of the containing csect.  */
>> +      symbol_get_tc (ppc_current_csect)->align = 6;
>> +#endif
>
> Is there a possibility that this might decrease alignment?  If so, you
> should write:
> 
>     if (symbol_get_tc (ppc_current_csect)->align < 6)
>        symbol_get_tc (ppc_current_csect)->align = 6;

Any value can be passed for the alignment of csect. Thus, it might be
possible but I doubt it will ever happen. 
Anyway I've updated the patch.

Clément


[-- Attachment #2: 0001-gas-update-csect-alignment-for-PPC-prefixed-instruct.patch --]
[-- Type: application/octet-stream, Size: 1377 bytes --]

From 12a9a4189bf294e88eec689a56334659138a9cec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= <clement.chigot@atos.net>
Date: Tue, 22 Jun 2021 10:15:06 +0200
Subject: [PATCH] gas: update csect alignment for PPC prefixed instructions on
 XCOFF
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Power10 prefixed instructions must not cross 64-byte boundaries.
This is already handled.
However, on XCOFF, the csect must be updated to match the new
alignment.

gas/ChangeLog:
2021-06-22  Clément Chigot  <clement.chigot@atos.net>

	* config/tc-ppc.c (md_assemble): Update ppc_current_csect
	alignment when finding prefixed instructions.
---
 gas/config/tc-ppc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index ad85d3863b0..80818e9c943 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -4039,6 +4039,11 @@ md_assemble (char *str)
 	 boundaries.  */
       frag_align_code (6, 4);
       record_alignment (now_seg, 6);
+#ifdef OBJ_XCOFF
+      /* Update alignment of the containing csect.  */
+      if (symbol_get_tc (ppc_current_csect)->align < 6)
+	symbol_get_tc (ppc_current_csect)->align = 6;
+#endif
 
       /* Update "dot" in any expressions used by this instruction, and
 	 a label attached to the instruction.  By "attached" we mean
-- 
2.25.1


  reply	other threads:[~2021-06-23  6:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 11:19 CHIGOT, CLEMENT
2021-06-23  1:11 ` Alan Modra
2021-06-23  6:49   ` CHIGOT, CLEMENT [this message]
2021-06-24  1:23     ` Alan Modra
2021-06-23 17:00 David Edelsohn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PA4PR02MB668699F0F3C890BD7558331FEA089@PA4PR02MB6686.eurprd02.prod.outlook.com \
    --to=clement.chigot@atos.net \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).