Skip to content

Commit

Permalink
scripts: gen_kobject_list: linker section for _thread_idx_map
Browse files Browse the repository at this point in the history
In some circumstances, _thread_idx_map[] is all zero and the linker
decides to put it into BSS instead of DATA section. This results in
kernel objects being pushed away so the hash table is no longer
valid. This forces _thread_idx_map to be in the data section inside
the intermediate object file so it will be placed in the data
section in final binary.

Fixes zephyrproject-rtos#43618

Signed-off-by: Daniel Leung <[email protected]>
  • Loading branch information
dcpleung committed Mar 15, 2022
1 parent 44feb7d commit 2ef39e9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/gen_kobject_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ def write_gperf_table(fp, syms, objs, little_endian, static_begin, static_end):

# Generate the array of already mapped thread indexes
fp.write('\n')
fp.write('Z_GENERIC_DOT_SECTION(data)\n')
fp.write('uint8_t _thread_idx_map[%d] = {' % (thread_max_bytes))

for i in range(0, thread_max_bytes):
Expand Down

0 comments on commit 2ef39e9

Please sign in to comment.