From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87023 invoked by alias); 8 Feb 2020 15:40:35 -0000 Mailing-List: contact glibc-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: glibc-cvs-owner@sourceware.org List-Subscribe: Received: (qmail 87005 invoked by uid 9299); 8 Feb 2020 15:40:34 -0000 Date: Sat, 08 Feb 2020 15:40:00 -0000 Message-ID: <20200208154034.87004.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc/fw/bug25486] Remove weak declaration of free from X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/fw/bug25486 X-Git-Oldrev: 68608ef426b88e73e0e3178497bcfe34dd8a66ef X-Git-Newrev: c1cfeffdf9edaf3ffd8259aa43de17b75737984c X-SW-Source: 2020-q1/txt/msg00274.txt https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c1cfeffdf9edaf3ffd8259aa43de17b75737984c commit c1cfeffdf9edaf3ffd8259aa43de17b75737984c Author: Florian Weimer Date: Sat Feb 8 16:15:09 2020 +0100 Remove weak declaration of free from elf/dl-minimal.c provides a definition of free, so the function pointer is always non-null, even before the final relocation of the loader. Diff: --- include/inline-hashtab.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/include/inline-hashtab.h b/include/inline-hashtab.h index d25bb95..3c09978 100644 --- a/include/inline-hashtab.h +++ b/include/inline-hashtab.h @@ -25,8 +25,6 @@ #ifndef INLINE_HASHTAB_H # define INLINE_HASHTAB_H 1 -extern void weak_function free (void *ptr); - struct hashtab { /* Table itself. */ @@ -56,8 +54,7 @@ htab_create (void) ht->free = free; if (! ht->entries) { - if (ht->free) - ht->free (ht); + free (ht); return NULL; } @@ -78,8 +75,7 @@ htab_delete (struct hashtab *htab) for (i = htab->size - 1; i >= 0; i--) free (htab->entries[i]); - if (htab->free) - htab->free (htab->entries); + htab->free (htab->entries); free (htab); } @@ -167,8 +163,7 @@ htab_expand (struct hashtab *htab, int (*hash_fn) (void *)) allocated early as long as there's no corresponding free(), but this isn't so much memory as to be significant. */ - if (htab->free) - htab->free (oentries); + htab->free (oentries); /* Use the free() corresponding to the malloc() above to free this up. */