lkml.org 
[lkml]   [2020]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC v5 16/57] objtool: Support restoring BP from the stack without POP
Date
Support instruction that set BP to its previous value (base on the
current CFA state) from the stack without modifying the stack pointer.

Signed-off-by: Julien Thierry <jthierry@redhat.com>
---
tools/objtool/check.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 5b2539eaccba..0a5c51e4e24c 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -1507,6 +1507,12 @@ static int update_insn_state(struct instruction *insn, struct insn_state *state)
cfa->base = state->drap_reg;
cfa->offset = 0;
state->drap_offset = -1;
+ } else if (!state->drap && op->src.reg == CFI_SP &&
+ op->dest.reg == cfa->base) {
+
+ /* mov disp(%rsp), %rbp */
+ cfa->base = CFI_SP;
+ cfa->offset += op->src.offset;
}

if (state->drap && op->src.reg == CFI_BP &&
--
2.21.0
\
 
 \ /
  Last update: 2020-01-09 17:05    [W:0.512 / U:5.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site