It's (PCH) merging time!

Geoff Keating geoffk@geoffk.org
Tue Jun 4 12:16:00 GMT 2002


> Date: Tue, 4 Jun 2002 13:57:42 -0400
> From: DJ Delorie <dj@redhat.com>
> CC: gcc-patches@gcc.gnu.org
> 
> 
> > Careful inspection of the source that used libiberty indicated that no
> > code was using the removed functions.
> 
> bfd uses htab_create().  Since bfd and libiberty are often built and
> installed as shared libraries (whether we support that or not),
> changing a function from a real entry point to a #define may cause
> problems.  It's OK to *add* a #define to speed up the code, but not OK
> to remove a real function from libiberty.a.

OK.  So, how about this patch?  Or should I put these functions in a
separate file so that statically-linked programs are not bloated?

-- 
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>

===File ~/patches/cygnus/pch-libibertyback.patch============
2002-06-04  Geoffrey Keating  <geoffk@redhat.com>

	* hashtab.c (htab_create): New stub function for backwards
	binary compatibility.
	(htab_try_create): Likewise.

Index: hashtab.c
===================================================================
RCS file: /cvs/gcc/gcc/libiberty/hashtab.c,v
retrieving revision 1.27
diff -p -u -p -r1.27 hashtab.c
--- hashtab.c	4 Jun 2002 07:11:05 -0000	1.27
+++ hashtab.c	4 Jun 2002 19:15:17 -0000
@@ -191,6 +191,32 @@ htab_create_alloc (size, hash_f, eq_f, d
   return result;
 }
 
+/* These functions exist solely for backwards binary compatibility.  */
+
+#undef htab_create
+extern htab_t htab_create PARAMS ((size_t, htab_hash, htab_eq, htab_del));
+extern htab_t htab_try_create PARAMS ((size_t, htab_hash, htab_eq, htab_del));
+
+htab_t
+htab_create (size, hash_f, eq_f, del_f)
+     size_t size;
+     htab_hash hash_f;
+     htab_eq eq_f;
+     htab_del del_f;
+{
+  return htab_create_alloc (size, hash_f, eq_f, del_f, xcalloc, free);
+}
+
+htab_t
+htab_try_create (size, hash_f, eq_f, del_f)
+     size_t size;
+     htab_hash hash_f;
+     htab_eq eq_f;
+     htab_del del_f;
+{
+  return htab_create_alloc (size, hash_f, eq_f, del_f, calloc, free);
+}
+
 /* This function frees all memory allocated for given hash table.
    Naturally the hash table must already exist. */
 
============================================================



More information about the Gcc-patches mailing list