On Mon, May 29, 2023 at 9:03 AM HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab@nec.com> wrote:
>
> +                                       for (j = MOD_TEXT; j <
>> MOD_MEM_NUM_TYPES; j++) {
>> +                                               lm->load_symtable[j] =
>> NULL;
>> +                                               lm->load_symend[j] = NULL;
>> +                                       }
>> +                               } else { /* somehow this function runs for
>> unloaded modules */
>>
>
> Could you please explain why it may get into the "else" code path? And why
> do we need to handle this situation for now? But not needed before the
> module memory changes.

This path is used by "mod -d|-D" and reinit_modules() for unloaded modules.

The old procedure always does the cleanup and reinstall of the hash
entries, so kept it as it is.

I tried to add some debug information in the above code path, but did not observe any output(via the mod -d/-D). It's strange.

Thanks.
Lianbo