public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/gdb] gdb-17.2-rebase-f44: further reduce the size of gdb-6.6-buildid-locate.patch
Date: Sun, 28 Jun 2026 00:01:34 GMT	[thread overview]
Message-ID: <178260489414.1.5197507404440058844.rpms-gdb-f379362127c0@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/gdb
            Branch : gdb-17.2-rebase-f44
            Commit : f379362127c04a01d481de17ff72f24c568c7e5f
            Author : Andrew Burgess <aburgess@redhat.com>
            Date   : 2024-03-14T10:15:49+00:00
            Stats  : +5/-25 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/gdb/c/f379362127c04a01d481de17ff72f24c568c7e5f?branch=gdb-17.2-rebase-f44

            Log:
            further reduce the size of gdb-6.6-buildid-locate.patch

While working on the Fedora tree I noticed that the patch
gdb-6.6-buildid-locate introduces some unnecessary casts into
bfd/libbfd-in.h (and consequently bfd/libbfd.h).  These are casts that
cast the result of a call to bfd_malloc, which is a wrapper around
malloc, the cast is converting void* to char*.

In C such a cast is not necessary, and there are plenty of places
where the result of bfd_malloc is not explicitly cast, so I see no
reason why we should carry this one additional cast around in the
Fedora GDB tree.

In this commit I remove the cast, reducing the size of the
gdb-6.6-buildid-locate.patch slightly.  This reduces the chance of
merge conflicts, and so makes the Fedora GDB tree slightly easier to
maintain.

There should be no changes in the functionality of a Fedora GDB build
after this commit.

---
diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch
index 706fa34..833eb70 100644
--- a/gdb-6.6-buildid-locate.patch
+++ b/gdb-6.6-buildid-locate.patch
@@ -6,30 +6,6 @@ Subject: gdb-6.6-buildid-locate.patch
 ;; New locating of the matching binaries from the pure core file (build-id).
 ;;=push+jan
 
-diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
---- a/bfd/libbfd-in.h
-+++ b/bfd/libbfd-in.h
-@@ -110,7 +110,7 @@ static inline char *
- bfd_strdup (const char *str)
- {
-   size_t len = strlen (str) + 1;
--  char *buf = bfd_malloc (len);
-+  char *buf = (char *) bfd_malloc (len);
-   if (buf != NULL)
-     memcpy (buf, str, len);
-   return buf;
-diff --git a/bfd/libbfd.h b/bfd/libbfd.h
---- a/bfd/libbfd.h
-+++ b/bfd/libbfd.h
-@@ -116,7 +116,7 @@ static inline char *
- bfd_strdup (const char *str)
- {
-   size_t len = strlen (str) + 1;
--  char *buf = bfd_malloc (len);
-+  char *buf = (char *) bfd_malloc (len);
-   if (buf != NULL)
-     memcpy (buf, str, len);
-   return buf;
 diff --git a/gdb/build-id.c b/gdb/build-id.c
 --- a/gdb/build-id.c
 +++ b/gdb/build-id.c

diff --git a/gdb.spec b/gdb.spec
index 65f720c..19f8323 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -57,7 +57,7 @@ Version: 14.2
 
 # The release always contains a leading reserved number, start it at 1.
 # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
-Release: 2%{?dist}
+Release: 3%{?dist}
 
 License: GPL-3.0-or-later AND BSD-3-Clause AND FSFAP AND LGPL-2.1-or-later AND GPL-2.0-or-later AND LGPL-2.0-or-later AND LicenseRef-Fedora-Public-Domain AND GFDL-1.3-or-later AND LGPL-2.0-or-later WITH GCC-exception-2.0 AND GPL-3.0-or-later WITH GCC-exception-3.1 AND GPL-2.0-or-later WITH GNU-compiler-exception
 # Do not provide URL for snapshots as the file lasts there only for 2 days.
@@ -1251,6 +1251,10 @@ fi
 
 %changelog
 * Fri Mar  8 2024 Andrew Burgess <aburgess@redhat.com>
+- Reduce gdb-6.6-buildid-locate.patch by removing some unnecessary
+  casts added to bfd/ source files.
+
+* Fri Mar  8 2024 Andrew Burgess <aburgess@redhat.com>
 - Reduce gdb-6.6-buildid-locate.patch by removing the build_id_bfd_get
   to build_id_bfd_shdr_get change.  This was only changing the name of
   a function, so seems pointless.

                 reply	other threads:[~2026-06-28  0:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178260489414.1.5197507404440058844.rpms-gdb-f379362127c0@fedoraproject.org \
    --to=aburgess@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox