summaryrefslogtreecommitdiff
path: root/ext/libelf
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2011-06-12 23:51:59 -0700
committerGabe Black <gblack@eecs.umich.edu>2011-06-12 23:51:59 -0700
commit7bc68151b701931307a7d333f55e44baff665302 (patch)
tree070ef921fa6b4c7cd2549f2f3b7d6af17d77e74f /ext/libelf
parent1aa4869ff046d0a039f132de49c8cfe28a6566cf (diff)
downloadgem5-7bc68151b701931307a7d333f55e44baff665302.tar.xz
LibElf: Build the error management code in libelf.
This change makes some minor changes to get the error management code in libelf to build on Linux and to build it into the library.
Diffstat (limited to 'ext/libelf')
-rw-r--r--ext/libelf/SConscript2
-rw-r--r--ext/libelf/_libelf.h1
-rw-r--r--ext/libelf/elf_errmsg.c6
3 files changed, 6 insertions, 3 deletions
diff --git a/ext/libelf/SConscript b/ext/libelf/SConscript
index 41627e90c..1e7fbb465 100644
--- a/ext/libelf/SConscript
+++ b/ext/libelf/SConscript
@@ -40,6 +40,8 @@ ElfFile('elf_begin.c')
ElfFile('elf_cntl.c')
ElfFile('elf_data.c')
ElfFile('elf_end.c')
+ElfFile('elf_errmsg.c')
+ElfFile('elf_errno.c')
ElfFile('elf_fill.c')
ElfFile('elf_flag.c')
ElfFile('elf_getarhdr.c')
diff --git a/ext/libelf/_libelf.h b/ext/libelf/_libelf.h
index a811abb1a..f6cec6e32 100644
--- a/ext/libelf/_libelf.h
+++ b/ext/libelf/_libelf.h
@@ -30,6 +30,7 @@
#define __LIBELF_H_
#include "elf_queue.h"
+#include "libelf.h"
#ifndef NULL
#define NULL ((void *) 0)
diff --git a/ext/libelf/elf_errmsg.c b/ext/libelf/elf_errmsg.c
index 88607ebf4..5fafd5f5d 100644
--- a/ext/libelf/elf_errmsg.c
+++ b/ext/libelf/elf_errmsg.c
@@ -71,10 +71,10 @@ elf_errmsg(int error)
if (error < 0 || error >= ELF_E_NUM)
return _libelf_errors[ELF_E_NUM];
if (oserr) {
- strlcpy(LIBELF_PRIVATE(msg), _libelf_errors[error],
+ strncpy(LIBELF_PRIVATE(msg), _libelf_errors[error],
sizeof(LIBELF_PRIVATE(msg)));
- strlcat(LIBELF_PRIVATE(msg), ": ", sizeof(LIBELF_PRIVATE(msg)));
- strlcat(LIBELF_PRIVATE(msg), strerror(oserr),
+ strncat(LIBELF_PRIVATE(msg), ": ", sizeof(LIBELF_PRIVATE(msg)));
+ strncat(LIBELF_PRIVATE(msg), strerror(oserr),
sizeof(LIBELF_PRIVATE(msg)));
return (const char *)&LIBELF_PRIVATE(msg);
}