/* dl.c - arch-dependent part of loadable module support */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2004,2005,2007,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. */
{
/* Check the magic numbers. */
return GRUB_ERR_NONE;
}
void
{
const Elf_Shdr *s;
unsigned i;
*tramp = 0;
*got = 0;
/* Find a symbol table. */
i < e->e_shnum;
i++, s = (const Elf_Shdr *) ((const char *) s + e->e_shentsize))
if (s->sh_type == SHT_SYMTAB)
break;
if (i == e->e_shnum)
return;
i < e->e_shnum;
i++, s = (const Elf_Shdr *) ((const char *) s + e->e_shentsize))
{
rel++)
(*tramp)++;
}
return;
}
/* For low-endian reverse lis and addr_high as well as ori and addr_low. */
struct trampoline
{
};
{
0x3c000000,
0x60000000,
0x7c0903a6,
0x4e800420,
};
/* Relocate symbols. */
{
Elf_Shdr *s;
unsigned i;
/* Find a symbol table. */
i < e->e_shnum;
i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize))
if (s->sh_type == SHT_SYMTAB)
break;
if (i == e->e_shnum)
entsize = s->sh_entsize;
i < e->e_shnum;
i++, s = (Elf_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");
/* On the PPC the value does not have an explicit
addend, add it. */
{
case R_PPC_ADDR16_LO:
break;
case R_PPC_REL24:
{
{
COMPILE_TIME_ASSERT (sizeof (struct trampoline)
sizeof (*tptr));
tptr++;
}
return grub_error (GRUB_ERR_BAD_MODULE,
"relocation overflow");
break;
}
case R_PPC_ADDR16_HA:
break;
case R_PPC_ADDR32:
break;
case R_PPC_REL32:
break;
default:
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"this relocation (%d) is not implemented yet",
}
}
}
}
return GRUB_ERR_NONE;
}