diff mbox series

[RFC,v2,13/20] objtool: arm64: Dump ORC data present in object files

Message ID 20220524001637.1707472-14-madvenka@linux.microsoft.com (mailing list archive)
State New, archived
Headers show
Series arm64: livepatch: Use ORC for dynamic frame pointer validation | expand

Commit Message

Madhavan T. Venkataraman May 24, 2022, 12:16 a.m. UTC
From: "Madhavan T. Venkataraman" <madvenka@linux.microsoft.com>

Call orc_dump() from cmd_fpv() to dump the ORC sections in an object
file. This is for debug purposes.

Signed-off-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
---
 tools/objtool/Build         | 1 +
 tools/objtool/builtin-fpv.c | 4 ++++
 2 files changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/tools/objtool/Build b/tools/objtool/Build
index 5de79c76f3f0..d40ee95039cf 100644
--- a/tools/objtool/Build
+++ b/tools/objtool/Build
@@ -20,6 +20,7 @@  objtool-$(SUBCMD_FPV) += cfi.o
 objtool-$(SUBCMD_FPV) += insn.o
 objtool-$(SUBCMD_FPV) += decode.o
 objtool-$(SUBCMD_FPV) += orc_gen.o
+objtool-$(SUBCMD_FPV) += orc_dump.o
 
 objtool-y += builtin-check.o
 objtool-y += builtin-orc.o
diff --git a/tools/objtool/builtin-fpv.c b/tools/objtool/builtin-fpv.c
index bc8f88f204b5..7934c569e60a 100644
--- a/tools/objtool/builtin-fpv.c
+++ b/tools/objtool/builtin-fpv.c
@@ -19,6 +19,7 @@ 
 
 static const char * const fpv_usage[] = {
 	"objtool fpv generate file.o",
+	"objtool fpv dump file.o",
 	NULL,
 };
 
@@ -69,6 +70,9 @@  int cmd_fpv(int argc, const char **argv)
 		return elf_write(file->elf);
 	}
 
+	if (!strcmp(argv[0], "dump"))
+		return orc_dump(objname);
+
 	usage_with_options(fpv_usage, fpv_options);
 
 	return 0;