if (bfd_is_const_section (input_sec))
source = input_sec->name;
else
- source = input_sec->owner->filename;
+ source = bfd_get_filename (input_sec->owner);
fprintf (sym_ld_script, "\t%s = 0x%08lx;\t /* %s */\n",
h->root.root.string,
if (!rz)
{
- printf ("%s: %s @ 0x%08x\n", __func__, ibfd->filename,
+ printf ("%s: %s @ 0x%08x\n", __func__, bfd_get_filename (ibfd),
(int) rel->r_offset);
BFD_ASSERT(0); /* Unsupported pattern. */
}
flagword out_fpu_config;
flagword in_fpu_config;
+ /* FIXME: What should be checked when linking shared libraries? */
+ if ((ibfd->flags & DYNAMIC) != 0)
+ return TRUE;
+
/* TODO: Revise to use object-attributes instead. */
if (!nds32_check_vec_size (ibfd))
return FALSE;
}
finish:
- if (internal_relocs != NULL
- && elf_section_data (sec)->relocs != internal_relocs)
+ if (elf_section_data (sec)->relocs != internal_relocs)
free (internal_relocs);
- if (contents != NULL
- && elf_section_data (sec)->this_hdr.contents != contents)
+ if (elf_section_data (sec)->this_hdr.contents != contents)
free (contents);
- if (isymbuf != NULL && symtab_hdr->contents != (bfd_byte *) isymbuf)
+ if (symtab_hdr->contents != (bfd_byte *) isymbuf)
free (isymbuf);
return result;
{NULL, 0, 0, 0, 0}
};
+static bfd_boolean
+nds32_elf_section_flags (const Elf_Internal_Shdr *hdr)
+{
+ const char *name = hdr->bfd_section->name;
+
+ if (strncmp (name, ".sbss", 5) == 0
+ || strncmp (name, ".sdata", 6) == 0)
+ hdr->bfd_section->flags |= SEC_SMALL_DATA;
+
+ return TRUE;
+}
+
static bfd_boolean
nds32_elf_output_arch_syms (bfd *output_bfd ATTRIBUTE_UNUSED,
struct bfd_link_info *info,
}
while (FALSE);
- if ((relocs != NULL) && (elf_section_data (asec)->relocs != relocs))
+ if (elf_section_data (asec)->relocs != relocs)
free (relocs);
if ((min_id != relax_group_ptr->min_id)
}
while (FALSE);
- if (relocs != NULL && elf_section_data (asec)->relocs != relocs)
+ if (elf_section_data (asec)->relocs != relocs)
free (relocs);
return result;
if (incontents)
contents = NULL;
- if (internal_relocs != NULL
- && elf_section_data (insec)->relocs != internal_relocs)
+ if (elf_section_data (insec)->relocs != internal_relocs)
free (internal_relocs);
- if (contents != NULL
- && elf_section_data (insec)->this_hdr.contents != contents)
+ if (elf_section_data (insec)->this_hdr.contents != contents)
free (contents);
- if (local_syms != NULL && symtab_hdr->contents != (bfd_byte *) local_syms)
+ if (symtab_hdr->contents != (bfd_byte *) local_syms)
free (local_syms);
if (chain.next)
#define elf_backend_object_p nds32_elf_object_p
#define elf_backend_final_write_processing nds32_elf_final_write_processing
#define elf_backend_special_sections nds32_elf_special_sections
+#define elf_backend_section_flags nds32_elf_section_flags
#define bfd_elf32_bfd_get_relocated_section_contents \
nds32_elf_get_relocated_section_contents
#define bfd_elf32_bfd_is_target_special_symbol nds32_elf_is_target_special_symbol