/* i386 CPU-specific part of loadcore.c for 32-bit mode */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2009 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
/* Check if EHDR is a valid ELF header. */
int
{
Elf32_Ehdr *e = ehdr;
/* Check the magic numbers. */
}
/* Relocate symbols. */
struct grub_efiemu_elf_sym *elfsyms,
void *ehdr)
{
unsigned i;
Elf32_Ehdr *e = ehdr;
Elf32_Shdr *s;
for (i = 0, s = (Elf32_Shdr *) ((char *) e + e->e_shoff);
i < e->e_shnum;
i++, s = (Elf32_Shdr *) ((char *) s + e->e_shentsize))
{
/* Find the target segment. */
break;
if (seg)
{
rel++)
{
return grub_error (GRUB_ERR_BAD_MODULE,
"reloc offset is out of the segment");
addr = (Elf32_Word *)
{
case R_386_32:
if ((err = grub_efiemu_write_value
return err;
break;
case R_386_PC32:
if ((err = grub_efiemu_write_value
return err;
break;
default:
return grub_error (GRUB_ERR_BAD_OS,
"unrecognised relocation");
}
}
}
}
return GRUB_ERR_NONE;
}