Browse Source

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 <Ilya.Tagunov@synopsys.com>
pull/82028/head
Ilya Tagunov 7 months ago committed by Anas Nashif
parent
commit
3068f668d9
  1. 3
      scripts/build/process_gperf.py

3
scripts/build/process_gperf.py

@ -126,6 +126,9 @@ def process_line(line, fp): @@ -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)

Loading…
Cancel
Save