Commit 1ee44470 authored by Muchun Song's avatar Muchun Song Committed by Ingo Molnar

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: default avatarMuchun Song <songmuchun@bytedance.com>
Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent e378fa17
...@@ -1354,8 +1354,8 @@ static void mark_rodata(struct objtool_file *file) ...@@ -1354,8 +1354,8 @@ static void mark_rodata(struct objtool_file *file)
* .rodata.str1.* sections are ignored; they don't contain jump tables. * .rodata.str1.* sections are ignored; they don't contain jump tables.
*/ */
for_each_sec(file, sec) { for_each_sec(file, sec) {
if ((!strncmp(sec->name, ".rodata", 7) && !strstr(sec->name, ".str1.")) || if (!strncmp(sec->name, ".rodata", 7) &&
!strcmp(sec->name, C_JUMP_TABLE_SECTION)) { !strstr(sec->name, ".str1.")) {
sec->rodata = true; sec->rodata = true;
found = true; found = true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment