From b05a0fc79b9eed659cf52b4706f11700b92ae4af Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sun, 9 May 2021 12:28:18 +0930 Subject: [PATCH] Use htab_eq_string in binutils 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 | 5 +++++ binutils/objcopy.c | 11 ++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 88cbccda268..302629794c0 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2021-05-09 Alan Modra + + * objcopy.c (eq_string): Delete. + (create_symbol_htab): Use htab_eq_string. + 2021-05-08 Mike Frysinger * README-how-to-make-a-release: Update html & pdf entries. diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 946802ebb78..a6c2e0dcc26 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -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 -- 2.30.2