On 2024-10-13, ramonazero@icloud.com <ramonazero@icloud.com> wrote:
> Hi!
>
> I'm having some issues with the NASM port ( 2.16.03 ) or if its the linking process.
>
> When running the linked ELF, It'll write some sort of garbage / corrupted ELF on the filesystem with question marks that can't be deleted, along with an error about the ELF.
>
> I was thinking it was maybe my exit syscall selection (60 != exit, its umask) that was causing some sort of issues, alas it was not. x_x
>
> If there's any additional section header I'm supposed to append within the source files, let me know as well!
>
> My usual commands are:
> nasm -g -felf64 -o file.o file.s
> ld -o file file.o
>
> Execution errors:
> ./test[1]:ELF: not found
> ./test[4]: no closing quote
>
> Thank You!
I don't remember exactly what's needed, but this is missing some elf
header section which is required on OpenBSD, without which it's not
recognised as executable object code, so the shell is trying to handle
it. Try pointing readelf at a working binary and compare what's missing.
Might be .note.openbsd.ident.
Also be aware that syscalls must be done from libc now, see
pinsyscalls(2).
--
Please keep replies on the mailing list.
No comments:
Post a Comment