From: Maciej W. Rozycki Date: Tue, 13 Jan 2026 00:48:28 +0000 (+0000) Subject: libiberty: sync with gcc X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90e5645309be72f8970213a0c8704f739e1bac11;p=thirdparty%2Fbinutils-gdb.git libiberty: sync with gcc 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 --- diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 37c351d33f5..95dce963f56 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,12 @@ +2026-01-12 Maciej W. Rozycki + + * objalloc.c (objalloc_free): Don't use the pointer passed if + null. + +2026-01-09 Jan Beulich + + * testsuite/test-pexecute.c (main): Adjust a tracing fprintf(). + 2025-11-30 Jose E. Marchesi * simple-object-mach-o.c diff --git a/libiberty/objalloc.c b/libiberty/objalloc.c index 263d4b67a98..b3b255a1d65 100644 --- a/libiberty/objalloc.c +++ b/libiberty/objalloc.c @@ -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) { diff --git a/libiberty/testsuite/test-pexecute.c b/libiberty/testsuite/test-pexecute.c index 3aaf268bdfe..b0e2c9904ba 100644 --- a/libiberty/testsuite/test-pexecute.c +++ b/libiberty/testsuite/test-pexecute.c @@ -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) \