mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-29 22:11:18 +00:00
(elf_machine_rela) [r_type == R_ALPHA_REFQUAD]: Use memcpy to load and
store value from relocation address to prevent unaligned trap.
This commit is contained in:
parent
7228f3cac1
commit
22fb102e6b
@ -500,7 +500,12 @@ elf_machine_rela (struct link_map *map,
|
||||
elf_machine_fixup_plt (map, NULL, reloc, reloc_addr, sym_value);
|
||||
else if (r_type == R_ALPHA_REFQUAD)
|
||||
{
|
||||
sym_value += *reloc_addr;
|
||||
void *reloc_addr_1 = reloc_addr;
|
||||
Elf64_Addr reloc_addr_val;
|
||||
|
||||
/* Load value without causing unaligned trap. */
|
||||
memcpy (&reloc_addr_val, reloc_addr_1, 8);
|
||||
sym_value += reloc_addr_val;
|
||||
#ifndef RTLD_BOOTSTRAP
|
||||
if (map == &_dl_rtld_map)
|
||||
{
|
||||
@ -516,7 +521,8 @@ elf_machine_rela (struct link_map *map,
|
||||
sym_value -= reloc->r_addend;
|
||||
}
|
||||
#endif
|
||||
*reloc_addr = sym_value;
|
||||
/* Store value without causing unaligned trap. */
|
||||
memcpy (reloc_addr_1, &sym_value, 8);
|
||||
}
|
||||
else
|
||||
_dl_reloc_bad_type (map, r_type, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user