summaryrefslogtreecommitdiff
path: root/tools/objtool/arch/powerpc/decode.c
diff options
context:
space:
mode:
authorAlexandre Chartre <alexandre.chartre@oracle.com>2025-11-21 10:53:13 +0100
committerPeter Zijlstra <peterz@infradead.org>2025-11-21 15:30:07 +0100
commit59953303827eceb06d486ba66cc0d71f55ded8ec (patch)
treec3394bfb901681fe576699d359d5edad48cb88b7 /tools/objtool/arch/powerpc/decode.c
parent1013f2e37bec39b1df5679e1c1e2572ece87c088 (diff)
objtool: Disassemble code with libopcodes instead of running objdump
objtool executes the objdump command to disassemble code. Use libopcodes instead to have more control about the disassembly scope and output. If libopcodes is not present then objtool is built without disassembly support. Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Josh Poimboeuf <jpoimboe@kernel.org> Link: https://patch.msgid.link/20251121095340.464045-4-alexandre.chartre@oracle.com
Diffstat (limited to 'tools/objtool/arch/powerpc/decode.c')
-rw-r--r--tools/objtool/arch/powerpc/decode.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/objtool/arch/powerpc/decode.c b/tools/objtool/arch/powerpc/decode.c
index 3a9b748216ed..4f68b402e785 100644
--- a/tools/objtool/arch/powerpc/decode.c
+++ b/tools/objtool/arch/powerpc/decode.c
@@ -3,6 +3,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <objtool/check.h>
+#include <objtool/disas.h>
#include <objtool/elf.h>
#include <objtool/arch.h>
#include <objtool/warn.h>
@@ -127,3 +128,14 @@ unsigned int arch_reloc_size(struct reloc *reloc)
return 8;
}
}
+
+#ifdef DISAS
+
+int arch_disas_info_init(struct disassemble_info *dinfo)
+{
+ return disas_info_init(dinfo, bfd_arch_powerpc,
+ bfd_mach_ppc, bfd_mach_ppc64,
+ NULL);
+}
+
+#endif /* DISAS */