]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
libiberty: sync with gcc
authorMaciej W. Rozycki <macro@redhat.com>
Tue, 13 Jan 2026 00:48:28 +0000 (00:48 +0000)
committerMaciej W. Rozycki <macro@redhat.com>
Tue, 13 Jan 2026 00:56:13 +0000 (00:56 +0000)
Import the following commits from GCC as of r16-6728-g7c3584be8c8806:
07df546fb90 libiberty/testsuite: make test-pexecute's -t option a little more useful
0c775dcf3e7 libiberty: Make `objalloc_free' `free'-like WRT null pointer

libiberty/ChangeLog
libiberty/objalloc.c
libiberty/testsuite/test-pexecute.c

index 37c351d33f5f14d28c94723df7af1212274929c4..95dce963f564d6c6cad2c121cb1c1ef6cdca36ac 100644 (file)
@@ -1,3 +1,12 @@
+2026-01-12  Maciej W. Rozycki  <macro@redhat.com>
+
+       * objalloc.c (objalloc_free): Don't use the pointer passed if
+       null.
+
+2026-01-09  Jan Beulich  <jbeulich@suse.com>
+
+       * testsuite/test-pexecute.c (main): Adjust a tracing fprintf().
+
 2025-11-30  Jose E. Marchesi  <jose.marchesi@oracle.com>
 
        * simple-object-mach-o.c
index 263d4b67a986ddf049d727f43a50ddce0eb8d4e1..b3b255a1d65bdbbc8611a32ac7aaefd159875314 100644 (file)
@@ -178,6 +178,10 @@ objalloc_free (struct objalloc *o)
 {
   struct objalloc_chunk *l;
 
+  /* Handle a nullptr as being a no-op. */
+  if (o == NULL)
+    return;
+
   l = (struct objalloc_chunk *) o->chunks;
   while (l != NULL)
     {
index 3aaf268bdfebaf9f99dc3f818bbfd53c3c1baa6c..b0e2c9904bac2255bdc069b2769c4858eb99cb56 100644 (file)
@@ -211,7 +211,7 @@ main (int argc, char **argv)
       const char *pex_run_err;                                         \
       if (trace)                                                       \
        fprintf (stderr, "Line %d: running %s %s\n",                    \
-                __LINE__, EXECUTABLE, ARGV[0]);                        \
+                __LINE__, EXECUTABLE, ARGV[1]);                        \
       pex_run_err = pex_run (PEXOBJ, FLAGS, EXECUTABLE, ARGV, OUTNAME, \
                             ERRNAME, &err);                            \
       if (pex_run_err != NULL)                                         \