/* Warn if different flags. */
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: uses different e_flags (0x%lx) fields than "
- "previous modules (0x%lx)"),
- ibfd, (long) in_flags, (long) out_flags);
+ (_("%B: uses different e_flags (%#x) fields than "
+ "previous modules (%#x)"),
+ ibfd, in_flags, out_flags);
if (in_flags && out_flags)
return FALSE;
/* MWDT doesnt set the eflags hence make sure we choose the
if (reloc_data.reloc_addend == 0)
_bfd_error_handler
/* xgettext:c-format */
- (_("%B(%A+0x%lx): CMEM relocation to `%s' is invalid, "
- "16 MSB should be 0x%04x (value is 0x%lx)"),
+ (_("%B(%A+%#Lx): CMEM relocation to `%s' is invalid, "
+ "16 MSB should be %#x (value is %#Lx)"),
reloc_data.input_section->owner,
reloc_data.input_section,
reloc_data.reloc_offset,
reloc_data.symbol_name,
NPS_CMEM_HIGH_VALUE,
- (relocation));
+ relocation);
else
_bfd_error_handler
/* xgettext:c-format */
- (_("%B(%A+0x%lx): CMEM relocation to `%s+0x%lx' is invalid, "
- "16 MSB should be 0x%04x (value is 0x%lx)"),
+ (_("%B(%A+%#Lx): CMEM relocation to `%s+%#Lx' is invalid, "
+ "16 MSB should be %#x (value is %#Lx)"),
reloc_data.input_section->owner,
reloc_data.input_section,
reloc_data.reloc_offset,
reloc_data.symbol_name,
reloc_data.reloc_addend,
NPS_CMEM_HIGH_VALUE,
- (relocation));
+ relocation);
return bfd_reloc_overflow;
}
break;
+ (reloc_data.reloc_offset))))
#define SECTSTART (bfd_signed_vma) (reloc_data.sym_section->output_section->vma \
+ reloc_data.sym_section->output_offset)
-
+#define JLI (bfd_signed_vma) (reloc_data.sym_section->output_section->vma)
#define _SDA_BASE_ (bfd_signed_vma) (reloc_data.sdata_begin_symbol_vma)
#define TLS_REL (bfd_signed_vma) \
((elf_hash_table (info))->tls_sec->output_section->vma)
#undef P
#undef SECTSTAR
#undef SECTSTART
+#undef JLI
#undef _SDA_BASE_
#undef none
const Elf_Internal_Rela * rel_end;
bfd * dynobj;
asection * sreloc = NULL;
+ struct elf_link_hash_table * htab = elf_hash_table (info);
if (bfd_link_relocatable (info))
return TRUE;
+ if (htab->dynobj == NULL)
+ htab->dynobj = abfd;
+
dynobj = (elf_hash_table (info))->dynobj;
symtab_hdr = &((elf_tdata (abfd))->symtab_hdr);
sym_hashes = elf_sym_hashes (abfd);
}
howto = arc_elf_howto (r_type);
- if (dynobj == NULL
- && (is_reloc_for_GOT (howto)
- || is_reloc_for_TLS (howto)))
- {
- dynobj = elf_hash_table (info)->dynobj = abfd;
- if (! _bfd_elf_create_got_section (abfd, info))
- return FALSE;
- }
-
/* Load symbol information. */
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info) /* Is a local symbol. */
{
if (sreloc == NULL)
{
+ if (info->dynamic
+ && ! htab->dynamic_sections_created
+ && ! _bfd_elf_link_create_dynamic_sections (abfd, info))
+ return FALSE;
sreloc = _bfd_elf_make_dynamic_reloc_section (sec, dynobj,
2, abfd,
/*rela*/
if (is_reloc_for_GOT (howto)
|| is_reloc_for_TLS (howto))
{
+ if (! _bfd_elf_create_got_section (dynobj, info))
+ return FALSE;
+
arc_fill_got_info_for_reloc (
arc_got_entry_type_for_reloc (howto),
get_got_entry_list_for_symbol (abfd, r_symndx, h),
const char *name = s->name + 5;
bfd *ibfd;
for (ibfd = info->input_bfds; ibfd; ibfd = ibfd->link.next)
- if (bfd_get_flavour (ibfd) == bfd_target_elf_flavour)
+ if (bfd_get_flavour (ibfd) == bfd_target_elf_flavour
+ && ibfd->flags & DYNAMIC)
{
asection *target = bfd_get_section_by_name (ibfd, name);
if (target != NULL