PR binutils/15125

* objcopy.c (copy_object): Provide a helpful warning message when
	adding a gnu_debuglink section to an object which already contains
	one.
This commit is contained in:
Nick Clifton 2013-02-14 11:52:25 +00:00
parent 1773c82c92
commit d99b05a32e
2 changed files with 64 additions and 45 deletions

View File

@ -1,3 +1,10 @@
2013-02-14 Nick Clifton <nickc@redhat.com>
PR binutils/15125
* objcopy.c (copy_object): Provide a helpful warning message when
adding a gnu_debuglink section to an object which already contains
one.
2013-02-07 Nick Clifton <nickc@redhat.com>
* elfcomm.c (get_archive_member_name): Prevent seg-fault if a

View File

@ -1762,6 +1762,17 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
}
if (gnu_debuglink_filename != NULL)
{
/* PR 15125: Give a helpful warning message if
the debuglink section already exists, and
allow the rest of the copy to complete. */
if (bfd_get_section_by_name (obfd, ".gnu_debuglink"))
{
non_fatal (_("%s: debuglink section already exists"),
bfd_get_filename (obfd));
gnu_debuglink_filename = NULL;
}
else
{
gnu_debuglink_section = bfd_create_gnu_debuglink_section
(obfd, gnu_debuglink_filename);
@ -1817,6 +1828,7 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
bfd_set_section_vma (obfd, gnu_debuglink_section, debuglink_vma);
}
}
}
if (bfd_count_sections (obfd) != 0
&& (gap_fill_set || pad_to_set))