ANDROID: Only warn on long symbols

Rust symbols frequently exceed the maximum length for a MODVERSIONS
symbol. If this happens, warn and continue rather than erroring out.
This is intended to support testing of the Rust binder driver as a GKI
module.

This change is Android-only because we are pursuing a more complete
strategy upstream, but this is suitable for a GKI-module trial of the
Rust binder driver:

https://lore.kernel.org/rust-for-linux/20240617175818.58219-17-samitolvanen@google.com/T/#t

Bug: 347787665
Change-Id: I5f802760c9060a9b44e1a9e0d6e51e6f278888be
Signed-off-by: Matthew Maurer <mmaurer@google.com>
This commit is contained in:
Matthew Maurer 2024-06-17 18:43:57 +00:00
parent 4a571c32cb
commit b511e79bc5

View File

@ -1960,9 +1960,9 @@ static void add_versions(struct buffer *b, struct module *mod)
continue;
}
if (strlen(s->name) >= MODULE_NAME_LEN) {
error("too long symbol \"%s\" [%s.ko]\n",
s->name, mod->name);
break;
warn("too long symbol \"%s\" [%s.ko]\n",
s->name, mod->name);
continue;
}
buf_printf(b, "\t{ %#8x, \"%s\" },\n",
s->crc, s->name);