CVS commit: src/external/gpl3/binutils.old/dist/gas/config

2023-11-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Nov 25 12:07:58 UTC 2023

Modified Files:
src/external/gpl3/binutils.old/dist/gas/config: tc-vax.c

Log Message:
binutils.old/gas: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton 
[11/21]

PR toolchain/43314: pc relative relocations are "off by 1*size" on vax

Address http://gnats.netbsd.org/43314

Taken from binutils/gas:
https://mail-index.netbsd.org/source-changes/2023/10/07/msg147942.html


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c
diff -u src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c:1.9 src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c:1.10
--- src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c:1.9	Sat Nov 25 12:06:42 2023
+++ src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c	Sat Nov 25 12:07:58 2023
@@ -3581,12 +3581,39 @@ void
 vax_cons_fix_new (fragS *frag, int where, unsigned int nbytes, expressionS *exp,
 		  bfd_reloc_code_real_type r)
 {
-  if (r == NO_RELOC)
+  int pcrel;
+  // fix PC relative frags too ...
+  switch (r)
+{
+case BFD_RELOC_8_PCREL:
+case BFD_RELOC_16_PCREL:
+case BFD_RELOC_32_PCREL:
+  pcrel = 1;
+  /*
+   * Displacement mode addressing (of which PC relative is one
+   * type) uses the updated contents of the register as the base
+   * address.  VARM, Leonard 1987, pp34
+   */
+  switch (exp->X_op)
+	{
+	case O_constant:
+	case O_symbol:
+	  exp->X_add_number += nbytes;
+	  break;
+	}
+  break;
+case NO_RELOC:
 r = (nbytes == 1 ? BFD_RELOC_8
 	 : nbytes == 2 ? BFD_RELOC_16
 	 : BFD_RELOC_32);
+  pcrel = 0;
+  break;
+default:
+  pcrel = 0;
+  break;
+}
 
-  fix_new_exp (frag, where, (int) nbytes, exp, 0, r);
+  fix_new_exp (frag, where, (int) nbytes, exp, pcrel, r);
 }
 
 const char *



CVS commit: src/external/gpl3/binutils.old/dist/gas/config

2023-11-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Nov 25 12:07:58 UTC 2023

Modified Files:
src/external/gpl3/binutils.old/dist/gas/config: tc-vax.c

Log Message:
binutils.old/gas: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton 
[11/21]

PR toolchain/43314: pc relative relocations are "off by 1*size" on vax

Address http://gnats.netbsd.org/43314

Taken from binutils/gas:
https://mail-index.netbsd.org/source-changes/2023/10/07/msg147942.html


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/binutils.old/dist/gas/config

2023-11-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Nov 25 12:06:43 UTC 2023

Modified Files:
src/external/gpl3/binutils.old/dist/gas/config: tc-vax.c tc-vax.h

Log Message:
binutils.old/gas: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton 
[10/21]

Try not to emit relocations in the .eh_frame section

Taken from binutils/gas:
https://mail-index.netbsd.org/source-changes/2023/10/07/msg147941.html


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/binutils.old/dist/gas/config/tc-vax.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c
diff -u src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c:1.8 src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c:1.9
--- src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c:1.8	Sat Nov 25 12:05:22 2023
+++ src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c	Sat Nov 25 12:06:42 2023
@@ -282,6 +282,29 @@ md_apply_fix (fixS *fixP, valueT *valueP
   if (fixP->fx_subsy != (symbolS *) NULL)
 as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex"));
 
+  if (fixP->fx_pcrel)
+{
+  switch (fixP->fx_r_type)
+	{
+	case BFD_RELOC_32:
+	  /* change the relocation type to 32 bit PC-relative */
+	  fixP->fx_r_type = BFD_RELOC_32_PCREL;
+	  if (fixP->fx_addsy != NULL)
+	{
+	  /* Hack around bfd_install_relocation brain damage.  */
+	  value += fixP->fx_frag->fr_address + fixP->fx_where;
+	}
+	  if (fixP->fx_addsy == abs_section_sym)
+	fixP->fx_done = 1;
+	  break;
+	default:
+	  break;
+	}
+}
+
+  /*
+   * Common code for pc-relative and non-pc-relative cases
+   */
   if (fixP->fx_addsy == NULL)
 fixP->fx_done = 1;
 
@@ -3601,6 +3624,11 @@ tc_vax_regname_to_dw2regnum (char *regna
 void
 vax_cfi_emit_pcrel_expr (expressionS *expP, unsigned int nbytes)
 {
+  expressionS tmp = *expP;
+
+  tmp.X_op = O_subtract;
+  tmp.X_op_symbol = symbol_temp_new_now ();
+  expP = 
   expP->X_add_number += nbytes;
   emit_expr (expP, nbytes);
 }

Index: src/external/gpl3/binutils.old/dist/gas/config/tc-vax.h
diff -u src/external/gpl3/binutils.old/dist/gas/config/tc-vax.h:1.7 src/external/gpl3/binutils.old/dist/gas/config/tc-vax.h:1.8
--- src/external/gpl3/binutils.old/dist/gas/config/tc-vax.h:1.7	Fri Dec 23 17:09:22 2022
+++ src/external/gpl3/binutils.old/dist/gas/config/tc-vax.h	Sat Nov 25 12:06:42 2023
@@ -37,6 +37,8 @@
 
 #ifdef OBJ_ELF
 #define TARGET_FORMAT "elf32-vax"
+#define DIFF_EXPR_OK 1
+#define CFI_DIFF_EXPR_OK 0
 #endif
 
 #define TARGET_ARCH	bfd_arch_vax



CVS commit: src/external/gpl3/binutils.old/dist/gas/config

2023-11-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Nov 25 12:06:43 UTC 2023

Modified Files:
src/external/gpl3/binutils.old/dist/gas/config: tc-vax.c tc-vax.h

Log Message:
binutils.old/gas: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton 
[10/21]

Try not to emit relocations in the .eh_frame section

Taken from binutils/gas:
https://mail-index.netbsd.org/source-changes/2023/10/07/msg147941.html


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/binutils.old/dist/gas/config/tc-vax.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/binutils.old/dist/gas/config

2023-11-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Nov 25 12:05:22 UTC 2023

Modified Files:
src/external/gpl3/binutils.old/dist/gas/config: tc-vax.c

Log Message:
binutils.old/gas: vax: Cherry-pick upstream commits for binutils-gdb:30715

PR port-vax/57646: Import major vax toolchain fix by Kalvis Duckmanton

Taken from binutils/gas:
https://mail-index.netbsd.org/source-changes/2023/10/07/msg147931.html


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/binutils.old/dist/gas/config

2023-11-25 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Nov 25 12:05:22 UTC 2023

Modified Files:
src/external/gpl3/binutils.old/dist/gas/config: tc-vax.c

Log Message:
binutils.old/gas: vax: Cherry-pick upstream commits for binutils-gdb:30715

PR port-vax/57646: Import major vax toolchain fix by Kalvis Duckmanton

Taken from binutils/gas:
https://mail-index.netbsd.org/source-changes/2023/10/07/msg147931.html


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c
diff -u src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c:1.7 src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c:1.8
--- src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c:1.7	Fri Dec 23 17:09:22 2022
+++ src/external/gpl3/binutils.old/dist/gas/config/tc-vax.c	Sat Nov 25 12:05:22 2023
@@ -2332,18 +2332,19 @@ md_create_short_jump (char *ptr,
 
 void
 md_create_long_jump (char *ptr,
-		 addressT from_addr ATTRIBUTE_UNUSED,
+		 addressT from_addr,
 		 addressT to_addr,
-		 fragS *frag,
-		 symbolS *to_symbol)
+		 fragS *frag ATTRIBUTE_UNUSED,
+		 symbolS *to_symbol ATTRIBUTE_UNUSED)
 {
   valueT offset;
 
-  offset = to_addr - S_GET_VALUE (to_symbol);
-  *ptr++ = VAX_JMP;		/* Arbitrary jump.  */
-  *ptr++ = VAX_ABSOLUTE_MODE;
+  /* Account for 1 byte instruction, 1 byte of address specifier and
+ 4 bytes of offset from PC.  */
+  offset = to_addr - (from_addr + 1 + 1 + 4);
+  *ptr++ = VAX_JMP;
+  *ptr++ = VAX_PC_RELATIVE_MODE;
   md_number_to_chars (ptr, offset, 4);
-  fix_new (frag, ptr - frag->fr_literal, 4, to_symbol, (long) 0, 0, NO_RELOC);
 }
 
 #ifdef OBJ_VMS



CVS commit: src/external/gpl3/binutils.old/dist/gas/config

2023-11-17 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Nov 17 23:08:27 UTC 2023

Modified Files:
src/external/gpl3/binutils.old/dist/gas/config: tc-mips.c

Log Message:
binutils.old: apply the same fix for mips gas from binutils.

> binutils: fix gas that doesn't handle MIPS1 FPR load hazard correctly.
> Fixes PR/57680.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/binutils.old/dist/gas/config/tc-mips.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils.old/dist/gas/config/tc-mips.c
diff -u src/external/gpl3/binutils.old/dist/gas/config/tc-mips.c:1.7 src/external/gpl3/binutils.old/dist/gas/config/tc-mips.c:1.8
--- src/external/gpl3/binutils.old/dist/gas/config/tc-mips.c:1.7	Fri Dec 23 17:09:21 2022
+++ src/external/gpl3/binutils.old/dist/gas/config/tc-mips.c	Fri Nov 17 23:08:27 2023
@@ -6529,8 +6529,8 @@ insns_between (const struct mips_cl_insn
   /* Itbl support may require additional care here. FIXME!
 	 Need to modify this to include knowledge about
 	 user specified delays!  */
-  else if ((!cop_interlocks && (pinfo1 & INSN_COPROC_MOVE))
-	   || (!cop_mem_interlocks && (pinfo1 & INSN_COPROC_MEMORY_DELAY)))
+  if ((!cop_interlocks && (pinfo1 & INSN_COPROC_MOVE))
+	 || (!cop_mem_interlocks && (pinfo1 & INSN_COPROC_MEMORY_DELAY)))
 	{
 	  /* Handle cases where INSN1 writes to a known general coprocessor
 	 register.  There must be a one instruction delay before INSN2



CVS commit: src/external/gpl3/binutils.old/dist/gas/config

2023-11-17 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Nov 17 23:08:27 UTC 2023

Modified Files:
src/external/gpl3/binutils.old/dist/gas/config: tc-mips.c

Log Message:
binutils.old: apply the same fix for mips gas from binutils.

> binutils: fix gas that doesn't handle MIPS1 FPR load hazard correctly.
> Fixes PR/57680.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/binutils.old/dist/gas/config/tc-mips.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.