From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1039) id F3FAA3858D34; Sat, 6 Apr 2024 12:07:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F3FAA3858D34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712405273; bh=3Gu1JPhm2VuwQSg0bhVAW4E47PvShCBM5vJgHx3IKLw=; h=From:To:Subject:Date:From; b=uxjdlNShLtZolP5xwta5Ds2MPQX2SMgouZOV2c5ZW7thPznJWy8c8AydW75XKpN1I /ciuew8pX/IGwBlxZrJpDzL4UO3NLEo9Kvs1Psv5urYNvJ7G5AzZ8Nc6VqYz4DSael xshjPcjxLqCEfhENC9es45Jj+Ij2FZzv9Ge3C9YU= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: H.J. Lu To: binutils-cvs@sourceware.org Subject: [binutils-gdb] elf: Call bfd_malloc instead xmalloc X-Act-Checkin: binutils-gdb X-Git-Author: H.J. Lu X-Git-Refname: refs/heads/master X-Git-Oldrev: cca46dea4d09fc9d9896e952242b3e8f5baa506a X-Git-Newrev: c411ee988375f8e7069c8ab408a7835a261d80d5 Message-Id: <20240406120752.F3FAA3858D34@sourceware.org> Date: Sat, 6 Apr 2024 12:07:52 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dc411ee988375= f8e7069c8ab408a7835a261d80d5 commit c411ee988375f8e7069c8ab408a7835a261d80d5 Author: H.J. Lu Date: Fri Apr 5 17:10:24 2024 -0700 elf: Call bfd_malloc instead xmalloc =20 * elflink.c (elf_link_add_object_symbols): Call bfd_malloc instead of xmalloc. Diff: --- bfd/elflink.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bfd/elflink.c b/bfd/elflink.c index dadac2522d5..c73470276cd 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -4378,12 +4378,13 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_= link_info *info) { /* Initialize first_hash for an IR input. */ htab->first_hash =3D (struct bfd_hash_table *) - xmalloc (sizeof (struct bfd_hash_table)); - if (!bfd_hash_table_init - (htab->first_hash, elf_link_first_hash_newfunc, - sizeof (struct elf_link_first_hash_entry))) + bfd_malloc (sizeof (struct bfd_hash_table)); + if (htab->first_hash =3D=3D NULL + || !bfd_hash_table_init + (htab->first_hash, elf_link_first_hash_newfunc, + sizeof (struct elf_link_first_hash_entry))) info->callbacks->einfo - (_("%F%P: first_hash failed to initialize: %E\n")); + (_("%F%P: first_hash failed to create: %E\n")); } } else