typedef Elf32_Ehdr Elf_Ehdr;
typedef Elf32_Phdr Elf_Phdr;
typedef Elf32_Off Elf_Off;
typedef Elf32_Ehdr Elf_Ehdr;
typedef Elf32_Phdr Elf_Phdr;
typedef Elf32_Off Elf_Off;
/* Check segment lies within image */
if ( ( phdr->p_offset + phdr->p_filesz ) > image->len ) {
DBG ( "ELF segment outside ELF file\n" );
/* Check segment lies within image */
if ( ( phdr->p_offset + phdr->p_filesz ) > image->len ) {
DBG ( "ELF segment outside ELF file\n" );
- copy_user ( buffer, 0, image->data, phdr->p_offset, phdr->p_filesz );
+ memcpy_user ( buffer, 0, image->data, phdr->p_offset, phdr->p_filesz );
/* Read ELF program headers */
for ( phoff = ehdr.e_phoff , phnum = ehdr.e_phnum ; phnum ;
phoff += ehdr.e_phentsize, phnum-- ) {
if ( phoff > image->len ) {
DBG ( "ELF program header %d outside ELF image\n",
phnum );
/* Read ELF program headers */
for ( phoff = ehdr.e_phoff , phnum = ehdr.e_phnum ; phnum ;
phoff += ehdr.e_phentsize, phnum-- ) {
if ( phoff > image->len ) {
DBG ( "ELF program header %d outside ELF image\n",
phnum );
}
copy_from_user ( &phdr, image->data, phoff, sizeof ( phdr ) );
if ( ( rc = elf_load_segment ( image, &phdr ) ) != 0 )
return rc;
}
}
copy_from_user ( &phdr, image->data, phoff, sizeof ( phdr ) );
if ( ( rc = elf_load_segment ( image, &phdr ) ) != 0 )
return rc;
}
- /* Fill in entry point address */
- image->entry = ehdr.e_entry;
- image->execute = elf_execute;
+ /* Record execution entry point in image private data field */
+ image->priv.phys = ehdr.e_entry;