diff options
author | Alan Modra <amodra@gmail.com> | 2019-07-18 10:31:44 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2019-07-18 22:17:29 +0930 |
commit | 0b1474281c659919d9c63ccfd6891b9e9ed0fc9c (patch) | |
tree | f1c1869b254ebdeb28533461ef1b9bc5d988257b /bfd/elf64-ppc.c | |
parent | d0044bac9eb6c5476d29c41872bcf8f74a990d4f (diff) | |
download | gdb-0b1474281c659919d9c63ccfd6891b9e9ed0fc9c.zip gdb-0b1474281c659919d9c63ccfd6891b9e9ed0fc9c.tar.gz gdb-0b1474281c659919d9c63ccfd6891b9e9ed0fc9c.tar.bz2 |
[PowerPC64] correct tprel offset limit
I don't expect anyone will have hit this bug. You'd need a TLS
segment of 2G before you'd notice.
* elf64-ppc.c (ppc64_elf_tls_optimize): Correct test for allowed
range of tp-relative offsets.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r-- | bfd/elf64-ppc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index d77cfdf..9d3ba36 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -7734,9 +7734,8 @@ ppc64_elf_tls_optimize (struct bfd_link_info *info) { value += sym_sec->output_offset; value += sym_sec->output_section->vma; - value -= htab->elf.tls_sec->vma; - ok_tprel = (value + TP_OFFSET + ((bfd_vma) 1 << 31) - < (bfd_vma) 1 << 32); + value -= htab->elf.tls_sec->vma + TP_OFFSET; + ok_tprel = value + 0x80008000ULL < 1ULL << 32; } } |