/* 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;
}
struct unaligned_uint32
{
} __attribute__ ((packed));
static void
{
struct unaligned_uint32 *p;
switch (addr & 3)
{
case 0:
break;
case 1:
break;
case 2:
break;
}
}
static grub_uint32_t
{
low = (a & 0x00007f);
return (c & 0x7f) | ((c << 7) & 0x7fc000) | ((c >> 7) & 0x0003e00); //0x003e00
}
static void
{
struct unaligned_uint32 *p;
switch (addr & 3)
{
case 0:
p->val = ((add_value_to_slot_21_real (((p->val >> 2) & MASKF21), value) & MASKF21) << 2) | (p->val & ~(MASKF21 << 2));
break;
case 1:
p->val = ((add_value_to_slot_21_real (((p->val >> 3) & MASKF21), value) & MASKF21) << 3) | (p->val & ~(MASKF21 << 3));
break;
case 2:
p->val = ((add_value_to_slot_21_real (((p->val >> 4) & MASKF21), value) & MASKF21) << 4) | (p->val & ~(MASKF21 << 4));
break;
}
}
{
/* [MLX] nop.m 0x0 */
0x05, 0x00, 0x00, 0x00, 0x01
};
{
/* ld8 r16=[r15],8 */
0x02, 0x80, 0x20, 0x1e, 0x18, 0x14,
/* mov r14=r1;; */
0xe0, 0x00, 0x04, 0x00, 0x42, 0x00,
/* nop.i 0x0 */
0x00, 0x00, 0x04, 0x00,
/* ld8 r1=[r15] */
0x11, 0x08, 0x00, 0x1e, 0x18, 0x10,
/* mov b6=r16 */
0x60, 0x80, 0x04, 0x80, 0x03, 0x00,
/* br.few b6;; */
0x60, 0x00, 0x80, 0x00
};
struct ia64_trampoline
{
/* nop.m */
/* movl r15 = addr*/
};
static void
{
COMPILE_TIME_ASSERT (sizeof (struct ia64_trampoline)
}
/* 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_IA64_PCREL21B:
{
tr++;
return grub_error (GRUB_ERR_BAD_OS,
"trampoline offset too big (%lx)", noff);
}
break;
case R_IA64_SEGREL64LSB:
break;
case R_IA64_FPTR64LSB:
case R_IA64_DIR64LSB:
break;
case R_IA64_PCREL64LSB:
break;
case R_IA64_GPREL22:
break;
case R_IA64_LTOFF22X:
case R_IA64_LTOFF22:
case R_IA64_LTOFF_FPTR22:
gpptr++;
break;
/* We treat LTOFF22X as LTOFF22, so we can ignore LDXMOV. */
case R_IA64_LDXMOV:
break;
default:
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"this relocation (0x%x) is not implemented yet",
}
}
}
}
return GRUB_ERR_NONE;
}