[v1,3/6] LoongArch: opcodes: Add support for linker relaxation.

Message ID 20221205080453.1352069-4-mengqinggang@loongson.cn
State Accepted
Headers
Series LoongArch linker relaxation support. |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

mengqinggang Dec. 5, 2022, 8:04 a.m. UTC
  Set gas default to enable relax.

opcodes/ChangeLog:

	* loongarch-opc.c (struct loongarch_ASEs_option): New member relax and
	  the default value is 1.
---
 opcodes/loongarch-opc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

Andreas Schwab Dec. 5, 2022, 9:43 a.m. UTC | #1
On Dez 05 2022, mengqinggang wrote:

> diff --git a/opcodes/loongarch-opc.c b/opcodes/loongarch-opc.c
> index 1b510048c29..49e9df56f67 100644
> --- a/opcodes/loongarch-opc.c
> +++ b/opcodes/loongarch-opc.c
> @@ -22,7 +22,10 @@
>  #include "opcode/loongarch.h"
>  #include "libiberty.h"
>  
> -struct loongarch_ASEs_option LARCH_opts;
> +struct loongarch_ASEs_option LARCH_opts =
> +{
> +  relax : 1
> +};

This uses the obsolete GCC extension.  Please use the C99 designated
initializer syntax.
  

Patch

diff --git a/opcodes/loongarch-opc.c b/opcodes/loongarch-opc.c
index 1b510048c29..49e9df56f67 100644
--- a/opcodes/loongarch-opc.c
+++ b/opcodes/loongarch-opc.c
@@ -22,7 +22,10 @@ 
 #include "opcode/loongarch.h"
 #include "libiberty.h"
 
-struct loongarch_ASEs_option LARCH_opts;
+struct loongarch_ASEs_option LARCH_opts =
+{
+  relax : 1
+};
 
 size_t
 loongarch_insn_length (insn_t insn ATTRIBUTE_UNUSED)