NetBSD 5.0 wants PT_NOTE and branded executables

This commit is contained in:
John Reiser
2010-11-09 10:47:53 -08:00
parent e76fa45d86
commit b1f02f91d7
9 changed files with 472 additions and 133 deletions
+6
View File
@@ -69,6 +69,10 @@ def do_file(fn):
raise Exception, "%s is not %s" % (fn, opts.bfdname)
##write("\x00Linux\x00\x00\x00")
write("\x00" * 9)
def brand_netbsd(s):
if e_ident[4:7] != s:
raise Exception, "%s is not %s" % (fn, opts.bfdname)
write("\x02")
def brand_openbsd(s):
if e_ident[4:7] != s:
raise Exception, "%s is not %s" % (fn, opts.bfdname)
@@ -84,6 +88,8 @@ def do_file(fn):
brand_freebsd("\x01\x01\x01")
elif opts.bfdname == "elf32-i386" and opts.elfosabi == "linux":
brand_linux("\x01\x01\x01")
elif opts.bfdname == "elf32-i386" and opts.elfosabi == "netbsd":
brand_openbsd("\x01\x01\x01")
elif opts.bfdname == "elf32-i386" and opts.elfosabi == "openbsd":
brand_openbsd("\x01\x01\x01")
elif opts.bfdname == "elf32-littlearm" and opts.elfosabi == "arm":