Thanks for checking!
I agree with your proposed changes. If noone else objects, please
go ahead and commit.
On Sun, 8 Nov 2020, Rin Okuyama wrote:
Thanks Paul for finding out the bug!
Then, compat_netbsd32 and compat_netbsd32_coredump modules are
successfully load for kernel without COMPAT_NETBSD32 option.
However, OABI binaries still do not work. I found this is due to
there remains ``#ifdef COMPAT_NETBSD32'' codes in sys/arch/arm.
By fixing them, OABI binaries work and dump valid core files!
I changed two files.
(1) arm_netbsd_elf32_probe() in arm/cpu_exec.c
Previously, determine whether emulation is native or netbsd32 by
testing ``epp->ep_esch->es_emul == &emul_netbsd32''. This requires
COMPAT_NETBSD32 option. However, we can use
``epp->ep_esch->es_emul != &emul_netbsd'' for this purpose.
(2) arm_netbsd_elf32_coredump_setup() in arm/core_machdep.c
This seems simply a mistake; kernel sets EABI flag to OABI core
files. We can remove entire COMPAT_NETBSD32 codes.
I will commit them soon if there's no objection.
Thanks,
rin
On 2020/11/08 6:53, Paul Goyette wrote:
Thanks for fixing ...
On Sat, 7 Nov 2020, Christos Zoulas wrote:
/usr/obj/evbarm-earmv7/tools/bin/nbmake-evbarm -V MACHINE_ARCH
earmv7
christos
On Nov 7, 2020, at 4:27 PM, Paul Goyette <p...@whooppee.com> wrote:
OK, I think I found the problem, but I don't know how to solve it...
All of the undefined symbols are supposed to be provided by
????????.../sys/arch/arm/arm32/netbsd32_machdep.c
but there is no netbsd32_machdep.o included in the compat_netbsd32
module.?? This file should be included by the following code in
.../sys/modules/compat_netbsd32/Makefile
????????.if ${MACHINE_ARCH} == "arm"
????????.PATH:?? ${S}/arch/arm/arm32
????????SRCS+=?? netbsd32_machdep.c
????????.endif
but it seems not to work (or at least, it doesn't do what it was
intended to do).
On Thu, 5 Nov 2020, Rin Okuyama wrote:
On 2020/11/05 5:43, Paul Goyette wrote:
BTW, the patch you submitted with the initial message in this thread
looks good for avoiding the issue.?? But I'm not sure it is a complete
solution.
In particular, you would need to build a 32-bit arm that contains ``no
options COMPAT_NETBSD32'' and then boot and load the compat_netbsd32
and compat_netbsd32_coredump modules
?????? modload compat_netbsd32
?????? modload compat_netbsd32_coredump
Then see if emulation of the old ABI still works, and check if core-
dump works for old-ADI programs; the test program I've been using for
core-dump checking is
?????? #include <stdlib.h>
?????? int main(int argc, void *argv) { abort(); }
I really have to leave and take care of some personal business, so I
would greatly appreciate if you can check this out.
Hmm, ``modload compat_netbsd32'' does not work on evbarmv6hf-el:
----
# uname -ap
NetBSD?? 9.99.75 NetBSD 9.99.75 (RPI0) #11: Thu Nov?? 5 20:26:39 JST
2020 rin@latipes:/sys/arch/evbarm/compile/RPI0 evbarm earmv6hf
# modload compat_netbsd32
[?? 29.6328410] kobj_checksyms, 994: [compat_netbsd32]: linker error:
symbol `netbsd32_vm_default_addr' not found
[?? 29.6460400] kobj_checksyms, 994: [compat_netbsd32]: linker error:
symbol `netbsd32_machdep_md_init' not found
[?? 29.6560750] kobj_checksyms, 994: [compat_netbsd32]: linker error:
symbol `netbsd32_sendsig' not found
[?? 29.6661200] kobj_checksyms, 994: [compat_netbsd32]: linker error:
symbol `cpu_mcontext32_validate' not found
[?? 29.6791570] kobj_checksyms, 994: [compat_netbsd32]: linker error:
symbol `cpu_setmcontext32' not found
[?? 29.6791570] kobj_checksyms, 994: [compat_netbsd32]: linker error:
symbol `netbsd32_machdep_md_fini' not found
[?? 29.6948370] kobj_checksyms, 994: [compat_netbsd32]: linker error:
symbol `startlwp32' not found
[?? 29.7048770] kobj_checksyms, 994: [compat_netbsd32]: linker error:
symbol `cpu_getmcontext32' not found
[?? 29.7168550] kobj_checksyms, 994: [compat_netbsd32]: linker error:
symbol `machine32' not found
[?? 29.7168550] kobj_checksyms, 994: [compat_netbsd32]: linker error:
symbol `netbsd32_sysarch' not found
[?? 29.7318320] WARNING: module error: unable to affix module
`compat_netbsd32', error 8
modload: compat_netbsd32: Exec format error
----
This should be because there are ``#ifdef COMPAT_NETBSD32'' codes in
files
not included in compat_netbsd32 module. compat_netbsd32 module must not
work also for aarch64 and mips64 for the same reason, whereas amd64 and
sparc64 seem OK.
Thanks,
rin
+--------------------+--------------------------+-----------------------+
| Paul Goyette???????????? | PGP Key fingerprint:???????? | E-mail
addresses:???????? |
| (Retired)?????????????????? | FA29 0E3B 35AF E8AE 6651 |
p...@whooppee.com???????? |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org????
|
+--------------------+--------------------------+-----------------------+
+--------------------+--------------------------+-----------------------+
| Paul Goyette???????????? | PGP Key fingerprint:???????? | E-mail
addresses:???????? |
| (Retired)?????????????????? | FA29 0E3B 35AF E8AE 6651 |
p...@whooppee.com???????? |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org???? |
+--------------------+--------------------------+-----------------------+
!DSPAM:5fa7404512526485051393!
+--------------------+--------------------------+-----------------------+
| Paul Goyette | PGP Key fingerprint: | E-mail addresses: |
| (Retired) | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org |
+--------------------+--------------------------+-----------------------+