From: Muchun Song Date: Sun, 12 Apr 2020 14:44:05 +0000 (+0800) Subject: objtool: Remove redundant .rodata section name comparison X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=1ee444700e960b017558038a9443474e808b0045;p=linux.git 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 Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar --- diff --git a/tools/objtool/check.c b/tools/objtool/check.c index cffa5e357788f..e06a891a4a3b6 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; }