NetBSD version 5 requires PT_NOTE for PaX. Also adjust other *BSD and PT_NOTE.

[Tested OK on FreeBSD 8.1, NetBSD 5.1, OpenBSD 4.8.  Cleanup needed.]
This commit is contained in:
John Reiser
2010-11-16 21:13:42 -08:00
parent dfc2efe8a6
commit e6357b81eb
17 changed files with 5108 additions and 2460 deletions
+8 -2
View File
@@ -85,6 +85,7 @@ STUBS += i386-darwin.dylib-entry.h
# STUBS += i386-darwin.dylib-fold.h
STUBS += i386-darwin.macho-entry.h
STUBS += i386-darwin.macho-fold.h
STUBS += i386-netbsd.elf-entry.h
STUBS += i386-netbsd.elf-fold.h
STUBS += i386-openbsd.elf-fold.h
STUBS += i386-dos32.djgpp2.h
@@ -682,8 +683,13 @@ tmp/i386-bsd.elf-main.o : $(srcdir)/src/$$T.c
i386-netbsd.elf%.h : tc_list = i386-linux.elf arch-i386 default
i386-netbsd.elf%.h : tc_bfdname = elf32-i386
# NetBSD uses the OpenBSD fold.o (for PT_NOTE handling), but the plain BSD entry.o and main.o
i386-netbsd.elf-fold.h : tmp/i386-openbsd.elf-fold.o tmp/i386-bsd.elf-main.o tmp/i386-bsd.syscall.o $(srcdir)/src/i386-bsd.elf-fold.lds
i386-netbsd.elf-entry.h : $(srcdir)/src/$$T.S
$(call tc,gcc) -c -x assembler-with-cpp $< -o tmp/$T.bin
$(call tc,f-embed_objinfo,tmp/$T.bin)
$(call tc,bin2h) tmp/$T.bin $@
# NetBSD uses the plain BSD fold.o and the plain BSD entry.o and main.o
i386-netbsd.elf-fold.h : tmp/i386-bsd.elf-fold.o tmp/i386-bsd.elf-main.o tmp/i386-bsd.syscall.o $(srcdir)/src/i386-bsd.elf-fold.lds
$(call tc,ld) --strip-all -T $(srcdir)/src/i386-bsd.elf-fold.lds -Map tmp/$T.map $(filter %.o,$^) -o tmp/$T.bin
$(call tc,f-objstrip,tmp/$T.bin)
$(call tc,sstrip) tmp/$T.bin