Return std::string from memory_error_message
[deliverable/binutils-gdb.git] / bfd / arc-got.h
index 7c3cfd952d2430e583bcb551776ffb25bf2e0f47..f1f6c0ea81431f3778dbc35f333616997f1cacef 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.
@@ -22,6 +22,8 @@
 #ifndef ARC_GOT_H
 #define ARC_GOT_H
 
+#define TCB_SIZE (8)
+
 enum tls_type_e
 {
   GOT_UNKNOWN = 0,
@@ -318,7 +320,7 @@ relocate_fix_got_relocs_for_got_info (struct got_entry **          list_p,
        }
 
 
-      if (entry && entry->processed == FALSE)
+      if (entry && !entry->processed)
        {
          switch (entry->type)
            {
@@ -334,13 +336,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 +355,23 @@ 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
+                           + (elf_hash_table (info)->dynamic_sections_created ? 0 : TCB_SIZE),
+                           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;
@@ -417,7 +430,7 @@ create_got_dynrelocs_for_single_entry (struct got_entry *list,
   bfd_vma got_offset = list->offset;
 
   if (list->type == GOT_NORMAL
-      && list->created_dyn_relocation == FALSE)
+      && !list->created_dyn_relocation)
     {
       if (bfd_link_pic (info)
          && h != NULL
@@ -436,7 +449,7 @@ create_got_dynrelocs_for_single_entry (struct got_entry *list,
       list->created_dyn_relocation = TRUE;
     }
   else if (list->existing_entries != TLS_GOT_NONE
-          && list->created_dyn_relocation == FALSE)
+          && !list->created_dyn_relocation)
     {
        /* TODO TLS: This is not called for local symbols.
          In order to correctly implement TLS, this should also
@@ -468,8 +481,10 @@ GOT_OFFSET = %#lx, GOT_VMA = %#lx, INDEX = %ld, ADDEND = 0x0\n",
        {
          bfd_vma addend = 0;
          if (list->type == GOT_TLS_IE)
+         {
            addend = bfd_get_32 (output_bfd,
                                 htab->sgot->contents + got_offset);
+         }
 
          ADD_RELA (output_bfd, got,
                    got_offset + (e == TLS_GOT_MOD_AND_OFF ? 4 : 0),
This page took 0.029223 seconds and 4 git commands to generate.