Fix compile time warnings about using possibly uninitialised variables in rs6000...
[deliverable/binutils-gdb.git] / bfd / arc-got.h
index 00deb01f4b10f5741dfad0ee700383765afc6122..abf3815bbebd228ee2b98fe34fd79d5a68d3e0ad 100644 (file)
@@ -1,5 +1,5 @@
 /* ARC-specific support for 32-bit ELF
-   Copyright (C) 1994-2016 Free Software Foundation, Inc.
+   Copyright (C) 1994-2017 Free Software Foundation, Inc.
    Contributed by Cupertino Miranda (cmiranda@synopsys.com).
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -334,13 +334,15 @@ relocate_fix_got_relocs_for_got_info (struct got_entry **          list_p,
                               ? 4 : 0));
 
                ARC_DEBUG ("arc_info: FIXED -> %s value = %#lx "
-                          "@ %p, for symbol %s\n",
+                          "@ %lx, for symbol %s\n",
                           (entry->type == GOT_TLS_GD ? "GOT_TLS_GD" :
                            "GOT_TLS_IE"),
                           (long) (sym_value - sec_vma),
-                          htab->sgot->contents + entry->offset
-                          + (entry->existing_entries == TLS_GOT_MOD_AND_OFF
-                             ? 4 : 0),
+                          (long) (htab->sgot->output_section->vma
+                             + htab->sgot->output_offset->vma
+                             + entry->offset
+                             + (entry->existing_entries == TLS_GOT_MOD_AND_OFF
+                                ? 4 : 0)),
                           symbol_name);
              }
              break;
@@ -351,14 +353,22 @@ relocate_fix_got_relocs_for_got_info (struct got_entry **          list_p,
                bfd_vma ATTRIBUTE_UNUSED sec_vma
                  = tls_sec->output_section->vma;
 
+               bfd_put_32 (output_bfd,
+                           sym_value - sec_vma,
+                           htab->sgot->contents + entry->offset
+                           + (entry->existing_entries == TLS_GOT_MOD_AND_OFF
+                              ? 4 : 0));
+
                ARC_DEBUG ("arc_info: FIXED -> %s value = %#lx "
                           "@ %p, for symbol %s\n",
                           (entry->type == GOT_TLS_GD ? "GOT_TLS_GD" :
                            "GOT_TLS_IE"),
                           (long) (sym_value - sec_vma),
-                          htab->sgot->contents + entry->offset
-                          + (entry->existing_entries == TLS_GOT_MOD_AND_OFF
-                             ? 4 : 0),
+                          (long) (htab->sgot->output_section->vma
+                             + htab->sgot->output_offset->vma
+                             + entry->offset
+                             + (entry->existing_entries == TLS_GOT_MOD_AND_OFF
+                                ? 4 : 0)),
                           symbol_name);
              }
              break;
@@ -369,12 +379,21 @@ relocate_fix_got_relocs_for_got_info (struct got_entry **          list_p,
                  = reloc_data->sym_section->output_section->vma
                  + reloc_data->sym_section->output_offset;
 
-               if (h->root.type != bfd_link_hash_undefweak)
+               if (h != NULL
+                   && h->root.type == bfd_link_hash_undefweak)
+                 ARC_DEBUG ("arc_info: PATCHED: NOT_PATCHED "
+                            "@ %#08lx for sym %s in got offset %#lx "
+                            "(is undefweak)\n",
+                            (long) (htab->sgot->output_section->vma
+                                    + htab->sgot->output_offset
+                                    + entry->offset),
+                            symbol_name,
+                            (long) entry->offset);
+               else
                  {
                    bfd_put_32 (output_bfd,
                                reloc_data->sym_value + sec_vma,
                                htab->sgot->contents + entry->offset);
-
                    ARC_DEBUG ("arc_info: PATCHED: %#08lx "
                               "@ %#08lx for sym %s in got offset %#lx\n",
                               (long) (reloc_data->sym_value + sec_vma),
@@ -383,17 +402,6 @@ relocate_fix_got_relocs_for_got_info (struct got_entry **          list_p,
                               symbol_name,
                               (long) entry->offset);
                  }
-               else
-                 {
-                   ARC_DEBUG ("arc_info: PATCHED: NOT_PATCHED "
-                              "@ %#08lx for sym %s in got offset %#lx "
-                              "(is undefweak)\n",
-                              (long) (htab->sgot->output_section->vma
-                                      + htab->sgot->output_offset
-                                      + entry->offset),
-                              symbol_name,
-                              (long) entry->offset);
-                 }
              }
              break;
            default:
This page took 0.024545 seconds and 4 git commands to generate.