aboutsummaryrefslogtreecommitdiff
path: root/binutils/objcopy.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1995-08-05 06:18:31 +0000
committerJeff Law <law@redhat.com>1995-08-05 06:18:31 +0000
commita445cee717efcf426428cc03e574943f96cba907 (patch)
tree984e5b0f7846fc40531234c65cba21917fd12fc0 /binutils/objcopy.c
parent08683c8ae76fc7bccc745047d9dfbfa72c6de8aa (diff)
downloadgdb-a445cee717efcf426428cc03e574943f96cba907.zip
gdb-a445cee717efcf426428cc03e574943f96cba907.tar.gz
gdb-a445cee717efcf426428cc03e574943f96cba907.tar.bz2
* objcopy.c (mark_symbols_used_in_relocations): Handle sections
with no relocations. * coffgrok.c (do_sections_p1): Likewise. Fix for net bug.
Diffstat (limited to 'binutils/objcopy.c')
-rw-r--r--binutils/objcopy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 4d3fb67..befe509 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -746,7 +746,7 @@ copy_object (ibfd, obfd)
if (max_gap > 8192)
max_gap = 8192;
buf = (bfd_byte *) xmalloc (max_gap);
- memset (buf, gap_fill, max_gap);
+ memset (buf, gap_fill, (size_t) max_gap);
c = bfd_count_sections (obfd);
for (i = 0; i < c; i++)
@@ -1253,6 +1253,9 @@ mark_symbols_used_in_relocations (ibfd, isection, symbolsarg)
if (relsize < 0)
bfd_fatal (bfd_get_filename (ibfd));
+ if (relsize == 0)
+ return 0;
+
relpp = (arelent **) xmalloc (relsize);
relcount = bfd_canonicalize_reloc (ibfd, isection, relpp, symbols);
if (relcount < 0)