summaryrefslogtreecommitdiff
path: root/binutils/objcopy.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-06-27 08:01:28 +0000
committerNick Clifton <nickc@redhat.com>2003-06-27 08:01:28 +0000
commite7c81c254c0efabd933b208c8702d98d81b2bffa (patch)
tree41c9020838a2113579244f6b503605c1d8f4b301 /binutils/objcopy.c
parent72b4917c07ca0e1e2610c32543a2662dd2048f91 (diff)
downloadbinutils-gdb-e7c81c254c0efabd933b208c8702d98d81b2bffa.tar.gz
Fix --add-gnu-debuglink
Diffstat (limited to 'binutils/objcopy.c')
-rw-r--r--binutils/objcopy.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index de777678962..9b87a8a7c75 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -1132,6 +1132,7 @@ copy_object (ibfd, obfd)
bfd_vma start;
long symcount;
asection **osections = NULL;
+ asection * gnu_debuglink_section = NULL;
bfd_size_type *gaps = NULL;
bfd_size_type max_gap = 0;
long symsize;
@@ -1249,8 +1250,13 @@ copy_object (ibfd, obfd)
if (gnu_debuglink_filename != NULL)
{
- if (! bfd_add_gnu_debuglink (obfd, gnu_debuglink_filename))
+ gnu_debuglink_section = bfd_create_gnu_debuglink_section (obfd, gnu_debuglink_filename);
+
+ if (gnu_debuglink_section == NULL)
+ {
+ fprintf (stderr, "UGG\n");
RETURN_NONFATAL (gnu_debuglink_filename);
+ }
}
if (gap_fill_set || pad_to_set)
@@ -1413,6 +1419,16 @@ copy_object (ibfd, obfd)
}
}
+ if (gnu_debuglink_filename != NULL)
+ {
+ if (! bfd_fill_in_gnu_debuglink_section
+ (obfd, gnu_debuglink_section, gnu_debuglink_filename))
+ {
+ fprintf (stderr, "UGG 2\n");
+ RETURN_NONFATAL (gnu_debuglink_filename);
+ }
+ }
+
if (gap_fill_set || pad_to_set)
{
bfd_byte *buf;