Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

module: populate kflagstab in modpost

This patch adds the ability to create entries for kernel symbol flag
bitsets in kflagstab. Modpost populates only the GPL-only flag for now.

Signed-off-by: Siddharth Nayyar <sidnayyar@google.com>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>

authored by

Siddharth Nayyar and committed by
Sami Tolvanen
16d0e04f 9743311b

+15
+7
include/linux/export-internal.h
··· 69 69 ".long " #crc "\n" \ 70 70 ".previous" "\n") 71 71 72 + #define SYMBOL_FLAGS(sym, flags) \ 73 + asm(" .section \"___kflagstab+" #sym "\",\"a\"" "\n" \ 74 + "__flags_" #sym ":" "\n" \ 75 + " .byte " #flags "\n" \ 76 + " .previous" "\n" \ 77 + ) 78 + 72 79 #endif /* __LINUX_EXPORT_INTERNAL_H__ */
+8
scripts/mod/modpost.c
··· 244 244 return s; 245 245 } 246 246 247 + static uint8_t get_symbol_flags(const struct symbol *sym) 248 + { 249 + return sym->is_gpl_only ? KSYM_FLAG_GPL_ONLY : 0; 250 + } 251 + 247 252 /* For the hash of exported symbols */ 248 253 static void hash_add_symbol(struct symbol *sym) 249 254 { ··· 1879 1874 buf_printf(buf, "KSYMTAB_%s(%s, \"%s\", \"%s\");\n", 1880 1875 sym->is_func ? "FUNC" : "DATA", sym->name, 1881 1876 sym->is_gpl_only ? "_gpl" : "", sym->namespace); 1877 + 1878 + buf_printf(buf, "SYMBOL_FLAGS(%s, 0x%02x);\n", 1879 + sym->name, get_symbol_flags(sym)); 1882 1880 } 1883 1881 1884 1882 if (!modversions)