bfd_set_error (bfd_error_file_too_big); \
goto error_return; \
} \
- debug->ptr = bfd_malloc (amt); \
- if (debug->ptr == NULL) \
+ if (bfd_seek (abfd, symhdr->offset, SEEK_SET) != 0) \
goto error_return; \
- if (bfd_seek (abfd, symhdr->offset, SEEK_SET) != 0 \
- || bfd_bread (debug->ptr, amt, abfd) != amt) \
+ debug->ptr = (type) _bfd_malloc_and_read (abfd, amt, amt); \
+ if (debug->ptr == NULL) \
goto error_return; \
} while (0)
}
else
{
- bfd_boolean reject_undefined
- = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR
- || ELF_ST_VISIBILITY (h->root.other) != STV_DEFAULT);
+ bfd_boolean reject_undefined
+ = (info->unresolved_syms_in_objects == RM_DIAGNOSE
+ && !info->warn_unresolved_syms)
+ || ELF_ST_VISIBILITY (h->root.other) != STV_DEFAULT;
- (*info->callbacks->undefined_symbol)
+ info->callbacks->undefined_symbol
(info, h->root.root.root.string, input_bfd,
input_section, relocation->r_offset, reject_undefined);
/* Handle a MIPS specific section when reading an object file. This
is called when elfcode.h finds a section with an unknown type.
- This routine supports both the 32-bit and 64-bit ELF ABI.
-
- FIXME: We need to handle the SHF_MIPS_GPREL flag, but I'm not sure
- how to. */
+ This routine supports both the 32-bit and 64-bit ELF ABI. */
bfd_boolean
_bfd_mips_elf_section_from_shdr (bfd *abfd,
if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex))
return FALSE;
+ if (hdr->sh_flags & SHF_MIPS_GPREL)
+ flags |= SEC_SMALL_DATA;
+
if (flags)
{
if (!bfd_set_section_flags (hdr->bfd_section,
hmips = (struct mips_elf_link_hash_entry *) h;
/* Make sure we know what is going on here. */
- BFD_ASSERT (dynobj != NULL
- && (h->needs_plt
- || h->is_weakalias
- || (h->def_dynamic
- && h->ref_regular
- && !h->def_regular)));
+ if (dynobj == NULL
+ || (! h->needs_plt
+ && ! h->is_weakalias
+ && (! h->def_dynamic
+ || ! h->ref_regular
+ || h->def_regular)))
+ {
+ if (h->type == STT_GNU_IFUNC)
+ _bfd_error_handler (_("IFUNC symbol %s in dynamic symbol table - IFUNCS are not supported"),
+ h->root.root.string);
+ else
+ _bfd_error_handler (_("non-dynamic symbol %s in dynamic symbol table"),
+ h->root.root.string);
+ return TRUE;
+ }
hmips = (struct mips_elf_link_hash_entry *) h;
free (reloc_vector);
return data;
-error_return:
+ error_return:
if (reloc_vector != NULL)
free (reloc_vector);
return NULL;
/* Check to see if the input BFD actually contains any sections. If not,
then it has no attributes, and its flags may not have been initialized
either, but it cannot actually cause any incompatibility. */
+ /* FIXME: This excludes any input shared library from consideration. */
for (sec = ibfd->sections; sec != NULL; sec = sec->next)
{
/* Ignore synthetic sections and empty .text, .data and .bss sections