From 6c7ec6eb1b94fd9433f6d65f71d3a7917ae49b4b Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Wed, 12 Dec 2007 05:25:15 +0100 Subject: [PATCH] Update brandelf.py. --- src/stub/scripts/brandelf.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/stub/scripts/brandelf.py b/src/stub/scripts/brandelf.py index fc3a6143..6065e0ca 100644 --- a/src/stub/scripts/brandelf.py +++ b/src/stub/scripts/brandelf.py @@ -56,6 +56,10 @@ def do_file(fn): if not opts.dry_run: fp.write(s) + def brand_arm(s): + if e_ident[4:7] != s: + raise Exception, "%s is not %s" % (fn, opts.bfdname) + write("\x61") # ELFOSABI_ARM def brand_freebsd(s): if e_ident[4:7] != s: raise Exception, "%s is not %s" % (fn, opts.bfdname) @@ -74,12 +78,16 @@ def do_file(fn): if e_ident[:4] != "\x7f\x45\x4c\x46": raise Exception, "%s is not %s" % (fn, "ELF") fp.seek(7, 0) - if opts.bfdname == "elf32-i386" and opts.elfosabi == "freebsd": + if opts.bfdname == "elf32-bigarm" and opts.elfosabi == "arm": + brand_arm("\x01\x02\x01") + elif opts.bfdname == "elf32-i386" and opts.elfosabi == "freebsd": 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 == "openbsd": brand_openbsd("\x01\x01\x01") + elif opts.bfdname == "elf32-littlearm" and opts.elfosabi == "arm": + brand_arm("\x01\x01\x01") elif opts.bfdname == "elf32-littlemips" and opts.elfosabi == "linux": brand_linux("\x01\x01\x01") elif opts.bfdname == "elf32-powerpc" and opts.elfosabi == "linux":