aboutsummaryrefslogtreecommitdiffstats
path: root/tools/objtool
diff options
context:
space:
mode:
authorMuchun Song <songmuchun@bytedance.com>2020-04-12 22:44:05 +0800
committerIngo Molnar <mingo@kernel.org>2020-04-22 10:53:50 +0200
commit1ee444700e960b017558038a9443474e808b0045 (patch)
treec7febd5e41265e480b6235e1ae4def29ce80fc66 /tools/objtool
parentobjtool: Documentation: document UACCESS warnings (diff)
downloadlinux-dev-1ee444700e960b017558038a9443474e808b0045.tar.xz
linux-dev-1ee444700e960b017558038a9443474e808b0045.zip
objtool: Remove redundant .rodata section name comparison
If the prefix of section name is not '.rodata', the following function call can never return 0. strcmp(sec->name, C_JUMP_TABLE_SECTION) So the name comparison is pointless, just remove it. Signed-off-by: Muchun Song <songmuchun@bytedance.com> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/objtool')
-rw-r--r--tools/objtool/check.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index cffa5e357788..e06a891a4a3b 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -1354,8 +1354,8 @@ static void mark_rodata(struct objtool_file *file)
* .rodata.str1.* sections are ignored; they don't contain jump tables.
*/
for_each_sec(file, sec) {
- if ((!strncmp(sec->name, ".rodata", 7) && !strstr(sec->name, ".str1.")) ||
- !strcmp(sec->name, C_JUMP_TABLE_SECTION)) {
+ if (!strncmp(sec->name, ".rodata", 7) &&
+ !strstr(sec->name, ".str1.")) {
sec->rodata = true;
found = true;
}