Decompression stubs for arm64-linux (aarch)
modified: stub/Makefile modified: stub/arm64-darwin.macho-entry.h modified: stub/arm64-darwin.macho-fold.h new file: stub/arm64-linux.elf-entry.h new file: stub/arm64-linux.elf-fold.h modified: stub/scripts/xstrip.py modified: stub/src/arch/arm64/v8/macros.S modified: stub/src/arch/arm64/v8/nrv2b_d8.S modified: stub/src/arch/arm64/v8/nrv2d_d8.S modified: stub/src/arch/arm64/v8/nrv2e_d8.S new file: stub/src/arm64-linux.elf-entry.S new file: stub/src/arm64-linux.elf-fold.S new file: stub/src/arm64-linux.elf-fold.lds new file: stub/src/arm64-linux.elf-main.c modified: stub/src/include/linux.h
This commit is contained in:
@@ -27,6 +27,11 @@
|
||||
# <markus@oberhumer.com> <ezerotven+github@gmail.com>
|
||||
#
|
||||
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
|
||||
def eprint(*args, **kwargs):
|
||||
print(*args, file=sys.stderr, **kwargs)
|
||||
|
||||
import getopt, os, re, string, struct, sys
|
||||
|
||||
@@ -47,16 +52,18 @@ def strip_with_dump(dump_fn, eh, idata):
|
||||
lines = open(dump_fn, "rb").readlines()
|
||||
for l in lines:
|
||||
l = re.sub(r"\s+", " ", l.strip())
|
||||
# eprint("l=", l, "\n")
|
||||
f = l.split(" ")
|
||||
# eprint("f=", f, "len(f)=", len(f), "\n")
|
||||
if len(f) >= 8:
|
||||
if f[7].startswith("CONTENTS"):
|
||||
sh_offset = int("0x" + f[5], 16)
|
||||
sh_size = int("0x" + f[2], 16)
|
||||
if sh_offset + sh_size > new_len:
|
||||
new_len = sh_offset + sh_size
|
||||
##print sh_offset, sh_size, f
|
||||
# eprint("sh_offset=", sh_offset, "sh_size=", sh_size, "f=", f, "\n")
|
||||
if new_len > len(eh):
|
||||
##print dump_fn, new_len
|
||||
# eprint("dump_fn=", dump_fn, "new_len=", new_len, "\n")
|
||||
return eh, idata[:new_len-len(eh)]
|
||||
return eh, idata
|
||||
|
||||
@@ -177,6 +184,8 @@ def do_file(fn):
|
||||
if re.search(r"^powerpc64le-", os.path.basename(fn)):
|
||||
# FIXME / TODO
|
||||
pass
|
||||
elif re.search(r"^arm64-", os.path.basename(fn)):
|
||||
pass
|
||||
else:
|
||||
assert pos == len(odata), ("unexpected strip_with_dump", pos, len(odata))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user