diff options
author | Wez Furlong <wez@netevil.org> | 2011-04-03 15:19:34 -0400 |
---|---|---|
committer | Wez Furlong <wez@netevil.org> | 2011-04-03 15:19:34 -0400 |
commit | ee2b74dbc88c21f3e6c53d6d4f09a69b271755e4 (patch) | |
tree | 635825833d7a4679d30cd2e0260b91a51b1831cd | |
parent | 253acb864d82ab0406d6a6bcecd09e502c64b140 (diff) | |
download | ctf-ee2b74dbc88c21f3e6c53d6d4f09a69b271755e4.tar.gz |
fix memory.h include; was pulling in the system memory.h, leaving xmalloc
undefined and implictly returning an int rather than a void*.
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | common/list.c | 4 | ||||
-rw-r--r-- | common/memory.c | 4 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | cvt/alist.c | 2 | ||||
-rw-r--r-- | cvt/ctf.c | 2 | ||||
-rw-r--r-- | cvt/ctfconvert.c | 2 | ||||
-rw-r--r-- | cvt/ctfmerge.c | 2 | ||||
-rw-r--r-- | cvt/dwarf.c | 2 | ||||
-rw-r--r-- | cvt/fifo.c | 2 | ||||
-rw-r--r-- | cvt/fixup_tdescs.c | 2 | ||||
-rw-r--r-- | cvt/hash.c | 2 | ||||
-rw-r--r-- | cvt/iidesc.c | 2 | ||||
-rw-r--r-- | cvt/input.c | 2 | ||||
-rw-r--r-- | cvt/merge.c | 2 | ||||
-rw-r--r-- | cvt/output.c | 2 | ||||
-rw-r--r-- | cvt/st_parse.c | 2 | ||||
-rw-r--r-- | cvt/stabs.c | 2 | ||||
-rw-r--r-- | cvt/stack.c | 2 | ||||
-rw-r--r-- | cvt/strtab.c | 2 | ||||
-rw-r--r-- | cvt/tdata.c | 2 | ||||
-rw-r--r-- | cvt/traverse.c | 2 | ||||
-rw-r--r-- | cvt/util.c | 2 | ||||
-rw-r--r-- | libctf/ctf_lib.c | 16 |
24 files changed, 40 insertions, 33 deletions
diff --git a/Makefile.am b/Makefile.am index cad2bf8..e3c0bdd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -50,9 +50,9 @@ libcvt_la_SOURCES = \ cvt/util.c ctfconvert_SOURCES = cvt/ctfconvert.c -ctfconvert_LDADD = libcvt.la libpctfcommon.la +ctfconvert_LDADD = libcvt.la libpctfcommon.la libpctf.la -ldwarf ctfmerge_SOURCES = cvt/ctfmerge.c -ctfmerge_LDADD = libcvt.la libpctfcommon.la +ctfmerge_LDADD = libcvt.la libpctfcommon.la libpctf.la diff --git a/common/list.c b/common/list.c index 4958f27..d5c796f 100644 --- a/common/list.c +++ b/common/list.c @@ -34,8 +34,8 @@ #include <assert.h> #include <stdlib.h> -#include "list.h" -#include "memory.h" +#include "common/list.h" +#include "common/memory.h" struct list { void *l_data; diff --git a/common/memory.c b/common/memory.c index e16044a..f51c8cb 100644 --- a/common/memory.c +++ b/common/memory.c @@ -26,6 +26,8 @@ #pragma ident "%Z%%M% %I% %E% SMI" +#include "libctf/ctf_impl.h" + /* * Routines for memory management */ @@ -35,7 +37,7 @@ #include <stdlib.h> #include <string.h> #include <strings.h> -#include "memory.h" +#include "common/memory.h" static void memory_bailout(void) diff --git a/configure.ac b/configure.ac index 62d3e55..82ca2b1 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,12 @@ getprogname \ AC_CHECK_LIB(z, uncompress) AC_CHECK_LIB(elf, gelf_getshdr) -AC_CHECK_LIB(dwarf, dwarf_elf_init) +AC_CHECK_LIB(dwarf, dwarf_elf_init, [ + AC_MSG_RESULT([you got dwarves]) +],[ + AC_ERROR([Need libdwarf for ctfconvert to operate]) +]) + AC_CHECK_LIB(pthread, pthread_create) AC_CHECK_HEADERS([ \ diff --git a/cvt/alist.c b/cvt/alist.c index db5cc80..f6e8348 100644 --- a/cvt/alist.c +++ b/cvt/alist.c @@ -34,7 +34,7 @@ #include "libctf/ctf_impl.h" #include "alist.h" -#include "memory.h" +#include "common/memory.h" #include "hash.h" #define ALIST_HASH_SIZE 997 @@ -30,7 +30,7 @@ #include "libctf/ctf_impl.h" #include "ctftools.h" #include "strtab.h" -#include "memory.h" +#include "common/memory.h" /* * Name of the file currently being read, used to print error messages. We diff --git a/cvt/ctfconvert.c b/cvt/ctfconvert.c index 4f0b785..fcec295 100644 --- a/cvt/ctfconvert.c +++ b/cvt/ctfconvert.c @@ -32,7 +32,7 @@ #include "libctf/ctf_impl.h" #include "ctftools.h" -#include "memory.h" +#include "common/memory.h" const char *progname; int debug_level = DEBUG_LEVEL; diff --git a/cvt/ctfmerge.c b/cvt/ctfmerge.c index f9d7237..026dd96 100644 --- a/cvt/ctfmerge.c +++ b/cvt/ctfmerge.c @@ -184,7 +184,7 @@ #include "ctftools.h" #include "ctfmerge.h" #include "traverse.h" -#include "memory.h" +#include "common/memory.h" #include "fifo.h" #include "barrier.h" diff --git a/cvt/dwarf.c b/cvt/dwarf.c index 3df3b1a..2e6adf5 100644 --- a/cvt/dwarf.c +++ b/cvt/dwarf.c @@ -84,7 +84,7 @@ #include "libctf/ctf_impl.h" #include "ctftools.h" -#include "memory.h" +#include "common/memory.h" #include "common/list.h" #include "traverse.h" @@ -33,7 +33,7 @@ #include <stdlib.h> #include "fifo.h" -#include "memory.h" +#include "common/memory.h" typedef struct fifonode { void *fn_data; diff --git a/cvt/fixup_tdescs.c b/cvt/fixup_tdescs.c index 55a54f4..d40e569 100644 --- a/cvt/fixup_tdescs.c +++ b/cvt/fixup_tdescs.c @@ -33,7 +33,7 @@ #include "libctf/ctf_impl.h" #include "ctftools.h" #include "hash.h" -#include "memory.h" +#include "common/memory.h" /* * Due to 4432619, the 6.1 compiler will sometimes incorrectly generate pointer @@ -32,7 +32,7 @@ #include "libctf/ctf_impl.h" #include "hash.h" -#include "memory.h" +#include "common/memory.h" #include "common/list.h" struct hash { diff --git a/cvt/iidesc.c b/cvt/iidesc.c index 75f986c..1f2c71e 100644 --- a/cvt/iidesc.c +++ b/cvt/iidesc.c @@ -31,7 +31,7 @@ #include "libctf/ctf_impl.h" #include "ctftools.h" -#include "memory.h" +#include "common/memory.h" #include "common/list.h" #include "hash.h" diff --git a/cvt/input.c b/cvt/input.c index 900cf85..4e6a05a 100644 --- a/cvt/input.c +++ b/cvt/input.c @@ -31,7 +31,7 @@ #include "libctf/ctf_impl.h" #include "ctftools.h" -#include "memory.h" +#include "common/memory.h" #include "common/symbol.h" typedef int read_cb_f(tdata_t *, char *, void *); diff --git a/cvt/merge.c b/cvt/merge.c index b841fdf..404222d 100644 --- a/cvt/merge.c +++ b/cvt/merge.c @@ -116,7 +116,7 @@ #include "ctftools.h" #include "common/list.h" #include "alist.h" -#include "memory.h" +#include "common/memory.h" #include "traverse.h" typedef struct equiv_data equiv_data_t; diff --git a/cvt/output.c b/cvt/output.c index 6546351..b4d9e11 100644 --- a/cvt/output.c +++ b/cvt/output.c @@ -33,7 +33,7 @@ #include "libctf/ctf_impl.h" #include "ctftools.h" #include "common/list.h" -#include "memory.h" +#include "common/memory.h" #include "traverse.h" #include "common/symbol.h" diff --git a/cvt/st_parse.c b/cvt/st_parse.c index 602ae23..34109bf 100644 --- a/cvt/st_parse.c +++ b/cvt/st_parse.c @@ -31,7 +31,7 @@ #include <setjmp.h> #include "pctf/ctf.h" #include "ctftools.h" -#include "memory.h" +#include "common/memory.h" #include "common/list.h" #define HASH(NUM) ((int)(NUM & (BUCKETS - 1))) diff --git a/cvt/stabs.c b/cvt/stabs.c index 86a106f..dc5a7fe 100644 --- a/cvt/stabs.c +++ b/cvt/stabs.c @@ -34,7 +34,7 @@ #include "ctftools.h" #include "common/list.h" #include "stack.h" -#include "memory.h" +#include "common/memory.h" #include "traverse.h" char *curhdr; diff --git a/cvt/stack.c b/cvt/stack.c index 7c36cd5..e54be7b 100644 --- a/cvt/stack.c +++ b/cvt/stack.c @@ -35,7 +35,7 @@ #include <stdlib.h> #include "stack.h" -#include "memory.h" +#include "common/memory.h" #define STACK_SEEDSIZE 5 diff --git a/cvt/strtab.c b/cvt/strtab.c index 5a8ebc6..b8cf2b4 100644 --- a/cvt/strtab.c +++ b/cvt/strtab.c @@ -28,7 +28,7 @@ #include "libctf/ctf_impl.h" #include "strtab.h" -#include "memory.h" +#include "common/memory.h" #define STRTAB_HASHSZ 211 /* use a prime number of hash buckets */ #define STRTAB_BUFSZ (64 * 1024) /* use 64K data buffers by default */ diff --git a/cvt/tdata.c b/cvt/tdata.c index 524cf04..6357475 100644 --- a/cvt/tdata.c +++ b/cvt/tdata.c @@ -29,7 +29,7 @@ #include "libctf/ctf_impl.h" #include "ctftools.h" -#include "memory.h" +#include "common/memory.h" #include "traverse.h" /* diff --git a/cvt/traverse.c b/cvt/traverse.c index febd0b3..c455cf5 100644 --- a/cvt/traverse.c +++ b/cvt/traverse.c @@ -33,7 +33,7 @@ #include "libctf/ctf_impl.h" #include "ctftools.h" #include "traverse.h" -#include "memory.h" +#include "common/memory.h" int (*tddescenders[])(tdesc_t *, tdtrav_data_t *); tdtrav_cb_f tdnops[]; @@ -31,7 +31,7 @@ #include "libctf/ctf_impl.h" #include "ctftools.h" -#include "memory.h" +#include "common/memory.h" static void (*terminate_cleanup)(void) = NULL; diff --git a/libctf/ctf_lib.c b/libctf/ctf_lib.c index 571f2da..543e009 100644 --- a/libctf/ctf_lib.c +++ b/libctf/ctf_lib.c @@ -134,7 +134,7 @@ ctf_sect_mmap(ctf_sect_t *sp, int fd) { size_t pageoff = sp->cts_offset & ~_PAGEMASK; - caddr_t base = mmap64(NULL, sp->cts_size + pageoff, PROT_READ, + caddr_t base = mmap(NULL, sp->cts_size + pageoff, PROT_READ, MAP_PRIVATE, fd, sp->cts_offset & _PAGEMASK); if (base != MAP_FAILED) @@ -181,10 +181,10 @@ ctf_fdopen(int fd, int *errp) bzero(&strsect, sizeof (ctf_sect_t)); bzero(&hdr.ctf, sizeof (hdr)); - if (fstat64(fd, &st) == -1) + if (fstat(fd, &st) == -1) return (ctf_set_open_errno(errp, errno)); - if ((nbytes = pread64(fd, &hdr.ctf, sizeof (hdr), 0)) <= 0) + if ((nbytes = pread(fd, &hdr.ctf, sizeof (hdr), 0)) <= 0) return (ctf_set_open_errno(errp, nbytes < 0? errno : ECTF_FMT)); /* @@ -196,7 +196,7 @@ ctf_fdopen(int fd, int *errp) if (hdr.ctf.ctp_version > CTF_VERSION) return (ctf_set_open_errno(errp, ECTF_CTFVERS)); - ctfsect.cts_data = mmap64(NULL, st.st_size, PROT_READ, + ctfsect.cts_data = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); if (ctfsect.cts_data == MAP_FAILED) @@ -266,7 +266,7 @@ ctf_fdopen(int fd, int *errp) nbytes = sizeof (Elf32_Shdr) * n; - if ((sp32 = malloc(nbytes)) == NULL || pread64(fd, + if ((sp32 = malloc(nbytes)) == NULL || pread(fd, sp32, nbytes, hdr.e64.e_shoff) != nbytes) { free(sp); return (ctf_set_open_errno(errp, errno)); @@ -277,7 +277,7 @@ ctf_fdopen(int fd, int *errp) free(sp32); - } else if (pread64(fd, sp, nbytes, hdr.e64.e_shoff) != nbytes) { + } else if (pread(fd, sp, nbytes, hdr.e64.e_shoff) != nbytes) { free(sp); return (ctf_set_open_errno(errp, errno)); } @@ -289,7 +289,7 @@ ctf_fdopen(int fd, int *errp) strs_mapsz = sp[hdr.e64.e_shstrndx].sh_size + (sp[hdr.e64.e_shstrndx].sh_offset & ~_PAGEMASK); - strs_map = mmap64(NULL, strs_mapsz, PROT_READ, MAP_PRIVATE, + strs_map = mmap(NULL, strs_mapsz, PROT_READ, MAP_PRIVATE, fd, sp[hdr.e64.e_shstrndx].sh_offset & _PAGEMASK); strs = (char *)strs_map + @@ -393,7 +393,7 @@ ctf_open(const char *filename, int *errp) ctf_file_t *fp; int fd; - if ((fd = open64(filename, O_RDONLY)) == -1) { + if ((fd = open(filename, O_RDONLY)) == -1) { if (errp != NULL) *errp = errno; return (NULL); |