/* linker.c -- BFD linker routines
- Copyright (C) 1993-2015 Free Software Foundation, Inc.
+ Copyright (C) 1993-2016 Free Software Foundation, Inc.
Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support
This file is part of BFD, the Binary File Descriptor library.
else if (bfd_is_com_section (section))
{
row = COMMON_ROW;
- if (strcmp (name, "__gnu_lto_slim") == 0)
+ if (!bfd_link_relocatable (info)
+ && strcmp (name, "__gnu_lto_slim") == 0)
(*_bfd_error_handler)
(_("%s: plugin needed to handle lto object"),
bfd_get_filename (abfd));
if (! generic_add_output_symbol (abfd, &outsymalloc, NULL))
return FALSE;
- if (info->relocatable)
+ if (bfd_link_relocatable (info))
{
/* Allocate space for the output relocs for each section. */
for (o = abfd->sections; o != NULL; o = o->next)
break;
case discard_sec_merge:
output = TRUE;
- if (info->relocatable
+ if (bfd_link_relocatable (info)
|| ! (sym->section->flags & SEC_MERGE))
break;
/* FALLTHROUGH */
{
arelent *r;
- if (! info->relocatable)
+ if (! bfd_link_relocatable (info))
abort ();
if (sec->orelocation == NULL)
abort ();
BFD_ASSERT (input_section->output_offset == link_order->offset);
BFD_ASSERT (input_section->size == link_order->size);
- if (info->relocatable
+ if (bfd_link_relocatable (info)
&& input_section->reloc_count > 0
&& output_section->orelocation == NULL)
{
goto error_return;
new_contents = (bfd_get_relocated_section_contents
(output_bfd, info, link_order, contents,
- info->relocatable,
+ bfd_link_relocatable (info),
_bfd_generic_link_get_symbols (input_bfd)));
if (!new_contents)
goto error_return;
bfd_find_version_for_sym (verdefs, sym_name, &hidden);
return hidden;
}
+
+/*
+FUNCTION
+ bfd_link_check_relocs
+
+SYNOPSIS
+ bfd_boolean bfd_link_check_relocs
+ (bfd *abfd, struct bfd_link_info *info);
+
+DESCRIPTION
+ Checks the relocs in ABFD for validity.
+ Does not execute the relocs.
+ Return TRUE if everything is OK, FALSE otherwise.
+ This is the external entry point to this code.
+*/
+
+bfd_boolean
+bfd_link_check_relocs (bfd *abfd, struct bfd_link_info *info)
+{
+ return BFD_SEND (abfd, _bfd_link_check_relocs, (abfd, info));
+}
+
+/*
+FUNCTION
+ _bfd_generic_link_check_relocs
+
+SYNOPSIS
+ bfd_boolean _bfd_generic_link_check_relocs
+ (bfd *abfd, struct bfd_link_info *info);
+
+DESCRIPTION
+ Stub function for targets that do not implement reloc checking.
+ Return TRUE.
+ This is an internal function. It should not be called from
+ outside the BFD library.
+*/
+
+bfd_boolean
+_bfd_generic_link_check_relocs (bfd *abfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED)
+{
+ return TRUE;
+}