mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
modpost: add support for symbol namespaces
Add support for symbols that are exported into namespaces. For that, extract any namespace suffix from the symbol name. In addition, emit a warning whenever a module refers to an exported symbol without explicitly importing the namespace that it is defined in. This patch consistently adds the namespace suffix to symbol names exported into Module.symvers. Example warning emitted by modpost in case of the above violation: WARNING: module ums-usbat uses symbol usb_stor_resume from namespace USB_STORAGE, but does not import it. Co-developed-by: Martijn Coenen <maco@android.com> Signed-off-by: Martijn Coenen <maco@android.com> Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Matthias Maennich <maennich@google.com> Signed-off-by: Jessica Yu <jeyu@kernel.org>
This commit is contained in:
committed by
Jessica Yu
parent
8651ec01da
commit
cb9b55d21f
@@ -109,6 +109,11 @@ buf_printf(struct buffer *buf, const char *fmt, ...);
|
||||
void
|
||||
buf_write(struct buffer *buf, const char *s, int len);
|
||||
|
||||
struct namespace_list {
|
||||
struct namespace_list *next;
|
||||
char namespace[0];
|
||||
};
|
||||
|
||||
struct module {
|
||||
struct module *next;
|
||||
const char *name;
|
||||
@@ -121,6 +126,8 @@ struct module {
|
||||
struct buffer dev_table_buf;
|
||||
char srcversion[25];
|
||||
int is_dot_o;
|
||||
// Actual imported namespaces
|
||||
struct namespace_list *imported_namespaces;
|
||||
};
|
||||
|
||||
struct elf_info {
|
||||
|
Reference in New Issue
Block a user