unsigned int i; Elf32_Rel *rel = (void *)sechdrs[relsec].sh_addr; Elf32_Sym *sym; uint32_t *location;  DEBUGP("Applying relocate section %u to %u\n", relsec, sechdrs[relsec].sh_info); for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { /* This is where to make the change */ location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_offset + rel[i].r_offset; /* This is the symbol it is referring to.  Note that all undefined symbols have been resolved.  */ sym = (Elf32_Sym *)sechdrs[symindex].sh_addr + ELF32_R_SYM(rel[i].r_info);  /* We add the value into the location given */ *location += sym->st_value; } return 0; 
printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name); return -ENOEXEC; 
int apply_relocate(Elf32_Shdr *sechdrs,		   const char *strtab,		   unsigned int symindex,		   unsigned int relsec,		   struct module *me){	unsigned int i;	Elf32_Rel *rel = (void *)sechdrs[relsec].sh_addr;	Elf32_Sym *sym;	uint32_t *location;	DEBUGP("Applying relocate section %u to %u\n", relsec,	       sechdrs[relsec].sh_info);	for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {		/* This is where to make the change */		location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_offset			+ rel[i].r_offset;		/* This is the symbol it is referring to.  Note that all		   undefined symbols have been resolved.  */		sym = (Elf32_Sym *)sechdrs[symindex].sh_addr			+ ELF32_R_SYM(rel[i].r_info);                /* We add the value into the location given */                *location += sym->st_value;	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/5d01e6ce785884a5db5792cd2e5bb36fa82fe23c/module.c/buggy/arch/cris/kernel/module.c