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

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

Checks

Context Check Description
snail/binutils-gdb-check warning Git am fail log

Commit Message

mengqinggang May 22, 2023, 1:34 a.m. UTC
  Set gas default to enable relax.

opcodes/ChangeLog:

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

Comments

Xi Ruoyao May 22, 2023, 5:43 a.m. UTC | #1
On Mon, 2023-05-22 at 09:34 +0800, mengqinggang wrote:
> Set gas default to enable relax.
> 
> opcodes/ChangeLog:
> 
>         * loongarch-opc.c (struct loongarch_ASEs_option): New member
> relax
>         with the default value 1.
> ---
>  opcodes/loongarch-opc.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/opcodes/loongarch-opc.c b/opcodes/loongarch-opc.c
> index 39d724a3398..573b691c1fd 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 =
> +{

If I remember correctly there shouldn't be a newline for this '{'.  i.e.
"LARCH_opts = {".

> +  .relax = 1
> +};
>
>  size_t
>  loongarch_insn_length (insn_t insn ATTRIBUTE_UNUSED)
  

Patch

diff --git a/opcodes/loongarch-opc.c b/opcodes/loongarch-opc.c
index 39d724a3398..573b691c1fd 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)