CVS commit: [netbsd-9] src

2023-08-11 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Aug 11 12:13:10 UTC 2023

Modified Files:
src/distrib/sets/lists/debug [netbsd-9]: mi
src/distrib/sets/lists/tests [netbsd-9]: mi
src/libexec/ld.elf_so [netbsd-9]: Makefile symbol.c
src/tests/libexec/ld.elf_so [netbsd-9]: Makefile
Added Files:
src/libexec/ld.elf_so [netbsd-9]: hash.c hash.h
src/tests/libexec/ld.elf_so [netbsd-9]: t_hash.c

Log Message:
Pull up the following revisions(s) (requested by riastradh in ticket #1712):
distrib/sets/lists/debug/mi:revision 1.409 via patch
distrib/sets/lists/tests/mi:revision 1.1280 via patch
libexec/ld.elf_so/Makefile: revision 1.145-1.147 via patch
libexec/ld.elf_so/hash.c:   revision 1.1 via patch
libexec/ld.elf_so/hash.h:   revision 1.1 via patch
libexec/ld.elf_so/symbol.c: revision 1.74-1.76 via patch
tests/libexec/ld.elf_so/Makefile:   revision 1.21 via patch
tests/libexec/ld.elf_so/t_hash.c:   revision 1.1 via patch

ld.elf_so: Fix sysv elf hash on edge cases like `ZW9p' on LP64
platforms where long is 64-bit.


To generate a diff of this commit:
cvs rdiff -u -r1.285.2.1 -r1.285.2.2 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.818.2.2 -r1.818.2.3 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.141.2.1 -r1.141.2.2 src/libexec/ld.elf_so/Makefile
cvs rdiff -u -r0 -r1.1.6.2 src/libexec/ld.elf_so/hash.c \
src/libexec/ld.elf_so/hash.h
cvs rdiff -u -r1.69 -r1.69.6.1 src/libexec/ld.elf_so/symbol.c
cvs rdiff -u -r1.10.2.1 -r1.10.2.2 src/tests/libexec/ld.elf_so/Makefile
cvs rdiff -u -r0 -r1.1.6.2 src/tests/libexec/ld.elf_so/t_hash.c

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



CVS commit: [netbsd-9] src

2023-08-11 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Aug 11 12:13:10 UTC 2023

Modified Files:
src/distrib/sets/lists/debug [netbsd-9]: mi
src/distrib/sets/lists/tests [netbsd-9]: mi
src/libexec/ld.elf_so [netbsd-9]: Makefile symbol.c
src/tests/libexec/ld.elf_so [netbsd-9]: Makefile
Added Files:
src/libexec/ld.elf_so [netbsd-9]: hash.c hash.h
src/tests/libexec/ld.elf_so [netbsd-9]: t_hash.c

Log Message:
Pull up the following revisions(s) (requested by riastradh in ticket #1712):
distrib/sets/lists/debug/mi:revision 1.409 via patch
distrib/sets/lists/tests/mi:revision 1.1280 via patch
libexec/ld.elf_so/Makefile: revision 1.145-1.147 via patch
libexec/ld.elf_so/hash.c:   revision 1.1 via patch
libexec/ld.elf_so/hash.h:   revision 1.1 via patch
libexec/ld.elf_so/symbol.c: revision 1.74-1.76 via patch
tests/libexec/ld.elf_so/Makefile:   revision 1.21 via patch
tests/libexec/ld.elf_so/t_hash.c:   revision 1.1 via patch

ld.elf_so: Fix sysv elf hash on edge cases like `ZW9p' on LP64
platforms where long is 64-bit.


To generate a diff of this commit:
cvs rdiff -u -r1.285.2.1 -r1.285.2.2 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.818.2.2 -r1.818.2.3 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.141.2.1 -r1.141.2.2 src/libexec/ld.elf_so/Makefile
cvs rdiff -u -r0 -r1.1.6.2 src/libexec/ld.elf_so/hash.c \
src/libexec/ld.elf_so/hash.h
cvs rdiff -u -r1.69 -r1.69.6.1 src/libexec/ld.elf_so/symbol.c
cvs rdiff -u -r1.10.2.1 -r1.10.2.2 src/tests/libexec/ld.elf_so/Makefile
cvs rdiff -u -r0 -r1.1.6.2 src/tests/libexec/ld.elf_so/t_hash.c

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

Modified files:

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.285.2.1 src/distrib/sets/lists/debug/mi:1.285.2.2
--- src/distrib/sets/lists/debug/mi:1.285.2.1	Fri Aug  4 12:55:45 2023
+++ src/distrib/sets/lists/debug/mi	Fri Aug 11 12:13:09 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.285.2.1 2023/08/04 12:55:45 martin Exp $
+# $NetBSD: mi,v 1.285.2.2 2023/08/11 12:13:09 sborrill Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -2314,6 +2314,7 @@
 ./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_dlerror-false.debug	tests-libexec-debug	debug,atf,pic,compattestfile
 ./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_dlinfo.debug		tests-libexec-debug	debug,atf,pic,compattestfile
 ./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_dlvsym.debug		tests-libexec-debug	debug,atf,pic,compattestfile
+./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_hash.debug		tests-libexec-debug	debug,atf,pic,compattestfile
 ./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_ifunc.debug	tests-libexec-debug	debug,atf,pic,compattestfile
 ./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_tls_extern.debug	tests-libexec-debug	debug,atf,pic,compattestfile
 ./usr/libdata/debug/usr/tests/net/bpf/t_bpf.debug		tests-net-debug		debug,atf,rump

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.818.2.2 src/distrib/sets/lists/tests/mi:1.818.2.3
--- src/distrib/sets/lists/tests/mi:1.818.2.2	Fri Aug  4 12:55:44 2023
+++ src/distrib/sets/lists/tests/mi	Fri Aug 11 12:13:09 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.818.2.2 2023/08/04 12:55:44 martin Exp $
+# $NetBSD: mi,v 1.818.2.3 2023/08/11 12:13:09 sborrill Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3419,6 +3419,7 @@
 ./usr/tests/libexec/ld.elf_so/t_dlerror-false	tests-libexec-tests	compattestfile,atf,pic
 ./usr/tests/libexec/ld.elf_so/t_dlinfo		tests-libexec-tests	compattestfile,atf,pic
 ./usr/tests/libexec/ld.elf_so/t_dlvsym		tests-libexec-tests	compattestfile,atf,pic
+./usr/tests/libexec/ld.elf_so/t_hash			tests-libexec-tests	compattestfile,atf,pic
 ./usr/tests/libexec/ld.elf_so/t_ifunc		tests-libexec-tests	compattestfile,atf,pic
 ./usr/tests/libexec/ld.elf_so/t_thread_local_dtor	tests-libexec-tests	compattestfile,atf,pic
 ./usr/tests/libexec/ld.elf_so/t_tls_extern		tests-libexec-tests	compattestfile,atf,pic

Index: src/libexec/ld.elf_so/Makefile
diff -u src/libexec/ld.elf_so/Makefile:1.141.2.1 src/libexec/ld.elf_so/Makefile:1.141.2.2
--- src/libexec/ld.elf_so/Makefile:1.141.2.1	Tue Nov 26 08:12:26 2019
+++ src/libexec/ld.elf_so/Makefile	Fri Aug 11 12:13:10 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.141.2.1 2019/11/26 08:12:26 martin Exp $
+#	$NetBSD: Makefile,v 1.141.2.2 2023/08/11 12:13:10 sborrill Exp $
 #
 # NOTE: when changing ld.so, ensure that ldd still compiles.
 #
@@ -70,9 +70,23 @@ PROG=		ld.elf_so
 
 CLIBOBJ!=	cd ${NETBSDSRCDIR}/lib/libc && ${PRINTOBJDIR}
 
-SRCS+=		rtld.c reloc.c symbol.c xmalloc.c xprintf.c debug.c \
-		map_object.c load.c search.c 

CVS commit: src/lib/libc/string

2023-08-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 11 11:51:54 UTC 2023

Modified Files:
src/lib/libc/string: strncpy.3

Log Message:
strncpy(3): Qualify example of strlcpy(3) with a major caveat.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/string/strncpy.3

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



CVS commit: src/lib/libc/string

2023-08-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 11 11:51:54 UTC 2023

Modified Files:
src/lib/libc/string: strncpy.3

Log Message:
strncpy(3): Qualify example of strlcpy(3) with a major caveat.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/string/strncpy.3

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

Modified files:

Index: src/lib/libc/string/strncpy.3
diff -u src/lib/libc/string/strncpy.3:1.1 src/lib/libc/string/strncpy.3:1.2
--- src/lib/libc/string/strncpy.3:1.1	Fri Aug 11 09:39:39 2023
+++ src/lib/libc/string/strncpy.3	Fri Aug 11 11:51:54 2023
@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" from: @(#)strcpy.3	8.1 (Berkeley) 6/4/93
-.\"	$NetBSD: strncpy.3,v 1.1 2023/08/11 09:39:39 riastradh Exp $
+.\"	$NetBSD: strncpy.3,v 1.2 2023/08/11 11:51:54 riastradh Exp $
 .\"
 .Dd August 11, 2023
 .Dt STRNCPY 3
@@ -158,9 +158,12 @@ char buf[1024];
 buf[sizeof(buf) - 1] = '\e0';
 .Ed
 .Pp
-This could be better and more simply achieved using
-.Xr strlcpy 3 ,
-as shown in the following example:
+If
+.Va buf
+need only be be NUL-terminated, not fully initialized with NUL padding,
+this could be achieved using
+.Xr strlcpy 3
+as follows:
 .Bd -literal -offset indent
 (void)strlcpy(buf, input, sizeof(buf));
 .Ed
@@ -169,6 +172,22 @@ Note that because
 .Xr strlcpy 3
 is not defined in any standards, it should
 only be used when portability is not a concern.
+.Pp
+.Sy WARNING :
+Because
+.Xr strlcpy 3
+does not fully initialize
+.Fa dst ,
+it is
+.Em not
+a safe NUL-terminating replacement for
+.Fn strncpy
+if the buffer is not separately zero-initialized.
+Naively replacing
+.Fn strncpy
+by
+.Xr strlcpy 3
+can lead to disclosure of secrets from uninitialized memory.
 .Sh SEE ALSO
 .Xr bcopy 3 ,
 .Xr memccpy 3 ,



CVS commit: src/external/gpl3/gdb/lib

2023-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 11 11:28:05 UTC 2023

Modified Files:
src/external/gpl3/gdb/lib/libbfd/arch/m68k: bfd-in3.h bfd.h bfdver.h
config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libbfd/arch/powerpc64: bfd-in3.h bfd.h
bfdver.h config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libctf/arch/m68k: defs.mk
src/external/gpl3/gdb/lib/libctf/arch/powerpc64: defs.mk
src/external/gpl3/gdb/lib/libdecnumber/arch/m68k: gstdint.h
src/external/gpl3/gdb/lib/libdecnumber/arch/powerpc64: gstdint.h
src/external/gpl3/gdb/lib/libgdb/arch/m68k: config.h defs.mk init.c
jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdb/arch/powerpc64: config.h defs.mk
init.c jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdbsupport/arch/m68k: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/m68k/gdbsupport: config.h
src/external/gpl3/gdb/lib/libgdbsupport/arch/powerpc64: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/powerpc64/gdbsupport:
config.h
src/external/gpl3/gdb/lib/libgnulib/arch/m68k: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/m68k/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/m68k/gnulib/import: alloca.h
ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h limits.h
locale.h math.h signal.h stdint.h stdio.h stdlib.h string.h time.h
unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libgnulib/arch/powerpc64: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/powerpc64/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/powerpc64/gnulib/import:
alloca.h ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h
limits.h locale.h math.h signal.h stdint.h stdio.h stdlib.h
string.h time.h unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libiberty/arch/m68k: defs.mk
src/external/gpl3/gdb/lib/libiberty/arch/powerpc64: defs.mk
src/external/gpl3/gdb/lib/libopcodes/arch/m68k: config.h
src/external/gpl3/gdb/lib/libopcodes/arch/powerpc64: config.h
src/external/gpl3/gdb/lib/libreadline/arch/m68k: defs.mk
src/external/gpl3/gdb/lib/libreadline/arch/powerpc64: defs.mk
src/external/gpl3/gdb/lib/libsim/arch/powerpc64: build-config.h
config.h
Added Files:
src/external/gpl3/gdb/lib/libbacktrace/arch/m68k: backtrace-supported.h
config.h defs.mk
src/external/gpl3/gdb/lib/libbacktrace/arch/powerpc64:
backtrace-supported.h config.h defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/m68k/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/m68k/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/powerpc64/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/powerpc64/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libsframe/arch/m68k: defs.mk
src/external/gpl3/gdb/lib/libsframe/arch/powerpc64: defs.mk

Log Message:
regen m68k ppc64


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/m68k/backtrace-supported.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/m68k/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/m68k/defs.mk
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/powerpc64/backtrace-supported.h 
\
src/external/gpl3/gdb/lib/libbacktrace/arch/powerpc64/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/powerpc64/defs.mk
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libbfd/arch/m68k/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/m68k/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/m68k/bfdver.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libbfd/arch/m68k/config.h
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/lib/libbfd/arch/m68k/defs.mk
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gdb/lib/libbfd/arch/m68k/targmatch.h
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libbfd/arch/powerpc64/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/powerpc64/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/powerpc64/bfdver.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libbfd/arch/powerpc64/config.h
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gdb/lib/libbfd/arch/powerpc64/defs.mk
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gdb/lib/libbfd/arch/powerpc64/targmatch.h
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/lib/libctf/arch/m68k/defs.mk
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libctf/arch/powerpc64/defs.mk
cvs rdiff -u -r1.9 -r1.10 \

CVS commit: src/external/gpl3/gdb/lib

2023-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 11 11:28:05 UTC 2023

Modified Files:
src/external/gpl3/gdb/lib/libbfd/arch/m68k: bfd-in3.h bfd.h bfdver.h
config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libbfd/arch/powerpc64: bfd-in3.h bfd.h
bfdver.h config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libctf/arch/m68k: defs.mk
src/external/gpl3/gdb/lib/libctf/arch/powerpc64: defs.mk
src/external/gpl3/gdb/lib/libdecnumber/arch/m68k: gstdint.h
src/external/gpl3/gdb/lib/libdecnumber/arch/powerpc64: gstdint.h
src/external/gpl3/gdb/lib/libgdb/arch/m68k: config.h defs.mk init.c
jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdb/arch/powerpc64: config.h defs.mk
init.c jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdbsupport/arch/m68k: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/m68k/gdbsupport: config.h
src/external/gpl3/gdb/lib/libgdbsupport/arch/powerpc64: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/powerpc64/gdbsupport:
config.h
src/external/gpl3/gdb/lib/libgnulib/arch/m68k: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/m68k/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/m68k/gnulib/import: alloca.h
ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h limits.h
locale.h math.h signal.h stdint.h stdio.h stdlib.h string.h time.h
unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libgnulib/arch/powerpc64: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/powerpc64/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/powerpc64/gnulib/import:
alloca.h ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h
limits.h locale.h math.h signal.h stdint.h stdio.h stdlib.h
string.h time.h unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libiberty/arch/m68k: defs.mk
src/external/gpl3/gdb/lib/libiberty/arch/powerpc64: defs.mk
src/external/gpl3/gdb/lib/libopcodes/arch/m68k: config.h
src/external/gpl3/gdb/lib/libopcodes/arch/powerpc64: config.h
src/external/gpl3/gdb/lib/libreadline/arch/m68k: defs.mk
src/external/gpl3/gdb/lib/libreadline/arch/powerpc64: defs.mk
src/external/gpl3/gdb/lib/libsim/arch/powerpc64: build-config.h
config.h
Added Files:
src/external/gpl3/gdb/lib/libbacktrace/arch/m68k: backtrace-supported.h
config.h defs.mk
src/external/gpl3/gdb/lib/libbacktrace/arch/powerpc64:
backtrace-supported.h config.h defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/m68k/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/m68k/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/powerpc64/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/powerpc64/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libsframe/arch/m68k: defs.mk
src/external/gpl3/gdb/lib/libsframe/arch/powerpc64: defs.mk

Log Message:
regen m68k ppc64


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/m68k/backtrace-supported.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/m68k/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/m68k/defs.mk
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/powerpc64/backtrace-supported.h 
\
src/external/gpl3/gdb/lib/libbacktrace/arch/powerpc64/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/powerpc64/defs.mk
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libbfd/arch/m68k/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/m68k/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/m68k/bfdver.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libbfd/arch/m68k/config.h
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/lib/libbfd/arch/m68k/defs.mk
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gdb/lib/libbfd/arch/m68k/targmatch.h
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libbfd/arch/powerpc64/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/powerpc64/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/powerpc64/bfdver.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libbfd/arch/powerpc64/config.h
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gdb/lib/libbfd/arch/powerpc64/defs.mk
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gdb/lib/libbfd/arch/powerpc64/targmatch.h
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/lib/libctf/arch/m68k/defs.mk
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libctf/arch/powerpc64/defs.mk
cvs rdiff -u -r1.9 -r1.10 \

CVS commit: [netbsd-10] src/sys

2023-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 11 10:13:51 UTC 2023

Modified Files:
src/sys/arch/arm/marvell [netbsd-10]: mvsoc_intr.h
src/sys/dev/marvell [netbsd-10]: marvellvar.h

Log Message:
Additionall pull up following revision(s) (requested by riastradh in ticket 
#316):

sys/dev/marvell/marvellvar.h: revision 1.7
sys/arch/arm/marvell/mvsoc_intr.h: revision 1.9

marvell: Reconcile arm vs powerpc marvell_intr_establish.

If there's a better way to do this without #ifdef __powerpc__, please
have at it!


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.4.1 src/sys/arch/arm/marvell/mvsoc_intr.h
cvs rdiff -u -r1.6 -r1.6.48.1 src/sys/dev/marvell/marvellvar.h

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

Modified files:

Index: src/sys/arch/arm/marvell/mvsoc_intr.h
diff -u src/sys/arch/arm/marvell/mvsoc_intr.h:1.8 src/sys/arch/arm/marvell/mvsoc_intr.h:1.8.4.1
--- src/sys/arch/arm/marvell/mvsoc_intr.h:1.8	Sat Jun 25 13:24:35 2022
+++ src/sys/arch/arm/marvell/mvsoc_intr.h	Fri Aug 11 10:13:50 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsoc_intr.h,v 1.8 2022/06/25 13:24:35 jmcneill Exp $	*/
+/*	$NetBSD: mvsoc_intr.h,v 1.8.4.1 2023/08/11 10:13:50 martin Exp $	*/
 /*
  * Copyright (c) 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -47,6 +47,17 @@ void mvsoc_irq_handler(void *);
 
 #include 
 
+/*
+ * Note: arm and powerpc Marvell platforms have a conflicting idea of
+ * marvell_intr_establish.
+ *
+ * On arm-based Marvell platforms, there is a static inline
+ * marvell_intr_establish defined in mvsoc_intr.h.
+ *
+ * On powerpc-based Marvell platforms, there is an out-of-line
+ * marvell_intr_establish defined in a SoC-specific gt_mainbus.c
+ * (evbppc/ev64260, ofppc) and declared in dev/marvell/marvellvar.h.
+ */
 static __inline void *
 marvell_intr_establish(int irq, int ipl, int (*func)(void *), void *arg)
 {

Index: src/sys/dev/marvell/marvellvar.h
diff -u src/sys/dev/marvell/marvellvar.h:1.6 src/sys/dev/marvell/marvellvar.h:1.6.48.1
--- src/sys/dev/marvell/marvellvar.h:1.6	Sat Jan  7 14:26:37 2017
+++ src/sys/dev/marvell/marvellvar.h	Fri Aug 11 10:13:50 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: marvellvar.h,v 1.6 2017/01/07 14:26:37 kiyohara Exp $	*/
+/*	$NetBSD: marvellvar.h,v 1.6.48.1 2023/08/11 10:13:50 martin Exp $	*/
 /*
  * Copyright (c) 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -71,8 +71,21 @@ struct marvell_attach_args {
 #define MVA_OFFSET_DEFAULT	GTCF_OFFSET_DEFAULT
 #define MVA_IRQ_DEFAULT		GTCF_IRQ_DEFAULT
 
-
+#ifdef __powerpc__
+/*
+ * Note: arm and powerpc Marvell platforms have a conflicting idea of
+ * marvell_intr_establish.
+ *
+ * On arm-based Marvell platforms, there is a static inline
+ * marvell_intr_establish defined in mvsoc_intr.h.
+ *
+ * On powerpc-based Marvell platforms, there is an out-of-line
+ * marvell_intr_establish defined in a SoC-specific gt_mainbus.c
+ * (evbppc/ev64260, ofppc) and declared in dev/marvell/marvellvar.h.
+ */
 void *marvell_intr_establish(int, int, int (*)(void *), void *);
+#endif
+
 int marvell_winparams_by_tag(device_t, int, int *, int *, uint64_t *,
 			 uint32_t *);
 



CVS commit: [netbsd-10] src/sys

2023-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 11 10:13:51 UTC 2023

Modified Files:
src/sys/arch/arm/marvell [netbsd-10]: mvsoc_intr.h
src/sys/dev/marvell [netbsd-10]: marvellvar.h

Log Message:
Additionall pull up following revision(s) (requested by riastradh in ticket 
#316):

sys/dev/marvell/marvellvar.h: revision 1.7
sys/arch/arm/marvell/mvsoc_intr.h: revision 1.9

marvell: Reconcile arm vs powerpc marvell_intr_establish.

If there's a better way to do this without #ifdef __powerpc__, please
have at it!


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.4.1 src/sys/arch/arm/marvell/mvsoc_intr.h
cvs rdiff -u -r1.6 -r1.6.48.1 src/sys/dev/marvell/marvellvar.h

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



CVS commit: src/lib/libc/string

2023-08-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 11 09:39:39 UTC 2023

Modified Files:
src/lib/libc/string: Makefile.inc strcpy.3
Added Files:
src/lib/libc/string: strncpy.3

Log Message:
strncpy(3), stpncpy(3): Split man page out of strcpy(3), stpcpy(3).

These are for substantively different purposes (fixed-width fields
with optional NUL padding vs NUL-terminated strings), so they don't
belong together.

Be more specific about the security issues.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/lib/libc/string/Makefile.inc
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/string/strcpy.3
cvs rdiff -u -r0 -r1.1 src/lib/libc/string/strncpy.3

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

Modified files:

Index: src/lib/libc/string/Makefile.inc
diff -u src/lib/libc/string/Makefile.inc:1.87 src/lib/libc/string/Makefile.inc:1.88
--- src/lib/libc/string/Makefile.inc:1.87	Tue Aug  1 17:51:25 2023
+++ src/lib/libc/string/Makefile.inc	Fri Aug 11 09:39:39 2023
@@ -1,5 +1,5 @@
 #	from: @(#)Makefile.inc	8.1 (Berkeley) 6/4/93
-#	$NetBSD: Makefile.inc,v 1.87 2023/08/01 17:51:25 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.88 2023/08/11 09:39:39 riastradh Exp $
 
 # string sources
 .PATH: ${ARCHDIR}/string ${.CURDIR}/string
@@ -60,9 +60,10 @@ MLINKS+=popcount.3 popcount64.3
 MLINKS+=strcasecmp.3 strncasecmp.3
 MLINKS+=strcat.3 strncat.3
 MLINKS+=strcmp.3 strncmp.3
-MLINKS+=strcpy.3 strncpy.3 strcpy.3 stpcpy.3 strcpy.3 stpncpy.3
+MLINKS+=strcpy.3 stpcpy.3
 MLINKS+=strlcpy.3 strlcat.3
 MLINKS+=strlen.3 strnlen.3
+MLINKS+=strncpy.3 stpncpy.3
 MLINKS+=strstr.3 strcasestr.3
 MLINKS+=strstr.3 strnstr.3
 MLINKS+=strchr.3 strchrnul.3

Index: src/lib/libc/string/strcpy.3
diff -u src/lib/libc/string/strcpy.3:1.23 src/lib/libc/string/strcpy.3:1.24
--- src/lib/libc/string/strcpy.3:1.23	Wed Apr  1 20:18:17 2015
+++ src/lib/libc/string/strcpy.3	Fri Aug 11 09:39:39 2023
@@ -30,16 +30,14 @@
 .\" SUCH DAMAGE.
 .\"
 .\" from: @(#)strcpy.3	8.1 (Berkeley) 6/4/93
-.\"	$NetBSD: strcpy.3,v 1.23 2015/04/01 20:18:17 riastradh Exp $
+.\"	$NetBSD: strcpy.3,v 1.24 2023/08/11 09:39:39 riastradh Exp $
 .\"
-.Dd April 1, 2015
+.Dd August 11, 2023
 .Dt STRCPY 3
 .Os
 .Sh NAME
 .Nm stpcpy ,
-.Nm stpncpy ,
-.Nm strcpy ,
-.Nm strncpy
+.Nm strcpy
 .Nd copy strings
 .Sh LIBRARY
 .Lb libc
@@ -48,11 +46,7 @@
 .Ft char *
 .Fn stpcpy "char * restrict dst" "const char * restrict src"
 .Ft char *
-.Fn stpncpy "char * restrict dst" "const char * restrict src" "size_t len"
-.Ft char *
 .Fn strcpy "char * restrict dst" "const char * restrict src"
-.Ft char *
-.Fn strncpy "char * restrict dst" "const char * restrict src" "size_t len"
 .Sh DESCRIPTION
 The
 .Fn stpcpy
@@ -62,165 +56,73 @@ functions
 copy the string
 .Fa src
 to
-.Fa dst
-(including the terminating
-.Ql \e0
-character).
-.Pp
-The
-.Fn stpncpy
-and
-.Fn strncpy
-functions copy at most
-.Fa len
-characters from
-.Fa src
-into
-.Fa dst .
-If
-.Fa src
-is less than
-.Fa len
-characters long,
-the remainder of
-.Fa dst
-is filled with
+.Fa dst ,
+including the terminating
 .Ql \e0
-characters.
-Otherwise,
-.Fa dst
-is
-.Em not
-terminated.
+character.
 .Pp
 The strings
 .Fa src
 and
 .Fa dst
 may not overlap.
+The string
+.Fa src
+must be terminated by a
+.Ql \e0
+character.
+The memory for
+.Fa dst
+must have space for
+.Fn strlen src Li "+ 1"
+bytes.
 .Sh RETURN VALUES
 The
 .Fn strcpy
-and
-.Fn strncpy
-functions
-return
+function returns
 .Fa dst .
+.Pp
 The
 .Fn stpcpy
-and
-.Fn stpncpy
-functions return a pointer to the terminating
+function returns a pointer to the terminating
 .Ql \e0
 character of
 .Fa dst .
-If
-.Fn stpncpy
-does not terminate
-.Fa dst
-with a
-.Dv NUL
-character, it instead returns a pointer to
-.Li dst[len]
-(which does not necessarily refer to a valid memory location.)
-.Sh EXAMPLES
-The following sets
-.Va chararray
-to
-.Dq Li abc\e0\e0\e0 :
-.Bd -literal -offset indent
-char chararray[6];
-
-(void)strncpy(chararray, "abc", sizeof(chararray));
-.Ed
-.Pp
-The following sets
-.Va chararray
-to
-.Dq Li abcdef :
-.Bd -literal -offset indent
-char chararray[6];
-
-(void)strncpy(chararray, "abcdefgh", sizeof(chararray));
-.Ed
-.Pp
-Note that it does
-.Em not
-.Dv NUL Ns No -terminate
-.Va chararray
-because the length of the source string is greater than or equal
-to the length parameter.
-.Fn strncpy
-.Em only
-.Dv NUL Ns No -terminates
-the destination string when the length of the source
-string is less than the length parameter.
-.Pp
-The following copies as many characters from
-.Va input
-to
-.Va buf
-as will fit and
-.Dv NUL Ns No -terminates
-the result.
-Because
-.Fn strncpy
-does
-.Em not
-guarantee to
-.Dv NUL Ns No -terminate
-the string itself, this must be done explicitly.
-.Bd -literal -offset indent
-char buf[1024];
-
-(void)strncpy(buf, input, sizeof(buf) - 1);
-buf[sizeof(buf) - 1] = '\e0';
-.Ed
-.Pp
-This could be better and more simply achieved 

CVS commit: src/lib/libc/string

2023-08-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 11 09:39:39 UTC 2023

Modified Files:
src/lib/libc/string: Makefile.inc strcpy.3
Added Files:
src/lib/libc/string: strncpy.3

Log Message:
strncpy(3), stpncpy(3): Split man page out of strcpy(3), stpcpy(3).

These are for substantively different purposes (fixed-width fields
with optional NUL padding vs NUL-terminated strings), so they don't
belong together.

Be more specific about the security issues.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/lib/libc/string/Makefile.inc
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/string/strcpy.3
cvs rdiff -u -r0 -r1.1 src/lib/libc/string/strncpy.3

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



CVS commit: src/sys/dev/acpi/wmi

2023-08-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 11 08:36:59 UTC 2023

Modified Files:
src/sys/dev/acpi/wmi: wmi_acpi.c

Log Message:
acpiwmi(4): Fix abuse of char buffer for struct guid_t content.

Nothing guarantees alignment, so this is all undefined behaviour,
even if we don't touch the uninitialized members.

XXX pullup-10
XXX pullup-9
XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/acpi/wmi/wmi_acpi.c

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

Modified files:

Index: src/sys/dev/acpi/wmi/wmi_acpi.c
diff -u src/sys/dev/acpi/wmi/wmi_acpi.c:1.22 src/sys/dev/acpi/wmi/wmi_acpi.c:1.23
--- src/sys/dev/acpi/wmi/wmi_acpi.c:1.22	Thu Aug 10 20:49:19 2023
+++ src/sys/dev/acpi/wmi/wmi_acpi.c	Fri Aug 11 08:36:59 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: wmi_acpi.c,v 1.22 2023/08/10 20:49:19 mrg Exp $	*/
+/*	$NetBSD: wmi_acpi.c,v 1.23 2023/08/11 08:36:59 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Jukka Ruohonen 
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.22 2023/08/10 20:49:19 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.23 2023/08/11 08:36:59 riastradh Exp $");
 
 #include 
 #include 
@@ -320,8 +320,8 @@ acpi_wmi_guid_get(struct acpi_wmi_softc 
 const char *src, struct wmi_t **out)
 {
 	struct wmi_t *wmi;
-	struct guid_t *guid;
-	char bin[MAX(16, sizeof(*guid))];
+	struct guid_t guid;
+	char bin[16];
 	char hex[3];
 	const char *ptr;
 	uint8_t i;
@@ -346,14 +346,14 @@ acpi_wmi_guid_get(struct acpi_wmi_softc 
 		ptr++;
 	}
 
-	guid = (struct guid_t *)bin;
-	guid->data1 = be32toh(guid->data1);
-	guid->data2 = be16toh(guid->data2);
-	guid->data3 = be16toh(guid->data3);
+	guid.data1 = be32dec([0]);
+	guid.data2 = be16dec([4]);
+	guid.data3 = be16dec([6]);
+	memcpy(guid.data4, [8], 8);
 
 	SIMPLEQ_FOREACH(wmi, >wmi_head, wmi_link) {
 
-		if (GUIDCMP(guid, >guid) != 0) {
+		if (GUIDCMP(, >guid) != 0) {
 
 			if (out != NULL)
 *out = wmi;



CVS commit: src/sys/dev/acpi/wmi

2023-08-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 11 08:36:59 UTC 2023

Modified Files:
src/sys/dev/acpi/wmi: wmi_acpi.c

Log Message:
acpiwmi(4): Fix abuse of char buffer for struct guid_t content.

Nothing guarantees alignment, so this is all undefined behaviour,
even if we don't touch the uninitialized members.

XXX pullup-10
XXX pullup-9
XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/acpi/wmi/wmi_acpi.c

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



CVS commit: src/lib/libc/string

2023-08-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 11 08:15:30 UTC 2023

Modified Files:
src/lib/libc/string: strlcpy.3

Log Message:
strlcpy(3): Rework man page to clarify relation to strncpy(3).

Add caveats explaining when strlcpy(3) and strlcat(3) are dangerously
inadequate or inappropriate.

XXX pullup-10
XXX pullup-9
XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/string/strlcpy.3

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

Modified files:

Index: src/lib/libc/string/strlcpy.3
diff -u src/lib/libc/string/strlcpy.3:1.14 src/lib/libc/string/strlcpy.3:1.15
--- src/lib/libc/string/strlcpy.3:1.14	Sun Aug 28 10:48:16 2022
+++ src/lib/libc/string/strlcpy.3	Fri Aug 11 08:15:30 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: strlcpy.3,v 1.14 2022/08/28 10:48:16 hgutch Exp $
+.\"	$NetBSD: strlcpy.3,v 1.15 2023/08/11 08:15:30 riastradh Exp $
 .\" from OpenBSD: strlcpy.3,v 1.11 2000/11/16 23:27:41 angelos Exp
 .\"
 .\" Copyright (c) 1998, 2000 Todd C. Miller 
@@ -26,7 +26,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd March 1, 2001
+.Dd August 11, 2023
 .Dt STRLCPY 3
 .Os
 .Sh NAME
@@ -46,17 +46,36 @@ The
 .Fn strlcpy
 and
 .Fn strlcat
-functions copy and concatenate strings respectively.
-They are designed
-to be safer, more consistent, and less error prone replacements for
+functions copy and concatenate NUL-terminated strings respectively.
+.Pp
+The
+.Fn strlcpy
+function copies up to
+.Fa size
+- 1 characters from the NUL-terminated string
+.Fa src
+to
+.Fa dst ,
+NUL-terminating the result.
+.Pp
+The
+.Fn strlcat
+function appends the NUL-terminated string
+.Fa src
+to the end of
+.Fa dst .
+It will append at most
+.Fa size
+- strlen(dst) - 1 bytes, NUL-terminating the result.
+.Ss Relation to Xr strncpy 3 and Xr strncat 3
+Unlike
 .Xr strncpy 3
 and
-.Xr strncat 3 .
-Unlike those functions,
+.Xr strncat 3 ,
 .Fn strlcpy
 and
 .Fn strlcat
-take the full size of the buffer (not just the length) and guarantee to
+are guaranteed to
 NUL-terminate the result (as long as
 .Fa size
 is larger than 0 or, in the case of
@@ -65,7 +84,26 @@ as long as there is at least one byte fr
 .Fa dst ) .
 Note that you should include a byte for the NUL in
 .Fa size .
-Also note that
+.Pp
+.Sy WARNING :
+Also unlike
+.Xr strncpy 3
+and
+.Xr strncat 3 ,
+.Fn strlcpy
+and
+.Fn strlcat
+are not guaranteed to initialize all
+.Fa size
+bytes of
+.Fa dst
+\(em bytes past
+.Fa dst Ns Li "[" Fn strlen src Li "+ 1" Ns Li "]"
+are left uninitialized.
+This can lead to security vulnerabilities such as leaking secrets from
+uninitialized stack or heap buffers.
+.Pp
+.Sy WARNING :
 .Fn strlcpy
 and
 .Fn strlcat
@@ -82,26 +120,19 @@ both
 and
 .Fa dst
 must be NUL-terminated.
-.Pp
-The
+Applications handling fixed-width fields with
+.Pq possibly empty
+NUL padding, instead of NUL-terminated C strings, MUST use
+.Xr strncpy 3
+and
+.Xr strncat 3
+instead.
+Attempting to use
 .Fn strlcpy
-function copies up to
-.Fa size
-- 1 characters from the NUL-terminated string
-.Fa src
-to
-.Fa dst ,
-NUL-terminating the result.
-.Pp
-The
+or
 .Fn strlcat
-function appends the NUL-terminated string
-.Fa src
-to the end of
-.Fa dst .
-It will append at most
-.Fa size
-- strlen(dst) - 1 bytes, NUL-terminating the result.
+for these cases can lead to crashes or security vulnerabilities from
+buffer overruns.
 .Sh RETURN VALUES
 The
 .Fn strlcpy



CVS commit: src/lib/libc/string

2023-08-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 11 08:15:30 UTC 2023

Modified Files:
src/lib/libc/string: strlcpy.3

Log Message:
strlcpy(3): Rework man page to clarify relation to strncpy(3).

Add caveats explaining when strlcpy(3) and strlcat(3) are dangerously
inadequate or inappropriate.

XXX pullup-10
XXX pullup-9
XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/string/strlcpy.3

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



CVS commit: src/external/gpl3/gcc

2023-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 07:37:48 UTC 2023

Modified Files:
src/external/gpl3/gcc: README.gcc12

Log Message:
sh3 releases now build.  so did the mips64 ones the other day...


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/README.gcc12

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/gcc/README.gcc12
diff -u src/external/gpl3/gcc/README.gcc12:1.11 src/external/gpl3/gcc/README.gcc12:1.12
--- src/external/gpl3/gcc/README.gcc12:1.11	Fri Aug 11 05:34:36 2023
+++ src/external/gpl3/gcc/README.gcc12	Fri Aug 11 07:37:48 2023
@@ -1,4 +1,4 @@
-$NetBSD: README.gcc12,v 1.11 2023/08/11 05:34:36 mrg Exp $
+$NetBSD: README.gcc12,v 1.12 2023/08/11 07:37:48 mrg Exp $
 
 
 new stuff:
@@ -59,8 +59,8 @@ mips64eb	y	b	y	y	b	y		?	?	?
 mips64el	y	b	y	y	b	y		?	?	?
 powerpc		y	y	y	y	?	n[4]		?	?	?
 powerpc64	y	?	?	y	?	?		?	?	?
-sh3eb		y	?	y	y	?	?		?	?	?
-sh3el		y	n[20]	y	y	?	n[8]		?	?	?
+sh3eb		y	?	y	y	b	y		?	?	?
+sh3el		y	n[20]	y	y	b	y		?	?	?
 sparc		y	y	y	y	n[21]	y		y	y	?
 sparc64		y	b	y	y	n[16]	y		y	?	?
 vax		y	?	y	y	?	n		?	?	?
@@ -79,10 +79,6 @@ architecture	tools	kernels	libgcc	native
 [7]: fails to build kernels:
  In file included from sys/arch/powerpc/oea/pmap64.c:4:
  sys/arch/powerpc/oea/pmap.c:2186:2: error: #error PPC_OEA64 not supported
-[8]: destdir.evbsh3/usr/include/ssp/string.h: In function '_int_strtod_l':
- destdir.evbsh3/usr/include/ssp/string.h:82:1: error: inlining failed in call to 'always_inline' '__memcpy_ichk': target specific option mismatch
- this is caused by strtod.c using optimise("O0") conflicting with the always_inline attribute.
- originally -O0 to fix PR#55668, but may be fixed in gcc10+.
 [10]: libc.so fails to link with weird relocation errors:
   vax--netbsdelf/bin/ld: warning: dynamic relocation to `?' in readonly section `.eh_frame'
 [11]: sanitizers don't build yet.
@@ -157,8 +153,8 @@ mipseb:		k		k		k		k		k		y
 mipsel:		k		k		k		k		k		y
 
 		algor		evbmips		pmax
-mips64eb:	 		r		 
-mips64el:	k		r		r
+mips64eb:	 		y		 
+mips64el:	k		y		y
 
 		amigappc	bebox	evbppc	ibmnws		macppc		mvmeppc		ofppc		prep		rs6000		sandpoint
 powerpc:	k		k	k	k		kn[4]		k		k		k		k		k
@@ -167,5 +163,5 @@ powerpc:	k		k	k	k		kn[4]		k		k		k		k		k
 powerpc64:	k		k		n[7]
 
 		dreamcast	evbsh3		hpcsh		landisk		mmeye
-sh3eb:		 		kn[8]		 		 		k
-sh3el:		k		kn[8]		k		k
+sh3eb:		 		y		 		 		k
+sh3el:		k		y		k		k



CVS commit: src/external/gpl3/gcc

2023-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 07:37:48 UTC 2023

Modified Files:
src/external/gpl3/gcc: README.gcc12

Log Message:
sh3 releases now build.  so did the mips64 ones the other day...


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/README.gcc12

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



CVS commit: src

2023-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 07:05:39 UTC 2023

Modified Files:
src/sys/arch/mips/rmi: rmixl_fmn.c
src/sys/dev/ic: rtsx.c
src/sys/lib/libkern: strlist.c
src/usr.sbin/sunlabel: sunlabel.c

Log Message:
avoid uninitialised variable warnings (likely incorrect ones.)

cry wolved by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/rmi/rmixl_fmn.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/rtsx.c
cvs rdiff -u -r1.2 -r1.3 src/sys/lib/libkern/strlist.c
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sunlabel/sunlabel.c

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

Modified files:

Index: src/sys/arch/mips/rmi/rmixl_fmn.c
diff -u src/sys/arch/mips/rmi/rmixl_fmn.c:1.4 src/sys/arch/mips/rmi/rmixl_fmn.c:1.5
--- src/sys/arch/mips/rmi/rmixl_fmn.c:1.4	Tue Sep 27 01:02:34 2011
+++ src/sys/arch/mips/rmi/rmixl_fmn.c	Fri Aug 11 07:05:39 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_fmn.c,v 1.4 2011/09/27 01:02:34 jym Exp $	*/
+/*	$NetBSD: rmixl_fmn.c,v 1.5 2023/08/11 07:05:39 mrg Exp $	*/
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -896,7 +896,7 @@ static int
 rmixl_fmn_msg_recv_subr(u_int bucket, rmixl_fmn_rxmsg_t *rxmsg)
 {
 	fmn_t *fmnp;
-	uint32_t msg_status;
+	uint32_t msg_status = 0 /* XXXGCC12 */;
 	int rv;
 
 	fmnp = fmn_lookup(curcpu()->ci_cpuid);

Index: src/sys/dev/ic/rtsx.c
diff -u src/sys/dev/ic/rtsx.c:1.6 src/sys/dev/ic/rtsx.c:1.7
--- src/sys/dev/ic/rtsx.c:1.6	Sat Aug  7 16:19:12 2021
+++ src/sys/dev/ic/rtsx.c	Fri Aug 11 07:05:39 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsx.c,v 1.6 2021/08/07 16:19:12 thorpej Exp $	*/
+/*	$NetBSD: rtsx.c,v 1.7 2023/08/11 07:05:39 mrg Exp $	*/
 /*	$OpenBSD: rtsx.c,v 1.10 2014/08/19 17:55:03 phessler Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsx.c,v 1.6 2021/08/07 16:19:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsx.c,v 1.7 2023/08/11 07:05:39 mrg Exp $");
 
 #include 
 #include 
@@ -935,7 +935,7 @@ static int
 rtsx_read(struct rtsx_softc *sc, uint16_t addr, uint8_t *val)
 {
 	int tries = 1024;
-	uint32_t reg;
+	uint32_t reg = 0 /* XXXGCC12 */;
 
 	WRITE4(sc, RTSX_HAIMR, RTSX_HAIMR_BUSY |
 	(uint32_t)((addr & 0x3FFF) << 16));

Index: src/sys/lib/libkern/strlist.c
diff -u src/sys/lib/libkern/strlist.c:1.2 src/sys/lib/libkern/strlist.c:1.3
--- src/sys/lib/libkern/strlist.c:1.2	Sat Jan 23 19:41:16 2021
+++ src/sys/lib/libkern/strlist.c	Fri Aug 11 07:05:39 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: strlist.c,v 1.2 2021/01/23 19:41:16 thorpej Exp $	*/
+/*	$NetBSD: strlist.c,v 1.3 2023/08/11 07:05:39 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -258,7 +258,7 @@ strlist_match(const char * const sl, siz
 const char * const str)
 {
 	unsigned int count;
-	int idx;
+	int idx = 0 /* XXXGCC 12 */;
 
 	if (strlist_match_internal(sl, slsize, str, , ,
    match_strcmp)) {
@@ -279,7 +279,7 @@ strlist_pmatch(const char * const sl, si
 const char * const pattern)
 {
 	unsigned int count;
-	int idx;
+	int idx = 0; /* XXXGCC12 */
 
 	if (strlist_match_internal(sl, slsize, pattern, , ,
    match_pmatch)) {

Index: src/usr.sbin/sunlabel/sunlabel.c
diff -u src/usr.sbin/sunlabel/sunlabel.c:1.25 src/usr.sbin/sunlabel/sunlabel.c:1.26
--- src/usr.sbin/sunlabel/sunlabel.c:1.25	Thu May  4 16:29:08 2017
+++ src/usr.sbin/sunlabel/sunlabel.c	Fri Aug 11 07:05:39 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: sunlabel.c,v 1.25 2017/05/04 16:29:08 sevan Exp $ */
+/* $NetBSD: sunlabel.c,v 1.26 2023/08/11 07:05:39 mrg Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: sunlabel.c,v 1.25 2017/05/04 16:29:08 sevan Exp $");
+__RCSID("$NetBSD: sunlabel.c,v 1.26 2023/08/11 07:05:39 mrg Exp $");
 #endif
 
 #include 
@@ -1018,7 +1018,7 @@ print_part(int all)
 	int i, j, k, n, r, c;
 	size_t ncols;
 	uint32_t edges[2 * NPART];
-	int ce[2 * NPART];
+	int ce[2 * NPART] = {0}; /* XXXGCC12 */
 	int row[NPART];
 	unsigned char table[2 * NPART][NPART];
 	char *line;



CVS commit: src

2023-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 07:05:39 UTC 2023

Modified Files:
src/sys/arch/mips/rmi: rmixl_fmn.c
src/sys/dev/ic: rtsx.c
src/sys/lib/libkern: strlist.c
src/usr.sbin/sunlabel: sunlabel.c

Log Message:
avoid uninitialised variable warnings (likely incorrect ones.)

cry wolved by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/rmi/rmixl_fmn.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/rtsx.c
cvs rdiff -u -r1.2 -r1.3 src/sys/lib/libkern/strlist.c
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sunlabel/sunlabel.c

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



CVS commit: src/usr.bin/mail

2023-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 07:01:01 UTC 2023

Modified Files:
src/usr.bin/mail: lex.c

Log Message:
explicitly truncate display name string size.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/mail/lex.c

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

Modified files:

Index: src/usr.bin/mail/lex.c
diff -u src/usr.bin/mail/lex.c:1.45 src/usr.bin/mail/lex.c:1.46
--- src/usr.bin/mail/lex.c:1.45	Sun Feb  4 09:01:12 2018
+++ src/usr.bin/mail/lex.c	Fri Aug 11 07:01:01 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lex.c,v 1.45 2018/02/04 09:01:12 mrg Exp $	*/
+/*	$NetBSD: lex.c,v 1.46 2023/08/11 07:01:01 mrg Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)lex.c	8.2 (Berkeley) 4/20/95";
 #else
-__RCSID("$NetBSD: lex.c,v 1.45 2018/02/04 09:01:12 mrg Exp $");
+__RCSID("$NetBSD: lex.c,v 1.46 2023/08/11 07:01:01 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -167,7 +167,8 @@ update_mailname(const char *name)
 sep = "...";
 			}
 			(void)snprintf(displayname, sizeof(displayname),
-			"+%s%s", sep, cp);
+			"+%s%.*s", sep,
+			(int)(sizeof(displayname) - 1 - strlen(sep)), cp);
 			return;
 		}
 	}



CVS commit: src/usr.bin/mail

2023-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 07:01:01 UTC 2023

Modified Files:
src/usr.bin/mail: lex.c

Log Message:
explicitly truncate display name string size.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/mail/lex.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/gcc/usr.bin/common-target

2023-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 06:52:45 UTC 2023

Modified Files:
src/external/gpl3/gcc/usr.bin/common-target: Makefile

Log Message:
re-enable an sh3 warning that is still needed for GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/external/gpl3/gcc/usr.bin/common-target/Makefile

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/gcc/usr.bin/common-target/Makefile
diff -u src/external/gpl3/gcc/usr.bin/common-target/Makefile:1.14 src/external/gpl3/gcc/usr.bin/common-target/Makefile:1.15
--- src/external/gpl3/gcc/usr.bin/common-target/Makefile:1.14	Tue Aug  1 05:57:54 2023
+++ src/external/gpl3/gcc/usr.bin/common-target/Makefile	Fri Aug 11 06:52:45 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2023/08/01 05:57:54 mrg Exp $
+#	$NetBSD: Makefile,v 1.15 2023/08/11 06:52:45 mrg Exp $
 
 HOSTPROG_CXX=	1
 LIBISPRIVATE=	yes
@@ -24,7 +24,7 @@ CPPFLAGS+=	-I${GCCARCH} -I${BACKENDOBJ} 
 #COPTS.rs6000-common.cc+=	-Wno-stack-protector
 #COPTS.arm-common.cc+=	-Wno-stack-protector
 .if ${MACHINE_CPU} == "sh3"
-#COPTS.opts.cc+=		${CC_WNO_FORMAT_TRUNCATION}
+COPTS.opts.cc+=		${CC_WNO_FORMAT_TRUNCATION}
 .endif
 
 GENPROG_ERROR_DEPENDS=errors.lo



CVS commit: src/external/gpl3/gcc/usr.bin/common-target

2023-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 06:52:45 UTC 2023

Modified Files:
src/external/gpl3/gcc/usr.bin/common-target: Makefile

Log Message:
re-enable an sh3 warning that is still needed for GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/external/gpl3/gcc/usr.bin/common-target/Makefile

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/lsan

2023-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 06:25:17 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_allocator.h

Log Message:
make this more like the old lsan_allocator.h change.

adds sh3 and vax build support.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.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/gcc/dist/libsanitizer/lsan

2023-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 06:25:17 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_allocator.h

Log Message:
make this more like the old lsan_allocator.h change.

adds sh3 and vax build support.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.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/gcc/dist/libsanitizer/lsan/lsan_allocator.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.9 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.10
--- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.9	Fri Aug  4 19:25:06 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h	Fri Aug 11 06:25:17 2023
@@ -51,10 +51,14 @@ struct ChunkMetadata {
 
 #if defined(__mips64) || defined(__aarch64__) || defined(__i386__) || \
 defined(__arm__) || SANITIZER_RISCV64 || defined(__hexagon__) || \
-((defined(__hppa__) || defined(__sparc__)) && !defined(_LP64)) || \
-defined(__mips_o32) || defined(__mips_n32) || defined(__m68k__) || \
-(defined(__riscv__) && !defined(_LP64)) || \
-(defined(__powerpc__) && !defined(__powerpc64__))
+((defined(__sparc__) || \
+  defined(__powerpc__) || \
+  defined(__m68k__) || \
+  defined(__hppa__) || \
+  defined(__sh3__) || \
+  defined(__vax__) || \
+  defined(__riscv) || \
+  defined(__mips__)) && !defined(_LP64))
 template 
 struct AP32 {
   static const uptr kSpaceBeg = 0;
@@ -70,8 +74,8 @@ template 
 using PrimaryAllocatorASVT = SizeClassAllocator32>;
 using PrimaryAllocator = PrimaryAllocatorASVT;
 #elif defined(__x86_64__) || defined(__powerpc64__) || defined(__s390x__) || \
-  defined(__alpha__) || defined(__sparc64__) || defined(__ia64__) || \
-  defined(__powerpc64__) || (defined(__riscv__) && !defined(_LP64))
+  defined(__sparc64__) || defined(__ia64__) || defined(__alpha__) || \
+  defined(__mips64) || defined(__riscv)
 # if SANITIZER_FUCHSIA
 const uptr kAllocatorSpace = ~(uptr)0;
 const uptr kAllocatorSize  =  0x400ULL;  // 4T.



CVS commit: src/lib/libc/gdtoa

2023-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 06:02:46 UTC 2023

Modified Files:
src/lib/libc/gdtoa: strtod.c

Log Message:
remove the -O0 force for _int_strtod_l() and GCC 9, it's fixed in GCC 10 and 12.

this was triggering sh3 GCC 12 to fail compiles because of ssp.h's memcpy()
frontend having the always_inline attribute that didn't match -O0 or so.

tested with pkgsrc gcc9 to confirm it hangs there, but newer versions are fine.

also known as PR#55668, which now has a real fix (gcc 10 :-).


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/lib/libc/gdtoa/strtod.c

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

Modified files:

Index: src/lib/libc/gdtoa/strtod.c
diff -u src/lib/libc/gdtoa/strtod.c:1.18 src/lib/libc/gdtoa/strtod.c:1.19
--- src/lib/libc/gdtoa/strtod.c:1.18	Thu May  6 16:15:33 2021
+++ src/lib/libc/gdtoa/strtod.c	Fri Aug 11 06:02:46 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: strtod.c,v 1.18 2021/05/06 16:15:33 christos Exp $ */
+/* $NetBSD: strtod.c,v 1.19 2023/08/11 06:02:46 mrg Exp $ */
 
 /
 
@@ -90,9 +90,6 @@ sulp
 	}
 #endif /*}*/
 
-#if __GNUC_PREREQ__(9, 3)
-__attribute__((__optimize__("O0")))
-#endif
 static double
 _int_strtod_l(CONST char *s00, char **se, locale_t loc)
 {



CVS commit: src/lib/libc/gdtoa

2023-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 06:02:46 UTC 2023

Modified Files:
src/lib/libc/gdtoa: strtod.c

Log Message:
remove the -O0 force for _int_strtod_l() and GCC 9, it's fixed in GCC 10 and 12.

this was triggering sh3 GCC 12 to fail compiles because of ssp.h's memcpy()
frontend having the always_inline attribute that didn't match -O0 or so.

tested with pkgsrc gcc9 to confirm it hangs there, but newer versions are fine.

also known as PR#55668, which now has a real fix (gcc 10 :-).


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/lib/libc/gdtoa/strtod.c

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



<    1   2