core: Allow sizing the loader hash table
For now this will only apply to the dwarf loader, for experimenting as time passes and kernels grow bigger or with more symbols. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
3068ff36b7
commit
ff7bd7083f
|
@ -3042,6 +3042,21 @@ static int dwarf__load_file(struct cus *cus, struct conf_load *conf,
|
|||
{
|
||||
int fd, err;
|
||||
|
||||
if (conf->max_hashtable_bits != 0) {
|
||||
if (conf->max_hashtable_bits > 31)
|
||||
return -E2BIG;
|
||||
|
||||
max_hashtags__bits = conf->max_hashtable_bits;
|
||||
}
|
||||
|
||||
if (conf->hashtable_bits != 0) {
|
||||
if (conf->hashtable_bits > max_hashtags__bits)
|
||||
return -E2BIG;
|
||||
|
||||
hashtags__bits = conf->hashtable_bits;
|
||||
} else if (hashtags__bits > max_hashtags__bits)
|
||||
return -EINVAL;
|
||||
|
||||
elf_version(EV_CURRENT);
|
||||
|
||||
fd = open(filename, O_RDONLY);
|
||||
|
|
Loading…
Reference in New Issue