public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gdb] gdb-17.2-rebase-f44: further reduce the size of gdb-6.6-buildid-locate.patch
@ 2026-06-28  0:01 Andrew Burgess
  0 siblings, 0 replies; only message in thread
From: Andrew Burgess @ 2026-06-28  0:01 UTC (permalink / raw)
  To: git-commits

            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.

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-28  0:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-28  0:01 [rpms/gdb] gdb-17.2-rebase-f44: further reduce the size of gdb-6.6-buildid-locate.patch Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox