From: Alexandre Oliva Date: Wed, 26 Feb 2003 00:56:14 +0000 (+0000) Subject: * emultempl/elf32.em (gld${EMULATION_NAME}_add_sysroot): Fix X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=42644a8920a0cc315e2cc66f69af8b4150617b91;p=binutils-gdb.git * emultempl/elf32.em (gld${EMULATION_NAME}_add_sysroot): Fix memory allocation error. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 3fa4fb429ba..0e78b3123bc 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,8 @@ 2003-02-25 Alexandre Oliva + * emultempl/elf32.em (gld${EMULATION_NAME}_add_sysroot): Fix + memory allocation error. + * Makefile.am (ldmain.o): Define TOOLBINDIR. * Makefile.in: Rebuilt. * ldmain.c (ld_sysroot): Try to set from TOOLBINDIR too. diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index c401fe210a7..839b7f46431 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -461,7 +461,7 @@ gld${EMULATION_NAME}_add_sysroot (path) if (path[i]) colons++; - len = len + colons * strlen (ld_sysroot); + len = len + (colons + 1) * strlen (ld_sysroot); ret = xmalloc (len + 1); strcpy (ret, ld_sysroot); p = ret + strlen (ret);