History

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.

Siddharth Nayyar committed 7 months ago

Commit 16d0e041 parent 97433112 files · +15 −0Browse files

Showing the changes to scripts (1 of 2 files). Show all

Unified · Split

scripts/mod/modpost.c+8−0
@@ -244,6 +244,11 @@ static struct symbol *alloc_symbol(const char *name) · 243 unmodified lines
244 return s;244 return s;
245}245}
246 246
247static uint8_t get_symbol_flags(const struct symbol *sym)
248{
249 return sym->is_gpl_only ? KSYM_FLAG_GPL_ONLY : 0;
250}
251
247/* For the hash of exported symbols */252/* For the hash of exported symbols */
248static void hash_add_symbol(struct symbol *sym)253static void hash_add_symbol(struct symbol *sym)
249{254{
@@ -1874,6 +1879,9 @@ static void add_exported_symbols(struct buffer *buf, struct module *mod) · 1624 unmodified lines
1874 buf_printf(buf, "KSYMTAB_%s(%s, \"%s\", \"%s\");\n",1879 buf_printf(buf, "KSYMTAB_%s(%s, \"%s\", \"%s\");\n",
1875 sym->is_func ? "FUNC" : "DATA", sym->name,1880 sym->is_func ? "FUNC" : "DATA", sym->name,
1876 sym->is_gpl_only ? "_gpl" : "", sym->namespace);1881 sym->is_gpl_only ? "_gpl" : "", sym->namespace);
1882
1883 buf_printf(buf, "SYMBOL_FLAGS(%s, 0x%02x);\n",
1884 sym->name, get_symbol_flags(sym));
1877 }1885 }
1878 1886
1879 if (!modversions)1887 if (!modversions)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t