Re: [PATCH] compiler.h: Specify correct attribute for .rodata..c_jump_table

From: Tiezhu Yang
Date: Fri Feb 14 2025 - 03:57:20 EST


On 02/14/2025 04:44 PM, Josh Poimboeuf wrote:
On Fri, Feb 14, 2025 at 10:23:08AM +0800, Tiezhu Yang wrote:
I have a draft diff, I will do more test and send it
as a formal patch once the other patches are landed
because this patch depends on them.

Actually since this is a bug fix, I'm thinking it should be merged in
the tip/objtool/urgent branch so it can go in an -rc. Then it should be
trivial for me to rebase your patches on top.

OK, I will send a patch based on tip/objtool/urgent branch ASAP.

The code looks something like this:

Looks good to me. nit: loongarch can use the C_JUMP_TABLE_SECTION
define.

Yes, thank you, hope you can amend it when applying my original patch,
maybe like this:

diff --git a/tools/objtool/arch/loongarch/special.c b/tools/objtool/arch/loongarch/special.c
index 27c6473608f3..e39f86d97002 100644
--- a/tools/objtool/arch/loongarch/special.c
+++ b/tools/objtool/arch/loongarch/special.c
@@ -131,7 +131,7 @@ static struct reloc *find_reloc_of_rodata_c_jump_table(struct section *sec,
if (reloc_offset(reloc) > offset)
break;

- if (!strncmp(reloc->sym->sec->name, ".rodata..c_jump_table", 21)) {
+ if (!strcmp(reloc->sym->sec->name, C_JUMP_TABLE_SECTION)) {
*table_size = 0;
return reloc;
}

Thanks,
Tiezhu