Use htab_eq_string in binutils
authorAlan Modra <amodra@gmail.com>
Sun, 9 May 2021 02:58:18 +0000 (12:28 +0930)
committerAlan Modra <amodra@gmail.com>
Sun, 9 May 2021 02:58:18 +0000 (12:28 +0930)
A quick check says this is the only place in all of bfd, opcodes,
binutils, gas, ld, gprof that duplicates the new libiberty
htab_eq_string.

* objcopy.c (eq_string): Delete.
(create_symbol_htab): Use htab_eq_string.

binutils/ChangeLog
binutils/objcopy.c

index 88cbccda2689c787567fe8926187f7e3bcc5cccd..302629794c0b010ff0df1575e5aabf7b0957b977 100644 (file)
@@ -1,3 +1,8 @@
+2021-05-09  Alan Modra  <amodra@gmail.com>
+
+       * objcopy.c (eq_string): Delete.
+       (create_symbol_htab): Use htab_eq_string.
+
 2021-05-08  Mike Frysinger  <vapier@gentoo.org>
 
        * README-how-to-make-a-release: Update html & pdf entries.
index 946802ebb78831e6463315d2bbcf7f57cf643b34..a6c2e0dcc26a497c5de4710e476bb5a4cecbfede 100644 (file)
@@ -1025,18 +1025,11 @@ create_symbol2redef_htab (void)
                            xcalloc, free);
 }
 
-/* There is htab_hash_string but no htab_eq_string. Makes sense.  */
-
-static int
-eq_string (const void *s1, const void *s2)
-{
-  return strcmp ((const char *) s1, (const char *) s2) == 0;
-}
-
 static htab_t
 create_symbol_htab (void)
 {
-  return htab_create_alloc (16, htab_hash_string, eq_string, NULL, xcalloc, free);
+  return htab_create_alloc (16, htab_hash_string, htab_eq_string, NULL,
+                           xcalloc, free);
 }
 
 static void