]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/elf32-nds32.c
Re: MSP430: Support relocations for subtract expressions in .uleb128 directives
[thirdparty/binutils-gdb.git] / bfd / elf32-nds32.c
index 186ab36e89c53eb4f42e866a9860bfe822f55d6d..233af38c2307e1c66dc02d8d5d2cb966e2293420 100644 (file)
@@ -3368,7 +3368,7 @@ nds32_elf_add_symbol_hook (bfd *abfd,
          || ELF_ST_TYPE (sym->st_info) == STT_TLS)
        break;
 
-      /* st_value is the alignemnt constraint.
+      /* st_value is the alignment constraint.
         That might be its actual size if it is an array or structure.  */
       switch (sym->st_value)
        {
@@ -3388,7 +3388,7 @@ nds32_elf_add_symbol_hook (bfd *abfd,
          return TRUE;
        }
 
-      (*secp)->flags |= SEC_IS_COMMON;
+      (*secp)->flags |= SEC_IS_COMMON | SEC_SMALL_DATA;
       *valp = sym->st_size;
       break;
     }
@@ -3696,8 +3696,6 @@ nds32_elf_link_hash_table_create (bfd *abfd)
       return NULL;
     }
 
-  ret->sdynbss = NULL;
-  ret->srelbss = NULL;
   ret->sym_ld_script = NULL;
 
   return &ret->root.root;
@@ -3833,7 +3831,7 @@ nds32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
         initialize them at run time.  The linker script puts the .dynbss
         section into the .bss section of the final image.  */
       s = bfd_make_section (abfd, ".dynbss");
-      htab->sdynbss = s;
+      htab->root.sdynbss = s;
       if (s == NULL
          || !bfd_set_section_flags (s, SEC_ALLOC | SEC_LINKER_CREATED))
        return FALSE;
@@ -3852,7 +3850,7 @@ nds32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
        {
          s = bfd_make_section (abfd, (bed->default_use_rela_p
                                       ? ".rela.bss" : ".rel.bss"));
-         htab->srelbss = s;
+         htab->root.srelbss = s;
          if (s == NULL
              || !bfd_set_section_flags (s, flags | SEC_READONLY)
              || !bfd_set_section_alignment (s, ptralign))
@@ -3988,7 +3986,7 @@ nds32_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
      same memory location for the variable.  */
 
   htab = nds32_elf_hash_table (info);
-  s = htab->sdynbss;
+  s = htab->root.sdynbss;
   BFD_ASSERT (s != NULL);
 
   /* We must generate a R_NDS32_COPY reloc to tell the dynamic linker
@@ -3999,7 +3997,7 @@ nds32_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
     {
       asection *srel;
 
-      srel = htab->srelbss;
+      srel = htab->root.srelbss;
       BFD_ASSERT (srel != NULL);
       srel->size += sizeof (Elf32_External_Rela);
       h->needs_copy = 1;
@@ -7277,7 +7275,8 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
                  void *vpp;
 
                  Elf_Internal_Sym *isym;
-                 isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx);
+                 isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
+                                               abfd, r_symndx);
                  if (isym == NULL)
                    return FALSE;