NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Assembly example (nasm) for amd64 in NetBSD



On apr 14  1:46, RVP wrote:
> 
> Try adding a ".note.netbsd.ident" section:
> 
> ```
> $ diff -u testcpu.s.orig testcpu.s
> --- testcpu.s.orig	2023-04-14 01:42:08.984238899 +0000
> +++ testcpu.s	2023-04-14 01:41:06.204866303 +0000
> @@ -23,3 +23,11 @@
>      mov rax, 1
>      mov rbx, 0
>      syscall
> +
> +section .note.netbsd.ident
> +
> +   dd 7			; ELF_NOTE_NETBSD_NAMESZ
> +   dd 4			; ELF_NOTE_NETBSD_DESCSZ
> +   dd 1			; ELF_NOTE_TYPE_NETBSD_TAG
> +   db 'NetBSD',0,'$'	; NetBSD string
> +   dq 903000000		; NetBSD version 9.3.0
> $
> ```
> 
> -RVP

It works, thank you!

Rocky


Home | Main Index | Thread Index | Old Index