mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-18 12:16:13 +08:00
aarch64: Fix DT_AARCH64_VARIANT_PCS handling [BZ #26798]
The variant PCS support was ineffective because in the common case
linkmap->l_mach.plt == 0 but then the symbol table flags were ignored
and normal lazy binding was used instead of resolving the relocs early.
(This was a misunderstanding about how GOT[1] is setup by the linker.)
In practice this mainly affects SVE calls when the vector length is
more than 128 bits, then the top bits of the argument registers get
clobbered during lazy binding.
Fixes bug 26798.
(cherry picked from commit 558251bd87
)
This commit is contained in:
parent
2b802d55b7
commit
268df5a910
@ -391,13 +391,6 @@ elf_machine_lazy_rel (struct link_map *map,
|
|||||||
/* Check for unexpected PLT reloc type. */
|
/* Check for unexpected PLT reloc type. */
|
||||||
if (__builtin_expect (r_type == AARCH64_R(JUMP_SLOT), 1))
|
if (__builtin_expect (r_type == AARCH64_R(JUMP_SLOT), 1))
|
||||||
{
|
{
|
||||||
if (map->l_mach.plt == 0)
|
|
||||||
{
|
|
||||||
/* Prelinking. */
|
|
||||||
*reloc_addr += l_addr;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (1) /* DT_AARCH64_VARIANT_PCS is not available, so always check. */
|
if (1) /* DT_AARCH64_VARIANT_PCS is not available, so always check. */
|
||||||
{
|
{
|
||||||
/* Check the symbol table for variant PCS symbols. */
|
/* Check the symbol table for variant PCS symbols. */
|
||||||
@ -421,7 +414,10 @@ elf_machine_lazy_rel (struct link_map *map,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*reloc_addr = map->l_mach.plt;
|
if (map->l_mach.plt == 0)
|
||||||
|
*reloc_addr += l_addr;
|
||||||
|
else
|
||||||
|
*reloc_addr = map->l_mach.plt;
|
||||||
}
|
}
|
||||||
else if (__builtin_expect (r_type == AARCH64_R(TLSDESC), 1))
|
else if (__builtin_expect (r_type == AARCH64_R(TLSDESC), 1))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user