[PATCH 2/7] scripts: modpost: increase buf_printf's buffer size

From: Alexandre Courbot

Date: Thu Apr 30 2026 - 10:58:52 EST


Rust tends to produce long symbol names; when trying to export symbols
from nova-core for nova-drm to link to, the 500 bytes of the internal
buffer used for symbol name formatting are not enough, making modpost
fail.

Fix this by increasing the size of the buffer used to format the symbols
to 1024 bytes. It is a stack buffer, but modpost is a user-space program
so that shouldn't be a problem.

Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
---
scripts/mod/modpost.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 16f6bc20b058..2ab7aa6edcb4 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1674,7 +1674,7 @@ static void read_symbols_from_files(const char *filename)
fclose(in);
}

-#define SZ 500
+#define SZ 1024

/* We first write the generated file into memory using the
* following helper, then compare to the file on disk and

--
2.54.0