aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-02-26 00:56:14 +0000
committerAlexandre Oliva <aoliva@redhat.com>2003-02-26 00:56:14 +0000
commit42644a8920a0cc315e2cc66f69af8b4150617b91 (patch)
tree4af97d753de10937c032f0cff5c952522abf9185 /ld
parent66f24a0b523046d707f18462938189a7ad8846c5 (diff)
downloadgdb-42644a8920a0cc315e2cc66f69af8b4150617b91.zip
gdb-42644a8920a0cc315e2cc66f69af8b4150617b91.tar.gz
gdb-42644a8920a0cc315e2cc66f69af8b4150617b91.tar.bz2
* emultempl/elf32.em (gld${EMULATION_NAME}_add_sysroot): Fix
memory allocation error.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog3
-rw-r--r--ld/emultempl/elf32.em2
2 files changed, 4 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 3fa4fb4..0e78b31 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,8 @@
2003-02-25 Alexandre Oliva <aoliva@redhat.com>
+ * 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 c401fe2..839b7f4 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);