aboutsummaryrefslogtreecommitdiff
path: root/binutils
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
parent72b4917c07ca0e1e2610c32543a2662dd2048f91 (diff)
downloadgdb-e7c81c254c0efabd933b208c8702d98d81b2bffa.zip
gdb-e7c81c254c0efabd933b208c8702d98d81b2bffa.tar.gz
gdb-e7c81c254c0efabd933b208c8702d98d81b2bffa.tar.bz2
Fix --add-gnu-debuglink
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog8
-rw-r--r--binutils/objcopy.c18
2 files changed, 25 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 5b01202..1cbaca6 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,11 @@
+2003-06-27 Nick Clifton <nickc@redhat.com>
+
+ * objcopy.c (copy_object): Replace call to
+ bfd_create_gnu_debuglink_section with seperate calls to
+ bfd_add_gnu_debuglink_section and
+ bfd_fill_in_gnu_debuglink_section, seperated by a walk over the
+ symbol tables.
+
2003-06-26 Roland McGrath <roland@redhat.com>
* readelf.c (loadaddr): Variable removed.
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index de77767..9b87a8a 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;