ANDROID: modpost: add protected exports to vmlinux
Protected exports are placed in the __kexporttab section. Bug: 519119852 Change-Id: Iab22863baefe7c4575604e18ed403aef8ee3b7c5 Signed-off-by: Siddharth Nayyar <sidnayyar@google.com>
This commit is contained in:
1 parent
41d03c973a
commit
2493fa846d
3 files changed
+29
No files matched your search
@@ -1917,6 +1917,21 @@ static void add_exported_symbols(struct buffer *buf, struct module *mod)
|
||||
}
|
||||
}
|
||||
|
||||
static void add_protected_exports(struct buffer *buf)
|
||||
{
|
||||
struct module *mod;
|
||||
struct symbol *sym;
|
||||
|
||||
buf_printf(buf, "\n");
|
||||
list_for_each_entry(mod, &modules, list) {
|
||||
if (mod->protect_exports) {
|
||||
list_for_each_entry(sym, &mod->exported_symbols, list)
|
||||
buf_printf(buf, "PROTECT_EXPORT(%s);\n",
|
||||
sym->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Record CRCs for unresolved symbols, supporting long names
|
||||
*/
|
||||
@@ -2103,6 +2118,7 @@ static void write_vmlinux_export_c_file(struct module *mod)
|
||||
"#include <linux/export-internal.h>\n");
|
||||
|
||||
add_exported_symbols(&buf, mod);
|
||||
add_protected_exports(&buf);
|
||||
|
||||
buf_printf(&buf,
|
||||
"#include <linux/module.h>\n"
|
||||
|
||||
@@ -126,6 +126,7 @@ struct module {
|
||||
bool seen;
|
||||
bool has_init;
|
||||
bool has_cleanup;
|
||||
bool protect_exports;
|
||||
char srcversion[25];
|
||||
// Missing namespace dependencies
|
||||
struct list_head missing_namespaces;
|
||||
|
||||
Reference in new issue
Block a user