Re: [PATCH v2 15/16] objtool/powerpc: Enable objtool to be built on ppc

From
Christophe Leroy <hidden>
Date
2022-09-01 16:39:01
Also in
lkml
Reply to
Segher Boessenkool, 2022-09-01

Le 01/09/2022 à 17:11, Segher Boessenkool a écrit :
On Thu, Sep 01, 2022 at 09:32:46AM +0000, Christophe Leroy wrote:
quoted
Le 29/08/2022 à 07:52, Sathvika Vasireddy a écrit :
quoted
+int arch_decode_instruction(struct objtool_file *file, const struct section *sec,
+			    unsigned long offset, unsigned int maxlen,
+			    unsigned int *len, enum insn_type *type,
+			    unsigned long *immediate,
+			    struct list_head *ops_list)
+{
+	u32 insn;
+
+	*immediate = 0;
+	insn = bswap_if_needed(file->elf, *(u32 *)(sec->data->d_buf + offset));
+	*len = 4;
Should be *len = 8 when insn >> 26 == 1.
But please use ppc_inst_prefixed().  And just use ppc_inst_len() here?
objtool is a userland app, there is no access to kernel headers here.
Not having convenience abstraction functions like that will give you
much more work in the future -- currently all prefix insns use primary
opcode 1, sure, and nothing else does; but this can change.
Yes most likely. Then we have to rebuild some light abstraction for objtool.

Christophe
Thread (64 messages) 64 messages, 10 authors, last reply 2023-02-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help