+2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * Makefile.am (noinst_HEADERS): Add libeu.h.
+ * color.c: Remove system.h include, add libeu.h include.
+ * crc32_file.c: Likewise.
+ * fixedsizehash.h: Remove sys/param.h include.
+ * libeu.h: New file.
+ * system.h: Include sys/param.h.
+ (xmalloc, xcalloc, xrealloc, xstrdup, xstrndup, crc32, crc32_file,
+ color_argp, color_enum, color_*): Move definitions to libeu.h.
+ * xstrdup.c: Remove system.h include, add libeu.h include.
+ * xstrndup.c: Remove system.h include, add libeu.h and stdint.h
+ includes.
+
2015-09-24 Jose E. Marchesi <jose.marchesi@oracle.com>
* Makefile.am (AM_CFLAGS): Use -fPIC instead of -fpic to avoid relocation
crc32.c crc32_file.c md5.c sha1.c \
color.c
-noinst_HEADERS = fixedsizehash.h system.h dynamicsizehash.h list.h md5.h \
- sha1.h eu-config.h
+noinst_HEADERS = fixedsizehash.h libeu.h system.h dynamicsizehash.h list.h \
+ md5.h sha1.h eu-config.h
EXTRA_DIST = dynamicsizehash.c
if !GPROF
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "system.h"
+#include "libeu.h"
/* Prototype for option handler. */
# include <config.h>
#endif
-#include "system.h"
+#include "libeu.h"
#include <errno.h>
#include <unistd.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <sys/cdefs.h>
-#include <sys/param.h>
#include <system.h>
--- /dev/null
+/* Declarations for the common library.
+ Copyright (C) 2006-2011 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef LIBEU_H
+#define LIBEU_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+extern void *xmalloc (size_t) __attribute__ ((__malloc__));
+extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__));
+extern void *xrealloc (void *, size_t) __attribute__ ((__malloc__));
+
+extern char *xstrdup (const char *) __attribute__ ((__malloc__));
+extern char *xstrndup (const char *, size_t) __attribute__ ((__malloc__));
+
+
+extern uint32_t crc32 (uint32_t crc, unsigned char *buf, size_t len);
+extern int crc32_file (int fd, uint32_t *resp);
+
+
+/* Color handling. */
+
+/* Command line parser. */
+extern const struct argp color_argp;
+
+/* Coloring mode. */
+enum color_enum
+ {
+ color_never = 0,
+ color_always,
+ color_auto
+ } __attribute__ ((packed));
+extern enum color_enum color_mode;
+
+/* Colors to use for the various components. */
+extern char *color_address;
+extern char *color_bytes;
+extern char *color_mnemonic;
+extern char *color_operand1;
+extern char *color_operand2;
+extern char *color_operand3;
+extern char *color_label;
+extern char *color_undef;
+extern char *color_undef_tls;
+extern char *color_undef_weak;
+extern char *color_symbol;
+extern char *color_tls;
+extern char *color_weak;
+
+extern const char color_off[];
+
+#endif
#include <argp.h>
#include <stddef.h>
#include <stdint.h>
+#include <sys/param.h>
#include <endian.h>
#include <byteswap.h>
#include <unistd.h>
# error "Unknown byte order"
#endif
-extern void *xmalloc (size_t) __attribute__ ((__malloc__));
-extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__));
-extern void *xrealloc (void *, size_t) __attribute__ ((__malloc__));
-
-extern char *xstrdup (const char *) __attribute__ ((__malloc__));
-extern char *xstrndup (const char *, size_t) __attribute__ ((__malloc__));
+#ifndef MAX
+#define MAX(m, n) ((m) < (n) ? (n) : (m))
+#endif
+#ifndef MIN
+#define MIN(m, n) ((m) < (n) ? (m) : (n))
+#endif
-extern uint32_t crc32 (uint32_t crc, unsigned char *buf, size_t len);
-extern int crc32_file (int fd, uint32_t *resp);
/* A special gettext function we use if the strings are too short. */
#define sgettext(Str) \
extern char *__cxa_demangle (const char *mangled_name, char *output_buffer,
size_t *length, int *status);
-
-
-/* Color handling. */
-
-/* Command line parser. */
-extern const struct argp color_argp;
-
-/* Coloring mode. */
-enum color_enum
- {
- color_never = 0,
- color_always,
- color_auto
- } __attribute__ ((packed));
-extern enum color_enum color_mode;
-
-/* Colors to use for the various components. */
-extern char *color_address;
-extern char *color_bytes;
-extern char *color_mnemonic;
-extern char *color_operand1;
-extern char *color_operand2;
-extern char *color_operand3;
-extern char *color_label;
-extern char *color_undef;
-extern char *color_undef_tls;
-extern char *color_undef_weak;
-extern char *color_symbol;
-extern char *color_tls;
-extern char *color_weak;
-
-extern const char color_off[];
-
/* A static assertion. This will cause a compile-time error if EXPR,
which must be a compile-time constant, is false. */
#endif
#include <string.h>
-#include "system.h"
+#include "libeu.h"
/* Return a newly allocated copy of STRING. */
# include <config.h>
#endif
+#include <stdint.h>
#include <string.h>
-#include "system.h"
+#include "libeu.h"
/* Return a newly allocated copy of STRING. */
+2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * asm_align.c: Remove sys/param.h include.
+
2016-07-08 Mark Wielaard <mjw@redhat.com>
* Makefile.am (AM_CPPFLAGS): Add libdwelf.
#include <inttypes.h>
#include <stdlib.h>
-#include <sys/param.h>
#include <libasmP.h>
#include <system.h>
+2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * i386_lex.l: Remove system.h include, add libeu.h include.
+ * i386_parse.y: Remove sys/param.h include, add libeu.h include.
+ * i386_disasm.c: Remove sys/param.h.
+
2016-09-05 Mark Wielaard <mjw@redhat.com>
* bpf_disasm.c: Define BPF_PSEUDO_MAP_FD if undefined.
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/param.h>
#include "../libebl/libeblP.h"
#include <error.h>
#include <libintl.h>
-#include <system.h>
+#include <libeu.h>
#include "i386_parse.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/param.h>
+#include <libeu.h>
#include <system.h>
#define obstack_chunk_alloc xmalloc
+2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * dwarf_getpubnames.c: Remove sys/param.h include, add system.h.
+ * libdw_alloc.c: Likewise.
+
2016-07-08 Mark Wielaard <mjw@redhat.com>
* libdw.map (ELFUTILS_0.167): New. Add dwelf_strtab_init,
#include <assert.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/param.h>
#include <libdwP.h>
#include <dwarf.h>
+#include <system.h>
static int
#include <error.h>
#include <errno.h>
#include <stdlib.h>
-#include <sys/param.h>
#include "libdwP.h"
+#include "system.h"
void *
+2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * dwelf_strtab.c: Remove sys/param.h include.
+ (MIN): Remove definition.
+
2016-07-08 Mark Wielaard <mjw@redhat.com>
* Makefile.am (libdwelf_a_SOURCES): Add dwelf_strtab.c.
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/param.h>
#include "libdwelfP.h"
#include <system.h>
-#ifndef MIN
-# define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
struct Dwelf_Strent
{
+2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * core-file.c: Remove sys/param.h.
+ * dwfl_segment_report_module.c: Likewise. Add system.h include.
+ (MAX): Remove definition.
+ * frame_unwind.c: Add system.h include.
+ (MAX): Remove definition.
+ * linux-core-attach.c (MIN): Remove definition.
+ * linux-pid-attach.c (MAX): Likewise.
+
2016-08-12 Mark Wielaard <mjw@redhat.com>
* link_map.c (dwfl_link_map_report): Fix assert, set in.d_size.
#include "libdwflP.h"
#include <gelf.h>
-#include <sys/param.h>
#include <unistd.h>
#include <endian.h>
#include <byteswap.h>
#include <elf.h>
#include <gelf.h>
#include <inttypes.h>
-#include <sys/param.h>
#include <endian.h>
#include <unistd.h>
#include <fcntl.h>
+#include <system.h>
+
/* A good size for the initial read from memory, if it's not too costly.
This more than covers the phdrs and note segment in the average 64-bit
# define MY_ELFDATA ELFDATA2MSB
#endif
-#ifndef MAX
-# define MAX(a, b) ((a) > (b) ? (a) : (b))
-#endif
-
/* Return user segment index closest to ADDR but not above it.
If NEXT, return the closest to ADDR but not below it. */
#include "libdwflP.h"
#include "../libdw/dwarf.h"
#include <sys/ptrace.h>
+#include <system.h>
/* Maximum number of DWARF expression stack slots before returning an error. */
#define DWARF_EXPR_STACK_MAX 0x100
error. */
#define DWARF_EXPR_STEPS_MAX 0x1000
-#ifndef MAX
-# define MAX(a, b) ((a) > (b) ? (a) : (b))
-#endif
-
bool
internal_function
__libdwfl_frame_reg_get (Dwfl_Frame *state, unsigned regno, Dwarf_Addr *val)
#include "../libdw/memory-access.h"
-#ifndef MIN
-# define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
struct core_arg
{
Elf *core;
#include <sys/syscall.h>
#include <unistd.h>
-#ifndef MAX
-# define MAX(a, b) ((a) > (b) ? (a) : (b))
-#endif
-
#ifdef __linux__
static bool
+2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * elf32_updatefile.c: Remove sys/param.h include.
+ * elf32_updatenull.c: Likewise. Add system.h include.
+ * elf_begin.c: Remove sys/param.h.
+ * elf_compress: Likewise. Add system.h include.
+ (MAX): Remove definition.
+
2016-08-07 Mark Wielaard <mjw@redhat.com>
* elf_compress.c (__libelf_reset_rawdata): Check scn->flags and
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
-#include <sys/param.h>
#include <system.h>
#include "libelfP.h"
#include <libelf.h>
#include <stdbool.h>
#include <string.h>
-#include <sys/param.h>
+#include <system.h>
#include "libelfP.h"
#include "elf-knowledge.h"
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <system.h>
#endif
#include <libelf.h>
+#include <system.h>
#include "libelfP.h"
#include "common.h"
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/param.h>
#include <unistd.h>
#include <zlib.h>
-#ifndef MAX
-# define MAX(a, b) ((a) > (b) ? (a) : (b))
-#endif
-
/* Cleanup and return result. Don't leak memory. */
static void *
do_deflate_cleanup (void *result, z_stream *z, void *out_buf,
+2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * arlib.c: Remove system.h include, add libeu.h include.
+ * arlib2.c: Remove sys/param.h include.
+ * elfcompress.c: Add libeu.h include.
+ * elflint.c: Remove sys/param.h include, add libeu.h include.
+ * nm.c: Likewise.
+ * objdump.c: Likewise.
+ * ranlib.c: Likewise.
+ * readelf.c: Likewise.
+ * size.c: Remove sys/param.h include.
+ * strings.c: Likewise, add libeu.h include.
+ * strip.c: Likewise.
+ * unstrip.c: Likewise.
+
2016-10-06 Mark Wielaard <mjw@redhat.com>
* strip.c (handle_elf): Don't remove real symbols from allocated
#include <stdlib.h>
#include <time.h>
-#include <system.h>
+#include <libeu.h>
#include "arlib.h"
#include <libintl.h>
#include <limits.h>
#include <string.h>
-#include <sys/param.h>
#include "arlib.h"
#include ELFUTILS_HEADER(ebl)
#include ELFUTILS_HEADER(dwelf)
#include <gelf.h>
+#include "libeu.h"
#include "system.h"
/* Name and version of program. */
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
-#include <sys/param.h>
#include <elf-knowledge.h>
+#include <libeu.h>
#include <system.h>
#include "../libelf/libelfP.h"
#include "../libelf/common.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/param.h>
+#include <libeu.h>
#include <system.h>
#include "../libebl/libeblP.h"
#include "../libdwfl/libdwflP.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/param.h>
+#include <libeu.h>
#include <system.h>
#include "../libebl/libeblP.h"
#include <stdio_ext.h>
#include <unistd.h>
#include <sys/mman.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <system.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <signal.h>
+#include <libeu.h>
#include <system.h>
#include "../libelf/libelfP.h"
#include "../libelf/common.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/param.h>
#include <system.h>
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
-#include <sys/param.h>
#include <sys/stat.h>
+#include <libeu.h>
#include <system.h>
#ifndef MAP_POPULATE
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <elf-knowledge.h>
#include <libebl.h>
#include "libdwelf.h"
+#include <libeu.h>
#include <system.h>
typedef uint8_t GElf_Byte;
#include <libebl.h>
#include <libdwfl.h>
#include "libdwelf.h"
+#include "libeu.h"
#include "system.h"
#ifndef _
+2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+
+ * arextract.c: Remove sys/param.h include, add system.h include.
+
2016-08-30 Mark Wielaard <mjw@redhat.com>
* Makefile.am (asm_tst?_LDADD): Add libdw.
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/param.h>
+#include <system.h>
int