edgar mortiz <[EMAIL PROTECTED]> writes:
...
> > > $as -o hello.o hello.s
> > > $ld -o hello hello.o
> > > $./hello
> > > sh: ./hello: Operation not permitted
> > >
> > > $file hello
> > > hello: ELF 32-bit LSB executable, Intel 80386, version 1, statically
> > > linked, not stripped
> > >
> > > i noticed that the Gnu (AS) that FreeBSD uses will automatically
> > > "tagged" the file FreeBSD where as the Gnu (AS) that OpenBSD doesn't.
> > > is there a patch that can resolve this or a tweak of some sort .. I
> > > really want it to work on OpenBSD and not on the other BSD .. i picked
> > > OpenBSD coz it basically has all the docs I'll ever need together with
> > > the OS....
...
For openbsd, to tag it as such you need something like this:
# for openbsd; see
# /usr/src/lib/csu/common_elf/os-note-elf.h
# /usr/src/sys/kern/exec_elf.c
.section ".note.openbsd.ident", "a"
# .note
.p2align 2
.long 8
.long 4
.long 1
.ascii "OpenBSD\0"
.long 0
.p2align 2
You can read the files mentioned in the comments if you need more
information on how all this works.
-Marcus