/* ADI Blackfin BFD support for 32-bit ELF.
- Copyright (C) 2005-2019 Free Software Foundation, Inc.
+ Copyright (C) 2005-2020 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#include "elf/bfin.h"
#include "dwarf2.h"
#include "hashtab.h"
+#include "elf32-bfin.h"
/* FUNCTION : bfin_pltpc_reloc
ABSTRACT : TODO : figure out how to handle pltpc relocs. */
bfinfdpic_elf_link_hash_table_create (bfd *abfd)
{
struct bfinfdpic_elf_link_hash_table *ret;
- bfd_size_type amt = sizeof (struct bfinfdpic_elf_link_hash_table);
+ size_t amt = sizeof (struct bfinfdpic_elf_link_hash_table);
ret = bfd_zmalloc (amt);
if (ret == NULL)
input file basename is crt0.o only once. */
if (silence_segment_error == 1)
silence_segment_error =
- (strlen (input_bfd->filename) == 6
- && filename_cmp (input_bfd->filename, "crt0.o") == 0)
- || (strlen (input_bfd->filename) > 6
- && filename_cmp (input_bfd->filename
- + strlen (input_bfd->filename) - 7,
+ (strlen (bfd_get_filename (input_bfd)) == 6
+ && filename_cmp (bfd_get_filename (input_bfd), "crt0.o") == 0)
+ || (strlen (bfd_get_filename (input_bfd)) > 6
+ && filename_cmp (bfd_get_filename (input_bfd)
+ + strlen (bfd_get_filename (input_bfd)) - 7,
"/crt0.o") == 0)
? -1 : 0;
#endif
flagword old_flags, new_flags;
bfd_boolean error = FALSE;
+ /* FIXME: What should be checked when linking shared libraries? */
+ if ((ibfd->flags & DYNAMIC) != 0)
+ return TRUE;
+
new_flags = elf_elfheader (ibfd)->e_flags;
old_flags = elf_elfheader (obfd)->e_flags;
bfin_link_hash_table_create (bfd * abfd)
{
struct bfin_link_hash_table *ret;
- bfd_size_type amt = sizeof (struct bfin_link_hash_table);
+ size_t amt = sizeof (struct bfin_link_hash_table);
ret = bfd_zmalloc (amt);
if (ret == NULL)
strncpy ((char *) p + 4, targetsec->output_section->name, 8);
}
- if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf)
+ if (symtab_hdr->contents != (unsigned char *) isymbuf)
free (isymbuf);
- if (internal_relocs != NULL
- && elf_section_data (datasec)->relocs != internal_relocs)
+ if (elf_section_data (datasec)->relocs != internal_relocs)
free (internal_relocs);
return TRUE;
-error_return:
- if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf)
+ error_return:
+ if (symtab_hdr->contents != (unsigned char *) isymbuf)
free (isymbuf);
- if (internal_relocs != NULL
- && elf_section_data (datasec)->relocs != internal_relocs)
+ if (elf_section_data (datasec)->relocs != internal_relocs)
free (internal_relocs);
return FALSE;
}