NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: toolchain/52427 (VAX text relocations)
The following reply was made to PR toolchain/52427; it has been noted by GNATS.
From: Rin Okuyama <rokuyama.rk%gmail.com@localhost>
To: "gnats-bugs%NetBSD.org@localhost" <gnats-bugs%NetBSD.org@localhost>, netbsd-bugs%netbsd.org@localhost
Cc:
Subject: Re: toolchain/52427 (VAX text relocations)
Date: Tue, 1 Aug 2023 09:50:47 +0900
-------- Forwarded Message --------
Subject: [PATCH] 2/2: toolchain/52427: VAX text relocations
Date: Mon, 31 Jul 2023 14:31:00 +1000
From: Kalvis Duckmanton <kalvisd%gmail.com@localhost>
To: tech-toolchain%netbsd.org@localhost
Hi all,
This is the second part of the change to address toolchain/52427
(https://mail-index.netbsd.org/netbsd-bugs/2017/07/25/msg052924.html).
This change to NetBSD 10.99.6 updates the GNU assembler in binutils.old,
altering the behaviour of tc-vax.c:md_create_long_jump() to emit a jump
to an address relative to the PC instead of a jump to an absolute address.
many thanks
kalvis
---
 .../gpl3/binutils.old/dist/gas/config/tc-vax.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/external/gpl3/binutils.old/dist/gas/config/tc-vax.c
b/external/gpl3/binutils.old/dist/gas/config/tc-vax.c
index 6a2ef16b1760..57863a55e882 100644
--- a/external/gpl3/binutils.old/dist/gas/config/tc-vax.c
+++ b/external/gpl3/binutils.old/dist/gas/config/tc-vax.c
@@ -2332,18 +2332,19 @@ md_create_short_jump (char *ptr,
 void
 md_create_long_jump (char *ptr,
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â addressT from_addr ATTRIBUTE_UNUSED,
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â addressT to_addr,
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â fragS *frag,
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â symbolS *to_symbol)
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â addressT from_addr,
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â addressT to_addr,
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 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;Â Â Â Â Â Â Â Â Â Â Â Â /* long jump */
+Â *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);
 }
 ^L
 #ifdef OBJ_VMS
--
2.20.1
Home |
Main Index |
Thread Index |
Old Index