lkml.org 
[lkml]   [2018]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC v2 2/6] objtool: ignore instructions
Date
In certain cases there is a need to suppress objtool warnings on
specific instructions. Provide an interface to achieve this goal.

Signed-off-by: Nadav Amit <namit@vmware.com>
---
tools/objtool/check.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 0414a0d52262..c890d714fb73 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -431,10 +431,11 @@ static int add_dead_ends(struct objtool_file *file)
/*
* Warnings shouldn't be reported for ignored functions.
*/
-static void add_ignores(struct objtool_file *file)
+static int add_ignores(struct objtool_file *file)
{
struct instruction *insn;
struct section *sec;
+ struct rela *rela;
struct symbol *func;

for_each_sec(file, sec) {
@@ -449,6 +450,20 @@ static void add_ignores(struct objtool_file *file)
insn->ignore = true;
}
}
+
+ sec = find_section_by_name(file->elf, ".rela.discard.ignore");
+ if (!sec)
+ return 0;
+
+ list_for_each_entry(rela, &sec->rela_list, list) {
+ insn = find_insn(file, rela->sym->sec, rela->addend);
+ if (!insn) {
+ WARN("bad .discard.ignore entry");
+ return -1;
+ }
+ insn->ignore = true;
+ }
+ return 0;
}

/*
@@ -1237,7 +1252,9 @@ static int decode_sections(struct objtool_file *file)
if (ret)
return ret;

- add_ignores(file);
+ ret = add_ignores(file);
+ if (ret)
+ return ret;

ret = add_nospec_ignores(file);
if (ret)
--
2.17.1
\
 
 \ /
  Last update: 2018-12-31 08:21    [W:0.120 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site