/* MSP430-specific support for 32-bit ELF
- Copyright (C) 2002-2015 Free Software Foundation, Inc.
+ Copyright (C) 2002-2017 Free Software Foundation, Inc.
Contributed by Dmitry Diky <diwil@mail.ru>
This file is part of BFD, the Binary File Descriptor library.
{
if (r_type >= (unsigned int) R_MSP430x_max)
{
+ /* xgettext:c-format */
_bfd_error_handler (_("%B: invalid MSP430X reloc number: %d"), abfd, r_type);
r_type = 0;
}
if (r_type >= (unsigned int) R_MSP430_max)
{
+ /* xgettext:c-format */
_bfd_error_handler (_("%B: invalid MSP430 reloc number: %d"), abfd, r_type);
r_type = 0;
}
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
- if (info->relocatable)
+ if (bfd_link_relocatable (info))
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* PR15323, ref flags aren't set for references in the same
object. */
- h->root.non_ir_ref = 1;
+ h->root.non_ir_ref_regular = 1;
}
}
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
rel, 1, relend, howto, 0, contents);
- if (info->relocatable)
+ if (bfd_link_relocatable (info))
continue;
r = msp430_final_link_relocate (howto, input_bfd, input_section,
switch (r)
{
case bfd_reloc_overflow:
- r = info->callbacks->reloc_overflow
+ (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name,
- (bfd_vma) 0, input_bfd, input_section,
- rel->r_offset);
+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break;
case bfd_reloc_undefined:
- r = info->callbacks->undefined_symbol
- (info, name, input_bfd, input_section, rel->r_offset, TRUE);
+ (*info->callbacks->undefined_symbol)
+ (info, name, input_bfd, input_section, rel->r_offset, TRUE);
break;
case bfd_reloc_outofrange:
}
if (msg)
- r = info->callbacks->warning
- (info, msg, name, input_bfd, input_section, rel->r_offset);
-
- if (!r)
- return FALSE;
+ (*info->callbacks->warning) (info, msg, name, input_bfd,
+ input_section, rel->r_offset);
}
}
/* We don't have to do anything for a relocatable link, if
this section does not have relocs, or if this is not a
code section. */
- if (link_info->relocatable
+ if (bfd_link_relocatable (link_info)
|| (sec->flags & SEC_RELOC) == 0
|| sec->reloc_count == 0 || (sec->flags & SEC_CODE) == 0)
return TRUE;
elf32_msp430_obj_attrs_handle_unknown (bfd *abfd, int tag)
{
_bfd_error_handler
+ /* xgettext:c-format */
(_("Warning: %B: Unknown MSPABI object attribute %d"),
abfd, tag);
return TRUE;
Raise an error if there are conflicting attributes. */
static bfd_boolean
-elf32_msp430_merge_mspabi_attributes (bfd *ibfd, bfd *obfd)
+elf32_msp430_merge_mspabi_attributes (bfd *ibfd, struct bfd_link_info *info)
{
+ bfd *obfd = info->output_bfd;
obj_attribute *in_attr;
obj_attribute *out_attr;
bfd_boolean result = TRUE;
if (in_attr[OFBA_MSPABI_Tag_ISA].i != out_attr[OFBA_MSPABI_Tag_ISA].i)
{
_bfd_error_handler
+ /* xgettext:c-format */
(_("error: %B uses %s instructions but %B uses %s"),
- ibfd, first_input_bfd,
- isa_type (in_attr[OFBA_MSPABI_Tag_ISA].i),
- isa_type (out_attr[OFBA_MSPABI_Tag_ISA].i));
+ ibfd, isa_type (in_attr[OFBA_MSPABI_Tag_ISA].i),
+ first_input_bfd, isa_type (out_attr[OFBA_MSPABI_Tag_ISA].i));
result = FALSE;
}
out_attr[OFBA_MSPABI_Tag_Code_Model].i)
{
_bfd_error_handler
+ /* xgettext:c-format */
(_("error: %B uses the %s code model whereas %B uses the %s code model"),
- ibfd, first_input_bfd,
- code_model (in_attr[OFBA_MSPABI_Tag_Code_Model].i),
- code_model (out_attr[OFBA_MSPABI_Tag_Code_Model].i));
+ ibfd, code_model (in_attr[OFBA_MSPABI_Tag_Code_Model].i),
+ first_input_bfd, code_model (out_attr[OFBA_MSPABI_Tag_Code_Model].i));
result = FALSE;
}
&& out_attr[OFBA_MSPABI_Tag_ISA].i != 2)
{
_bfd_error_handler
+ /* xgettext:c-format */
(_("error: %B uses the large code model but %B uses MSP430 instructions"),
ibfd, first_input_bfd);
result = FALSE;
out_attr[OFBA_MSPABI_Tag_Data_Model].i)
{
_bfd_error_handler
+ /* xgettext:c-format */
(_("error: %B uses the %s data model whereas %B uses the %s data model"),
- ibfd, first_input_bfd,
- data_model (in_attr[OFBA_MSPABI_Tag_Data_Model].i),
- data_model (out_attr[OFBA_MSPABI_Tag_Data_Model].i));
+ ibfd, data_model (in_attr[OFBA_MSPABI_Tag_Data_Model].i),
+ first_input_bfd, data_model (out_attr[OFBA_MSPABI_Tag_Data_Model].i));
result = FALSE;
}
&& out_attr[OFBA_MSPABI_Tag_Data_Model].i != 1)
{
_bfd_error_handler
+ /* xgettext:c-format */
(_("error: %B uses the small code model but %B uses the %s data model"),
ibfd, first_input_bfd,
data_model (out_attr[OFBA_MSPABI_Tag_Data_Model].i));
&& out_attr[OFBA_MSPABI_Tag_ISA].i != 2)
{
_bfd_error_handler
+ /* xgettext:c-format */
(_("error: %B uses the %s data model but %B only uses MSP430 instructions"),
- ibfd, first_input_bfd,
- data_model (in_attr[OFBA_MSPABI_Tag_Data_Model].i));
+ ibfd, data_model (in_attr[OFBA_MSPABI_Tag_Data_Model].i),
+ first_input_bfd);
result = FALSE;
}
object file when linking. */
static bfd_boolean
-elf32_msp430_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
+elf32_msp430_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
+ bfd *obfd = info->output_bfd;
/* Make sure that the machine number reflects the most
advanced version of the MSP architecture required. */
#define max(a,b) ((a) > (b) ? (a) : (b))
max (bfd_get_mach (ibfd), bfd_get_mach (obfd)));
#undef max
- return elf32_msp430_merge_mspabi_attributes (ibfd, obfd);
+ return elf32_msp430_merge_mspabi_attributes (ibfd, info);
}
static bfd_boolean
}
static unsigned int
-elf32_msp430_eh_frame_address_size (bfd *abfd, asection *sec ATTRIBUTE_UNUSED)
+elf32_msp430_eh_frame_address_size (bfd *abfd,
+ const asection *sec ATTRIBUTE_UNUSED)
{
return uses_large_model (abfd) ? 4 : 2;
}
{ NULL, 0, 0, 0, 0 }
};
+#undef elf_backend_special_sections
+#define elf_backend_special_sections msp430_ti_elf_special_sections
+
#include "elf32-target.h"