mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	module: Overwrite st_size instead of st_info
st_info is currently overwritten after relocation and used to store the elf_type(). However, we're going to need it fix kallsyms on ARM's Thumb-2 kernels, so preserve st_info and overwrite the st_size field instead. st_size is neither used by the module core nor by any architecture. Reviewed-by: Miroslav Benes <mbenes@suse.cz> Reviewed-by: Dave Martin <Dave.Martin@arm.com> Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Signed-off-by: Jessica Yu <jeyu@kernel.org>
This commit is contained in:
		
							parent
							
								
									2d25bc5523
								
							
						
					
					
						commit
						5439c985c5
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -2684,7 +2684,7 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
 | 
			
		|||
 | 
			
		||||
	/* Set types up while we still have access to sections. */
 | 
			
		||||
	for (i = 0; i < mod->kallsyms->num_symtab; i++)
 | 
			
		||||
		mod->kallsyms->symtab[i].st_info
 | 
			
		||||
		mod->kallsyms->symtab[i].st_size
 | 
			
		||||
			= elf_type(&mod->kallsyms->symtab[i], info);
 | 
			
		||||
 | 
			
		||||
	/* Now populate the cut down core kallsyms for after init. */
 | 
			
		||||
| 
						 | 
				
			
			@ -4070,7 +4070,7 @@ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
 | 
			
		|||
		kallsyms = rcu_dereference_sched(mod->kallsyms);
 | 
			
		||||
		if (symnum < kallsyms->num_symtab) {
 | 
			
		||||
			*value = kallsyms->symtab[symnum].st_value;
 | 
			
		||||
			*type = kallsyms->symtab[symnum].st_info;
 | 
			
		||||
			*type = kallsyms->symtab[symnum].st_size;
 | 
			
		||||
			strlcpy(name, kallsyms_symbol_name(kallsyms, symnum), KSYM_NAME_LEN);
 | 
			
		||||
			strlcpy(module_name, mod->name, MODULE_NAME_LEN);
 | 
			
		||||
			*exported = is_exported(name, *value, mod);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue