From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7867) id D5A813858D20; Tue, 30 May 2023 12:03:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5A813858D20 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: liu & zhensong To: bfd-cvs@sourceware.org Subject: [binutils-gdb] LoongArch: include: Add support for linker relaxation. X-Act-Checkin: binutils-gdb X-Git-Author: mengqinggang X-Git-Refname: refs/heads/master X-Git-Oldrev: 7b9e7db08340cb3934a5fa95503fda523e0917b7 X-Git-Newrev: 57a930e3bfe4b2c7fd6463ed39311e1938513138 Message-Id: <20230530120353.D5A813858D20@sourceware.org> Date: Tue, 30 May 2023 12:03:53 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2023 12:03:53 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D57a930e3bfe4= b2c7fd6463ed39311e1938513138 commit 57a930e3bfe4b2c7fd6463ed39311e1938513138 Author: mengqinggang Date: Thu Dec 1 14:34:10 2022 +0800 LoongArch: include: Add support for linker relaxation. =20 Add relocs and gas LARCH_opts.relax option. =20 include/ChangeLog: =20 * elf/loongarch.h: Add relocs. * opcode/loongarch.h: Add LARCH_opts.relax and macro LARCH_NOP. Diff: --- include/elf/loongarch.h | 20 ++++++++++++++++++++ include/opcode/loongarch.h | 3 +++ 2 files changed, 23 insertions(+) diff --git a/include/elf/loongarch.h b/include/elf/loongarch.h index ba0075d1066..71ab34f2cef 100644 --- a/include/elf/loongarch.h +++ b/include/elf/loongarch.h @@ -229,6 +229,26 @@ RELOC_NUMBER (R_LARCH_32_PCREL, 99) /* RELAX. */ RELOC_NUMBER (R_LARCH_RELAX, 100) =20 +/* relax delete. */ +RELOC_NUMBER (R_LARCH_DELETE, 101) + +/* relax align. */ +RELOC_NUMBER (R_LARCH_ALIGN, 102) + +/* pcaddi. */ +RELOC_NUMBER (R_LARCH_PCREL20_S2, 103) + +/* cfa. */ +RELOC_NUMBER (R_LARCH_CFA, 104) + +/* DW_CFA_advance_loc. */ +RELOC_NUMBER (R_LARCH_ADD6, 105) +RELOC_NUMBER (R_LARCH_SUB6, 106) + +/* unsigned leb128. */ +RELOC_NUMBER (R_LARCH_ADD_ULEB128, 107) +RELOC_NUMBER (R_LARCH_SUB_ULEB128, 108) + END_RELOC_NUMBERS (R_LARCH_count) =20 /* Processor specific flags for the ELF header e_flags field. */ diff --git a/include/opcode/loongarch.h b/include/opcode/loongarch.h index 548732e5c70..004bb6561ef 100644 --- a/include/opcode/loongarch.h +++ b/include/opcode/loongarch.h @@ -28,6 +28,8 @@ extern "C" { #endif =20 + #define LARCH_NOP 0x03400000 + typedef uint32_t insn_t; =20 struct loongarch_opcode @@ -228,6 +230,7 @@ dec2 : [1-9][0-9]? #define ase_gpcr isa.use_la_global_with_pcrel #define ase_gabs isa.use_la_global_with_abs =20 + int relax; } LARCH_opts; =20 extern size_t loongarch_insn_length (insn_t insn);