This patch adds the ability to create entries for kernel symbol flag bitsets in kflagstab. Modpost populates only the GPL-only flag for now.
Showing the changes to scripts (1 of 2 files). Show all
Unified · Split
| @@ -244,6 +244,11 @@ static struct symbol *alloc_symbol(const char *name) · 243 unmodified lines | ||
| 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 | { |
| @@ -1874,6 +1879,9 @@ static void add_exported_symbols(struct buffer *buf, struct module *mod) · 1624 unmodified lines | ||
| 1874 | 1879 | buf_printf(buf, "KSYMTAB_%s(%s, \"%s\", \"%s\");\n", |
| 1875 | 1880 | sym->is_func ? "FUNC" : "DATA", sym->name, |
| 1876 | 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 | 1887 | if (!modversions) |