From 2f6211a1d984a09e49c1bfb51994458766f00d35 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Fri, 24 Mar 2017 10:54:56 -0700 Subject: [PATCH] xstrip.py slight improvement for powerpc64le and arm64 modified: stub/scripts/xstrip.py --- src/stub/scripts/xstrip.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/stub/scripts/xstrip.py b/src/stub/scripts/xstrip.py index f20af7aa..6c72efc9 100644 --- a/src/stub/scripts/xstrip.py +++ b/src/stub/scripts/xstrip.py @@ -175,11 +175,14 @@ def do_file(fn): pos = idata.find("\0.symtab\0.strtab\0.shstrtab\0") if opts.with_dump: eh, odata = strip_with_dump(opts.with_dump, eh, idata) + # Other compilers can intermix the contents of .rela sections + # with PROGBITS sections. This happens on powerpc64le and arm64. + # The general solution probably requires a C++ program + # that combines "objcopy -R", "objdump -htr", and xstrip. if re.search(r"^powerpc64le-", os.path.basename(fn)): - # FIXME / TODO - pass + assert pos >= len(odata), ("unexpected strip_with_dump", pos, len(odata)) elif re.search(r"^arm64-", os.path.basename(fn)): - pass + assert pos >= len(odata), ("unexpected strip_with_dump", pos, len(odata)) else: assert pos == len(odata), ("unexpected strip_with_dump", pos, len(odata)) else: