This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Make tls_mask unsigned in elf32-ppc.c
- From: Alan Modra <amodra at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 21 Mar 2018 11:14:50 -0000
- Subject: [binutils-gdb] Make tls_mask unsigned in elf32-ppc.c
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bac3c8c5e7fb88ddb3615b895ad57847b9842171
commit bac3c8c5e7fb88ddb3615b895ad57847b9842171
Author: Alan Modra <amodra@gmail.com>
Date: Mon Mar 19 20:14:05 2018 +1030
Make tls_mask unsigned in elf32-ppc.c
* elf32-ppc.c (struct ppc_elf_link_hash_entry): Make tls_mask
field unsigned.
(update_local_sym_info): Likewise for local_got_tls_masks.
(ppc_elf_tls_optimize): Likewise for lgot_masks.
Diff:
---
bfd/ChangeLog | 7 +++++++
bfd/elf32-ppc.c | 13 +++++++------
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2493668..646bb4f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,12 @@
2018-03-21 Alan Modra <amodra@gmail.com>
+ * elf32-ppc.c (struct ppc_elf_link_hash_entry): Make tls_mask
+ field unsigned.
+ (update_local_sym_info): Likewise for local_got_tls_masks.
+ (ppc_elf_tls_optimize): Likewise for lgot_masks.
+
+2018-03-21 Alan Modra <amodra@gmail.com>
+
* elf64-ppc.c (ppc_size_one_stub): Fix comment typo.
(ppc64_elf_layout_multitoc): Allocate relocs for tprel as we
do in size_dynamic_sections.
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 182dc2a..e0456b8 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -3238,7 +3238,7 @@ struct ppc_elf_link_hash_entry
#define TLS_TLS 16 /* Any TLS reloc. */
#define TLS_TPRELGD 32 /* TPREL reloc resulting from GD->IE. */
#define PLT_IFUNC 64 /* STT_GNU_IFUNC. */
- char tls_mask;
+ unsigned char tls_mask;
/* Nonzero if we have seen a small data relocation referring to this
symbol. */
@@ -3844,7 +3844,7 @@ update_local_sym_info (bfd *abfd,
{
bfd_signed_vma *local_got_refcounts = elf_local_got_refcounts (abfd);
struct plt_entry **local_plt;
- char *local_got_tls_masks;
+ unsigned char *local_got_tls_masks;
if (local_got_refcounts == NULL)
{
@@ -3860,7 +3860,7 @@ update_local_sym_info (bfd *abfd,
}
local_plt = (struct plt_entry **) (local_got_refcounts + symtab_hdr->sh_info);
- local_got_tls_masks = (char *) (local_plt + symtab_hdr->sh_info);
+ local_got_tls_masks = (unsigned char *) (local_plt + symtab_hdr->sh_info);
local_got_tls_masks[r_symndx] |= tls_type;
if (tls_type != PLT_IFUNC)
local_got_refcounts[r_symndx] += 1;
@@ -5212,7 +5212,7 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED,
enum elf_ppc_reloc_type r_type;
unsigned long r_symndx;
struct elf_link_hash_entry *h = NULL;
- char *tls_mask;
+ unsigned char *tls_mask;
char tls_set, tls_clear;
bfd_boolean is_local;
bfd_signed_vma *got_count;
@@ -5368,7 +5368,7 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED,
{
bfd_signed_vma *lgot_refs;
struct plt_entry **local_plt;
- char *lgot_masks;
+ unsigned char *lgot_masks;
if (locsyms == NULL)
{
@@ -5389,7 +5389,8 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED,
abort ();
local_plt = (struct plt_entry **)
(lgot_refs + symtab_hdr->sh_info);
- lgot_masks = (char *) (local_plt + symtab_hdr->sh_info);
+ lgot_masks = (unsigned char *)
+ (local_plt + symtab_hdr->sh_info);
tls_mask = &lgot_masks[r_symndx];
got_count = &lgot_refs[r_symndx];
}