[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200109160300.26150-16-jthierry@redhat.com>
Date: Thu, 9 Jan 2020 16:02:18 +0000
From: Julien Thierry <jthierry@...hat.com>
To: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Cc: jpoimboe@...hat.com, peterz@...radead.org, raphael.gault@....com,
catalin.marinas@....com, will@...nel.org,
Julien Thierry <jthierry@...hat.com>
Subject: [RFC v5 15/57] objtool: Support addition to set frame pointer
Support updating the frame pointer by adding an immediate value to the
stack pointer in the CFA tracking code.
Signed-off-by: Julien Thierry <jthierry@...hat.com>
---
tools/objtool/check.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 19e96c4ad0a3..5b2539eaccba 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -1394,6 +1394,18 @@ static int update_insn_state(struct instruction *insn, struct insn_state *state)
break;
}
+ if (op->src.reg == CFI_SP && cfa->base == CFI_SP &&
+ op->dest.reg == CFI_BP &&
+ regs[CFI_BP].base == CFI_CFA &&
+ regs[CFI_BP].offset == -cfa->offset + op->src.offset) {
+
+ /* lea disp(%rsp), %rbp */
+ cfa->base = CFI_BP;
+ cfa->offset -= op->src.offset;
+ state->bp_scratch = false;
+ break;
+ }
+
if (op->src.reg == CFI_SP && cfa->base == CFI_SP) {
/* drap: lea disp(%rsp), %drap */
--
2.21.0
Powered by blists - more mailing lists