-1999-04-11 Richard Henderson <rth@cygnus.com>
+Sat Jan 1 19:06:52 2000 Hans-Peter Nilsson <hp@bitrange.com>
- * bfdlink.h (bfd_elf_version_expr): Rename `match' to `pattern'.
- Add `match' callback function.
+ * symcat.h (STRINGX) [!__STDC__ || ALMOST_STDC]: Change "?" to "s"
+ to stringify argument s.
-1999-04-10 Richard Henderson <rth@cygnus.com>
+1999-12-05 Mark Mitchell <mark@codesourcery.com>
- * bfdlink.h (bfd_link_info): Add no_undefined.
+ * splay-tree.h (struct splay_tree_node): Rename to ...
+ (struct splay_tree_node_s): ... this.
+ (struct splay_tree): Rename to ...
+ (struct splay_tree_s): ... this.
-1999-04-08 Nick Clifton <nickc@cygnus.com>
+1999-11-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
- * dis-asm.h: Add prototype for print_insn_mcore.
+ * ansidecl.h (ATTRIBUTE_MALLOC): New macro.
-1999-04-02 Mark Mitchell <mark@codesourcery.com>
+ * libiberty.h (buildargv, dupargv, concat, choose_temp_base,
+ make_temp_file, xmalloc, xcalloc, xstrdup, xmemdup): Add
+ ATTRIBUTE_MALLOC.
+ (xatexit): Remove __GNUC__ check, add ATTRIBUTE_NORETURN.
- * splay-tree.h (splay_tree_compare_pointers): Declare.
+1999-11-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-1999-03-30 Mark Mitchell <mark@codesourcery.com>
+ * libiberty.h: Include stdarg.h when ANSI_PROTOTYPES is defined.
+ (asprintf, vasprintf): Provide declarations.
- * splay-tree.h (splay_tree_compare_ints): Declare.
+Wed Nov 10 12:43:21 1999 Philippe De Muyter <phdm@macqel.be>
+ Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-Wed Mar 24 12:46:29 1999 Andrew Cagney <cagney@amy.cygnus.com>
+ * ansidecl.h: Define and test `GCC_VERSION', not `HAVE_GCC_VERSION'.
+
+1999-10-23 08:51 -0700 Zack Weinberg <zack@bitmover.com>
- * libiberty.h (basename): Cygwin{,32} should have the prototype.
+ * hashtab.h: Give hash_table_t a struct tag. Add prototypes
+ for clear_hash_table_slot and traverse_hash_table. Correct
+ prototype of all_hash_table_collisions.
+
+Fri Oct 15 01:47:51 1999 Vladimir Makarov <vmakarov@loony.cygnus.com>
+
+ * hashtab.h: New file.
+
+1999-10-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * ansidecl.h (HAVE_GCC_VERSION): New macro. Use it instead of
+ explicitly testing __GNUC__ and __GNUC_MINOR__.
+
+ (ATTRIBUTE_PRINTF): Use `__format__', not `format'.
+
+1999-09-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * libiberty.h (make_temp_file): Add a prototype.
+
+Tue Sep 14 00:35:02 1999 Marc Espie <espie@cvs.openbsd.org>
+
+ * libiberty.h (basename): OpenBSD has a correct prototype.
+ (xrealloc): Remove outdated comment.
+
+1999-09-07 Jeff Garzik <jgarzik@pobox.com>
+
+ * libiberty.h (xmemdup): Add prototype for new function.
+
+1999-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * obstack.h (obstack_grow, obstack_grow0): Move (char*) casts
+ in calls to `_obstack_memcpy' from here ...
+
+ (_obstack_memcpy): ... to here, except in the __STDC__ case which
+ doesn't need it.
+
+1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * libiberty.h (getpwd): Prototype.
-1999-02-22 Jim Lemke <jlemke@cygnus.com>
+1999-08-01 Mark Mitchell <mark@codesourcery.com>
- * bfdlink.h (bfd_link_info): add field "mpc860c0".
+ * splay-tree.h (splay_tree_insert): Return the new node.
-Mon Feb 1 21:05:46 1999 Catherine Moore <clm@cygnus.com>
+1999-07-11 Ian Lance Taylor <ian@zembu.com>
- * dis-asm.h (print_insn_i386_att): Declare.
- (print_insn_i386_intel): Declare.
+ * ansidecl.h: Copy attribute support macros from egcs.
-998-12-30 Michael Meissner <meissner@cygnus.com>
+1999-04-02 Mark Mitchell <mark@codesourcery.com>
+
+ * splay-tree.h (splay_tree_compare_pointers): Declare.
- * dis-asm.h (INIT_DISASSEMBLE_INFO_NO_ARCH): Cast STREAM and
- FPRINTF_FUNC to avoid compiler warnings.
+1999-03-30 Mark Mitchell <mark@codesourcery.com>
-Wed Dec 30 16:07:14 1998 David Taylor <taylor@texas.cygnus.com>
+ * splay-tree.h (splay_tree_compare_ints): Declare.
- * dis-asm.h: change void * to PTR (two places).
+Wed Mar 24 12:46:29 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * libiberty.h (basename): Cygwin{,32} should have the prototype.
Mon Dec 14 09:53:31 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
Tue Dec 8 00:30:31 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
- The following changes were made by Elena Zannoni
- <ezannoni@kwikemart.cygnus.com> and Edith Epstein
- <eepstein@sophia.cygnus.com> as part of a project to merge in
- changes made by HP; HP did not create ChangeLog entries.
-
- * dis-asm.h (struct disassemble_info): change the type of stream
- from FILE* to void*, for use with gdb's new type GDB_FILE.
- (fprintf_ftype): change FILE* parameter type to void*.
-
* demangle.h: (DMGL_EDG): new macro for Kuck and Associates
(DMGL_STYLE_MASK): modify to include Kuck and Assoc style
(demangling_styles): add new edg_demangling style
(ARM_DEMANGLING): coerce to int.
(HP_DEMANGLING): new macro.
- * hp-symtab.h: rewritten, from HP.
- (quick_procedure): change type of language field to unsigned int
- (quick_module): change type of language field to unsigned int
- (struct dntt_type_svar): add field thread_specific.
- (hp_language): add languages modcal and dmpascal.
-
-Mon Nov 30 15:25:58 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * elf/sh.h (elf_sh_reloc_type): Add R_SH_FIRST_INVALID_RELOC,
- R_SH_LAST_INVALID_RELOC, R_SH_SWITCH8 and R_SH_max.
-
Fri Nov 20 13:14:00 1998 Andrew Cagney <cagney@b1.cygnus.com>
* libiberty.h (basename): Add prototype for FreeBSD.
* demangle.h: Never define PARAMS().
* splay-tree.h: Likewise.
-Sat Nov 7 18:30:20 1998 Peter Schauer <peter.schauer@regent.e-technik.tu-muenchen.de>
-
- * dis-asm.h (print_insn_vax): Declare.
-
Sat Nov 7 16:04:03 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* demangle.h: Don't include gansidecl.h.
* splay-tree.h: Likewise.
-1998-10-26 16:03 Ulrich Drepper <drepper@cygnus.com>
-
- * bfdlink.h (struct bfd_link_info): Add new field optimize.
-
Thu Oct 22 19:58:00 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* splay-tree.h: Wrap function pointer parameter declarations in
* obstack.h: Update to latest FSF version.
-Tue May 26 20:57:43 1998 Stan Cox <scox@equinox.cygnus.com>
-
- * elf/sparc.h (EF_SPARC_LEDATA, R_SPARC_32LE): Added.
-
Tue Feb 24 13:05:02 1998 Doug Evans <devans@canuck.cygnus.com>
* dis-asm.h (disassemble_info): Member `symbol' renamed to `symbols'
bytes_per_chunk and display_endian to control the
display of raw instructions.
-Fri Dec 27 22:17:37 1996 Fred Fish <fnf@cygnus.com>
-
- * dis-asm.h (print_insn_tic80): Declare.
-
Sun Dec 8 17:11:12 1996 Doug Evans <dje@canuck.cygnus.com>
* callback.h (host_callback): New member `error'.
/* ANSI and traditional C compatability macros
- Copyright 1991, 1992, 1996 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1996, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
#endif /* ANSI C. */
+
+/* Using MACRO(x,y) in cpp #if conditionals does not work with some
+ older preprocessors. Thus we can't define something like this:
+
+#define HAVE_GCC_VERSION(MAJOR, MINOR) \
+ (__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
+
+and then test "#if HAVE_GCC_VERSION(2,7)".
+
+So instead we use the macro below and test it against specific values. */
+
+/* This macro simplifies testing whether we are using gcc, and if it
+ is of a particular minimum version. (Both major & minor numbers are
+ significant.) This macro will evaluate to 0 if we are not using
+ gcc at all. */
+#ifndef GCC_VERSION
+#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
+#endif /* GCC_VERSION */
+
+/* Define macros for some gcc attributes. This permits us to use the
+ macros freely, and know that they will come into play for the
+ version of gcc in which they are supported. */
+
+#if (GCC_VERSION < 2007)
+# define __attribute__(x)
+#endif
+
+/* Attribute __malloc__ on functions was valid as of gcc 2.96. */
+#ifndef ATTRIBUTE_MALLOC
+# if (GCC_VERSION >= 2096)
+# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+# else
+# define ATTRIBUTE_MALLOC
+# endif /* GNUC >= 2.96 */
+#endif /* ATTRIBUTE_MALLOC */
+
+/* Attributes on labels were valid as of gcc 2.93. */
+#ifndef ATTRIBUTE_UNUSED_LABEL
+# if (GCC_VERSION >= 2093)
+# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
+# else
+# define ATTRIBUTE_UNUSED_LABEL
+# endif /* GNUC >= 2.93 */
+#endif /* ATTRIBUTE_UNUSED_LABEL */
+
+#ifndef ATTRIBUTE_UNUSED
+#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+#endif /* ATTRIBUTE_UNUSED */
+
+#ifndef ATTRIBUTE_NORETURN
+#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+#endif /* ATTRIBUTE_NORETURN */
+
+#ifndef ATTRIBUTE_PRINTF
+#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
+#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
+#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
+#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
+#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
+#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
+#endif /* ATTRIBUTE_PRINTF */
+
#endif /* ansidecl.h */
--- /dev/null
+/* An expandable hash tables datatype.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+ Contributed by Vladimir Makarov (vmakarov@cygnus.com).
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of 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.
+
+This program 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 a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* This package implements basic hash table functionality. It is possible
+ to search for an entry, create an entry and destroy an entry.
+
+ Elements in the table are generic pointers.
+
+ The size of the table is not fixed; if the occupancy of the table
+ grows too high the hash table will be expanded.
+
+ The abstract data implementation is based on generalized Algorithm D
+ from Knuth's book "The art of computer programming". Hash table is
+ expanded by creation of new hash table and transferring elements from
+ the old table to the new table. */
+
+#ifndef __HASHTAB_H__
+#define __HASHTAB_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <ansidecl.h>
+
+/* The hash table element is represented by the following type. */
+
+typedef const void *hash_table_entry_t;
+
+/* Hash tables are of the following type. The structure
+ (implementation) of this type is not needed for using the hash
+ tables. All work with hash table should be executed only through
+ functions mentioned below. */
+
+typedef struct hash_table
+{
+ /* Current size (in entries) of the hash table */
+ size_t size;
+ /* Current number of elements including also deleted elements */
+ size_t number_of_elements;
+ /* Current number of deleted elements in the table */
+ size_t number_of_deleted_elements;
+ /* The following member is used for debugging. Its value is number
+ of all calls of `find_hash_table_entry' for the hash table. */
+ int searches;
+ /* The following member is used for debugging. Its value is number
+ of collisions fixed for time of work with the hash table. */
+ int collisions;
+ /* Pointer to function for evaluation of hash value (any unsigned value).
+ This function has one parameter of type hash_table_entry_t. */
+ unsigned (*hash_function) PARAMS ((hash_table_entry_t));
+ /* Pointer to function for test on equality of hash table elements (two
+ parameter of type hash_table_entry_t. */
+ int (*eq_function) PARAMS ((hash_table_entry_t, hash_table_entry_t));
+ /* Table itself */
+ hash_table_entry_t *entries;
+} *hash_table_t;
+
+
+/* The prototypes of the package functions. */
+
+extern hash_table_t create_hash_table
+ PARAMS ((size_t, unsigned (*) (hash_table_entry_t),
+ int (*) (hash_table_entry_t, hash_table_entry_t)));
+
+extern void delete_hash_table PARAMS ((hash_table_t));
+
+extern void empty_hash_table PARAMS ((hash_table_t));
+
+extern hash_table_entry_t *find_hash_table_entry
+ PARAMS ((hash_table_t, hash_table_entry_t, int));
+
+extern void remove_element_from_hash_table_entry PARAMS ((hash_table_t,
+ hash_table_entry_t));
+
+extern void clear_hash_table_slot PARAMS ((hash_table_t, hash_table_entry_t *));
+
+extern void traverse_hash_table PARAMS ((hash_table_t,
+ int (*) (hash_table_entry_t, void *),
+ void *));
+
+extern size_t hash_table_size PARAMS ((hash_table_t));
+
+extern size_t hash_table_elements_number PARAMS ((hash_table_t));
+
+extern int hash_table_collisions PARAMS ((hash_table_t));
+
+extern int all_hash_table_collisions PARAMS ((void));
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __HASHTAB_H */
/* Build an argument vector from a string. Allocates memory using
malloc. Use freeargv to free the vector. */
-extern char **buildargv PARAMS ((char *));
+extern char **buildargv PARAMS ((char *)) ATTRIBUTE_MALLOC;
/* Free a vector returned by buildargv. */
/* Duplicate an argument vector. Allocates memory using malloc. Use
freeargv to free the vector. */
-extern char **dupargv PARAMS ((char **));
+extern char **dupargv PARAMS ((char **)) ATTRIBUTE_MALLOC;
/* Return the last component of a path name. Note that we can't use a
across different systems, sometimes as "char *" and sometimes as
"const char *" */
-#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__)
+#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__)
extern char *basename PARAMS ((const char *));
#else
extern char *basename ();
/* Concatenate an arbitrary number of strings, up to (char *) NULL.
Allocates memory using xmalloc. */
-extern char *concat PARAMS ((const char *, ...));
+extern char *concat PARAMS ((const char *, ...)) ATTRIBUTE_MALLOC;
/* Check whether two file descriptors refer to the same file. */
extern int fdmatch PARAMS ((int fd1, int fd2));
+/* Get the working directory. The result is cached, so don't call
+ chdir() between calls to getpwd(). */
+
+extern char * getpwd PARAMS ((void));
+
/* Get the amount of time the process has run, in microseconds. */
extern long get_run_time PARAMS ((void));
/* Choose a temporary directory to use for scratch files. */
-extern char *choose_temp_base PARAMS ((void));
+extern char *choose_temp_base PARAMS ((void)) ATTRIBUTE_MALLOC;
+
+/* Return a temporary file name or NULL if unable to create one. */
+
+extern char *make_temp_file PARAMS ((const char *)) ATTRIBUTE_MALLOC;
/* Allocate memory filled with spaces. Allocates using malloc. */
/* Exit, calling all the functions registered with xatexit. */
-#ifndef __GNUC__
-extern void xexit PARAMS ((int status));
-#else
-void xexit PARAMS ((int status)) __attribute__ ((noreturn));
-#endif
+extern void xexit PARAMS ((int status)) ATTRIBUTE_NORETURN;
/* Set the program name used by xmalloc. */
#ifdef ANSI_PROTOTYPES
/* Get a definition for size_t. */
#include <stddef.h>
+/* Get a definition for va_list. */
+#include <stdarg.h>
#endif
-extern PTR xmalloc PARAMS ((size_t));
-
-/* Reallocate memory without fail. This works like xmalloc.
+extern PTR xmalloc PARAMS ((size_t)) ATTRIBUTE_MALLOC;
- FIXME: We do not declare the parameter types for the same reason as
- xmalloc. */
+/* Reallocate memory without fail. This works like xmalloc. Note,
+ realloc type functions are not suitable for attribute malloc since
+ they may return the same address across multiple calls. */
extern PTR xrealloc PARAMS ((PTR, size_t));
/* Allocate memory without fail and set it to zero. This works like
xmalloc. */
-extern PTR xcalloc PARAMS ((size_t, size_t));
+extern PTR xcalloc PARAMS ((size_t, size_t)) ATTRIBUTE_MALLOC;
/* Copy a string into a memory buffer without fail. */
-extern char *xstrdup PARAMS ((const char *));
+extern char *xstrdup PARAMS ((const char *)) ATTRIBUTE_MALLOC;
+
+/* Copy an existing memory buffer to a new memory buffer without fail. */
+
+extern PTR xmemdup PARAMS ((const PTR, size_t, size_t)) ATTRIBUTE_MALLOC;
/* hex character manipulation routines */
extern int pwait PARAMS ((int, int *, int));
+/* Like sprintf but provides a pointer to malloc'd storage, which must
+ be freed by the caller. */
+
+extern int asprintf PARAMS ((char **, const char *, ...)) ATTRIBUTE_PRINTF_2;
+
+/* Like vsprintf but provides a pointer to malloc'd storage, which
+ must be freed by the caller. */
+
+extern int vasprintf PARAMS ((char **, const char *, va_list))
+ ATTRIBUTE_PRINTF(2,0);
+
#ifdef __cplusplus
}
#endif
#if defined _LIBC || defined HAVE_STRING_H
# include <string.h>
-# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+# if defined __STDC__ && __STDC__
+# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+# else
+# define _obstack_memcpy(To, From, N) memcpy ((To), (char *)(From), (N))
+# endif
#else
# ifdef memcpy
-# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+# define _obstack_memcpy(To, From, N) memcpy ((To), (char *)(From), (N))
# else
-# define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N))
+# define _obstack_memcpy(To, From, N) bcopy ((char *)(From), (To), (N))
# endif
#endif
int __len = (length); \
if (__o->next_free + __len > __o->chunk_limit) \
_obstack_newchunk (__o, __len); \
- _obstack_memcpy (__o->next_free, (char *) (where), __len); \
+ _obstack_memcpy (__o->next_free, (where), __len); \
__o->next_free += __len; \
(void) 0; })
int __len = (length); \
if (__o->next_free + __len + 1 > __o->chunk_limit) \
_obstack_newchunk (__o, __len + 1); \
- _obstack_memcpy (__o->next_free, (char *) (where), __len); \
+ _obstack_memcpy (__o->next_free, (where), __len); \
__o->next_free += __len; \
*(__o->next_free)++ = 0; \
(void) 0; })
( (h)->temp = (length), \
(((h)->next_free + (h)->temp > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
- _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
+ _obstack_memcpy ((h)->next_free, (where), (h)->temp), \
(h)->next_free += (h)->temp)
# define obstack_grow0(h,where,length) \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \
- _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
+ _obstack_memcpy ((h)->next_free, (where), (h)->temp), \
(h)->next_free += (h)->temp, \
*((h)->next_free)++ = 0)
typedef unsigned long int splay_tree_value;
/* Forward declaration for a node in the tree. */
-typedef struct splay_tree_node *splay_tree_node;
+typedef struct splay_tree_node_s *splay_tree_node;
/* The type of a function which compares two splay-tree keys. The
function should return values as for qsort. */
typedef int (*splay_tree_foreach_fn) PARAMS((splay_tree_node, void*));
/* The nodes in the splay tree. */
-struct splay_tree_node
+struct splay_tree_node_s
{
/* The key. */
splay_tree_key key;
};
/* The splay tree itself. */
-typedef struct splay_tree
+typedef struct splay_tree_s
{
/* The root of the tree. */
splay_tree_node root;
splay_tree_delete_key_fn,
splay_tree_delete_value_fn));
extern void splay_tree_delete PARAMS((splay_tree));
-extern void splay_tree_insert PARAMS((splay_tree,
+extern splay_tree_node splay_tree_insert
+ PARAMS((splay_tree,
splay_tree_key,
splay_tree_value));
extern splay_tree_node splay_tree_lookup
/* Symbol concatenation utilities.
- Copyright (C) 1998, Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#define CONCAT2(a,b) a/**/b
#define CONCAT3(a,b,c) a/**/b/**/c
#define CONCAT4(a,b,c,d) a/**/b/**/c/**/d
-#define STRINGX(s) "?"
+#define STRINGX(s) "s"
#endif
#define XCONCAT2(a,b) CONCAT2(a,b)