diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2020-10-22 17:55:01 +0100 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2020-11-04 12:29:39 +0000 |
commit | d81114e0aaedc30d82956d3a21ae6777b3fbba3c (patch) | |
tree | 7877f66410b4eaa42ddc06e4fade16abfe332d10 /sysdeps/aarch64 | |
parent | e5dac996b9c5541d5c677565d4102566734202c4 (diff) | |
download | glibc-d81114e0aaedc30d82956d3a21ae6777b3fbba3c.tar.gz glibc-d81114e0aaedc30d82956d3a21ae6777b3fbba3c.tar.xz glibc-d81114e0aaedc30d82956d3a21ae6777b3fbba3c.zip |
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 558251bd8785760ad40fcbfeaaee5d27fa5b0fe4)
Diffstat (limited to 'sysdeps/aarch64')
-rw-r--r-- | sysdeps/aarch64/dl-machine.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h index 9617cb754f..c7ae423417 100644 --- a/sysdeps/aarch64/dl-machine.h +++ b/sysdeps/aarch64/dl-machine.h @@ -388,13 +388,6 @@ elf_machine_lazy_rel (struct link_map *map, /* Check for unexpected PLT reloc type. */ 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. */ { /* Check the symbol table for variant PCS symbols. */ @@ -418,7 +411,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)) { |