[PATCH] VAX libstdc++ common runtime - register used but not saved

Kalvis Duckmanton <[email protected]>
Newsgroups gmane.os.netbsd.devel.toolchain
Message-ID <[email protected]>
Hello all,

I believe that I've found a problem in libstdc++ for VAX where, in the
__do_global_ctors_aux function, %r8 is used but not saved.  %r11, which
is saved, is not used.

I'd like to propose the following change against NetBSD 10.99.6 to
correct it.

Many thanks
kalvis


---
  lib/csu/arch/vax/crtbegin.S | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/csu/arch/vax/crtbegin.S b/lib/csu/arch/vax/crtbegin.S
index 208c4658a973..207a9d03ec44 100644
--- a/lib/csu/arch/vax/crtbegin.S
+++ b/lib/csu/arch/vax/crtbegin.S
@@ -132,7 +132,7 @@ END(__do_global_dtors_aux)
  
  	.hidden __do_global_ctors_aux
  
-_ENTRY(__do_global_ctors_aux, 0x0800)
+_ENTRY(__do_global_ctors_aux, 0x0100)	 /* save r8 */
  	tstb	__initialized
  	bneq	4f
  	movb	$1, __initialized
-- 
2.20.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.