[PATCH v2 0/1] LoongArch: Add support for the third expression of .align for R_LARCH_ALIGN
mengqinggang
mengqinggang@loongson.cn
Fri Dec 22 02:28:25 GMT 2023
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
More information about the Binutils
mailing list