summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jaeheon Yi <jaeheon@google.com> 2023-09-13 14:52:43 -0700
committer Jaeheon Yi <jaeheon@google.com> 2023-09-15 20:12:45 +0000
commit65962d0aa0cfbc770d037dac0a7017ca5aca93bf (patch)
treeff50003eb30c21a442f93a3fd76743e37660dba3
parent9875cc9671edc857efd0ed86b8eaea86c3399e88 (diff)
riscv64: check_cfi sees trailing unimp
The nterp_deliver_pending_exception trampoline has a deliberate `unimp` after the jump. The jump is phrased as a `call` to save the RA but a return is not expected and the `unimp` would catch a bad return. The `check_cfi` tool performs a disassembly to examine each PC of each function. Prior to this patch, objdump will simply ignore the final `unimp` because it looks like the past of a function. Adding the `--disassemble-zeroes` flag forces the last `unimp` to be observable and hence analyzed by the tool. Test: m check_cfi Bug: 283082047 Change-Id: Ieb03a7874c521fc49ecf2541167d623929eafe28
-rwxr-xr-xtools/check_cfi.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/check_cfi.py b/tools/check_cfi.py
index 60d6c1b296..83ee363ba5 100755
--- a/tools/check_cfi.py
+++ b/tools/check_cfi.py
@@ -149,10 +149,18 @@ Asm = collections.namedtuple("Asm", ["pc", "name", "data"])
def get_asm(lib: pathlib.Path) -> List[Asm]:
""" Get all ASM blocks (in dumped text-based format) """
- proc = subprocess.run([args.objdump, "--disassemble", "--no-show-raw-insn", lib],
- encoding='utf-8',
- capture_output=True,
- check=True)
+ proc = subprocess.run(
+ [
+ args.objdump,
+ "--disassemble",
+ "--no-show-raw-insn",
+ "--disassemble-zeroes",
+ lib,
+ ],
+ encoding="utf-8",
+ capture_output=True,
+ check=True,
+ )
section_re = re.compile("\n(?! |\n)", re.MULTILINE) # New-line not followed by indent.
sym_re = re.compile("([0-9a-f]+) <(.+)>:")