This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: elf32-hppa shared lib support part 4
- To: Ian Lance Taylor <ian at zembu dot com>
- Subject: Re: elf32-hppa shared lib support part 4
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Tue, 19 Sep 2000 11:24:32 +1100 (EST)
- cc: binutils at sourceware dot cygnus dot com
On 18 Sep 2000, Ian Lance Taylor wrote:
> + sname = bfd_malloc (len + 7);
> + strcpy (sname, template);
>
> bfd_malloc is not xmalloc. You need to check the return value. I've
Thanks Ian. I'll commit the following to fix it then.
--- bfd/section.c~ Thu Sep 7 22:47:39 2000
+++ bfd/section.c Tue Sep 19 09:44:28 2000
@@ -660,6 +660,10 @@ DESCRIPTION
pointed to by @var{count} will be incremented in this case.
*/
+#ifndef EXIT_FAILURE
+#define EXIT_FAILURE 1
+#endif
+
char *
bfd_get_unique_section_name (abfd, templat, count)
bfd *abfd;
@@ -672,6 +676,11 @@ bfd_get_unique_section_name (abfd, templ
len = strlen (templat);
sname = bfd_malloc (len + 8);
+ if (sname == NULL)
+ {
+ bfd_perror (bfd_get_error ());
+ xexit (EXIT_FAILURE);
+ }
strcpy (sname, templat);
num = 1;
if (count != NULL)
--
Linuxcare. Support for the Revolution.