public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: mengqinggang <mengqinggang@loongson.cn>
To: binutils@sourceware.org
Cc: xuchenghua@loongson.cn, chenglulu@loongson.cn,
	liuzhensong@loongson.cn, cailulu@loongson.cn, xry111@xry111.site,
	i.swmail@xen0n.name, maskray@google.com, luweining@loongson.cn,
	wanglei@loongson.cn, hejinyang@loongson.cn,
	mengqinggang <mengqinggang@loongson.cn>
Subject: [PATCH v2 0/1] LoongArch: Add support for the third expression of .align for R_LARCH_ALIGN
Date: Fri, 22 Dec 2023 10:28:25 +0800	[thread overview]
Message-ID: <20231222022826.1318958-1-mengqinggang@loongson.cn> (raw)

If the symbol index is not zero, the addend is used to represent
the first and the third expressions of the .align.

The lowest 8 bits are used to represent the first expression.
Other bits are used to represent the third expression.

The addend of R_LARCH_ALIGN for ".align 5, ,4" is 0x405.
The addend of R_LARCH_ALIGN for ".balign 32, ,4" is 0x405.

Changes from v1:
  Set the address of symbol in R_LARCH_ALIGN to zero.

mengqinggang (1):
  LoongArch: Add support for the third expression of .align for
    R_LARCH_ALIGN

 bfd/elfnn-loongarch.c                         | 71 ++++++++++++-------
 bfd/elfxx-loongarch.c                         | 10 ++-
 gas/config/tc-loongarch.c                     | 20 ++++--
 gas/config/tc-loongarch.h                     |  4 +-
 gas/testsuite/gas/loongarch/relax_align.d     | 46 +++++++-----
 gas/testsuite/gas/loongarch/relax_align.s     |  4 +-
 ld/testsuite/ld-elf/anno-sym.d                |  2 +
 ld/testsuite/ld-loongarch-elf/anno-sym.d      |  7 ++
 ld/testsuite/ld-loongarch-elf/anno-sym.l      |  4 ++
 ld/testsuite/ld-loongarch-elf/anno-sym.s      | 13 ++++
 .../ld-loongarch-elf/ld-loongarch-elf.exp     |  1 +
 ld/testsuite/ld-loongarch-elf/relax-align.dd  |  5 +-
 ld/testsuite/ld-loongarch-elf/relax-align.s   |  5 +-
 ld/testsuite/ld-loongarch-elf/relax.exp       |  2 +-
 14 files changed, 134 insertions(+), 60 deletions(-)
 create mode 100644 ld/testsuite/ld-loongarch-elf/anno-sym.d
 create mode 100644 ld/testsuite/ld-loongarch-elf/anno-sym.l
 create mode 100644 ld/testsuite/ld-loongarch-elf/anno-sym.s

-- 
2.36.0


             reply	other threads:[~2023-12-22  2:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-22  2:28 mengqinggang [this message]
2023-12-22  2:28 ` [PATCH v2 1/1] " mengqinggang

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=20231222022826.1318958-1-mengqinggang@loongson.cn \
    --to=mengqinggang@loongson.cn \
    --cc=binutils@sourceware.org \
    --cc=cailulu@loongson.cn \
    --cc=chenglulu@loongson.cn \
    --cc=hejinyang@loongson.cn \
    --cc=i.swmail@xen0n.name \
    --cc=liuzhensong@loongson.cn \
    --cc=luweining@loongson.cn \
    --cc=maskray@google.com \
    --cc=wanglei@loongson.cn \
    --cc=xry111@xry111.site \
    --cc=xuchenghua@loongson.cn \
    /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).