From 42644a8920a0cc315e2cc66f69af8b4150617b91 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Wed, 26 Feb 2003 00:56:14 +0000 Subject: [PATCH] * emultempl/elf32.em (gld${EMULATION_NAME}_add_sysroot): Fix memory allocation error. --- ld/ChangeLog | 3 +++ ld/emultempl/elf32.em | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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); -- 2.30.2