From 3068f668d90d33297d27e6112194e6b4a245aa9e Mon Sep 17 00:00:00 2001 From: Ilya Tagunov Date: Tue, 26 Nov 2024 22:05:51 +0000 Subject: [PATCH] scripts: process_gperf: upgrade the asso_values type to unsigned short The gperf tool automatically selects the optimal data type for the asso_values table, depending on MAX_HASH_VALUE. However, there is a corner case when the tables generated on different stages of the build process have different data types, causing a link-time error. Upgrade the data type for the table from unsigned char to unsigned short to at least exclude this 8-bit to 16-bit transition. There is another potential issue with the 16-bit to 32-bit transition, but it seems not very likely to have 65k kernel objects anytime soon. Signed-off-by: Ilya Tagunov --- scripts/build/process_gperf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/build/process_gperf.py b/scripts/build/process_gperf.py index 95bbd244dc7..fda3f149d1a 100755 --- a/scripts/build/process_gperf.py +++ b/scripts/build/process_gperf.py @@ -126,6 +126,9 @@ def process_line(line, fp): # and just turn them into pointers line = re.sub(r'["].*["]', reformat_str, line) + # Use a bigger data type for the asso_values table to provide some margin + line = re.sub(r'char asso_values', r'short asso_values', line) + fp.write(line)