diff --git a/binutils-gprofng-gcc15-fixes.patch b/binutils-gprofng-gcc15-fixes.patch new file mode 100644 index 0000000..5e4b73c --- /dev/null +++ b/binutils-gprofng-gcc15-fixes.patch @@ -0,0 +1,1067 @@ +diff -rup fred/gprofng/common/hwcentry.h binutils-2.41/gprofng/common/hwcentry.h +--- fred/gprofng/common/hwcentry.h 2026-02-26 10:57:17.827404618 +0000 ++++ binutils-2.41/gprofng/common/hwcentry.h 2026-02-26 13:25:33.203776043 +0000 +@@ -202,7 +202,7 @@ extern "C" + /* Return a CPU HWC document reference, or NULL. */ + + // TBR +- extern char *hwc_get_default_cntrs (); ++ extern char *hwc_get_default_cntrs (void); + /* Return a default HW counter string; may be NULL, or zero-length */ + /* NULL means none is defined in the table; or zero-length means string defined could not be loaded */ + +@@ -211,7 +211,7 @@ extern "C" + /* but allows other styles of formatting as well */ + /* deprecate and eventually remove hwc_get_default_cntrs() */ + +- extern char *hwc_get_orig_default_cntrs (); ++ extern char *hwc_get_orig_default_cntrs (int); + /* Get the default HW counter string as set in the table */ + /* NULL means none is defined in the table */ + +@@ -221,7 +221,7 @@ extern "C" + extern char *hwc_get_cpuname (char *buf, size_t buflen); + /* Return the cpc cpu name for this system, or NULL. */ + +- extern unsigned hwc_get_max_regs (); ++ extern unsigned hwc_get_max_regs (void); + /* Return number of counters registers for this system. */ + + extern unsigned hwc_get_max_concurrent (int forKernel); +diff -rup fred/gprofng/common/hwctable.c binutils-2.41/gprofng/common/hwctable.c +--- fred/gprofng/common/hwctable.c 2026-02-26 10:57:17.827404618 +0000 ++++ binutils-2.41/gprofng/common/hwctable.c 2026-02-26 13:25:34.765783400 +0000 +@@ -3195,7 +3195,7 @@ check_tables () + } + #endif + +-static int try_a_counter (); ++static int try_a_counter (int); + static void hwc_process_raw_ctrs (int forKernel, Hwcentry ***pstd_out, + Hwcentry ***praw_out, Hwcentry ***phidden_out, + Hwcentry**static_tables, +@@ -4288,7 +4288,7 @@ hwc_get_docref (char *buf, size_t buflen + //TBR: + + extern char* +-hwc_get_default_cntrs () ++hwc_get_default_cntrs (void) + { + setup_cpcx (); + if (cpcx_default_hwcs[0] != NULL) +@@ -4579,7 +4579,7 @@ hwc_hwcentry_specd_string (char *buf, si + } + + unsigned +-hwc_get_max_regs () ++hwc_get_max_regs (void) + { + setup_cpcx (); + return cpcx_npics; +diff -rup fred/gprofng/libcollector/collector.c binutils-2.41/gprofng/libcollector/collector.c +--- fred/gprofng/libcollector/collector.c 2026-02-26 10:57:17.827982759 +0000 ++++ binutils-2.41/gprofng/libcollector/collector.c 2026-02-26 13:04:55.192049204 +0000 +@@ -1584,7 +1584,7 @@ __collector_resume_experiment () + } + + /* Code to support Samples and Pause/Resume */ +-void collector_sample () __attribute__ ((weak, alias ("__collector_sample"))); ++void collector_sample (char *) __attribute__ ((weak, alias ("__collector_sample"))); + void + __collector_sample (char *name) + { +@@ -1784,7 +1784,7 @@ __collector_pause () + } + + void +-__collector_pause_m (char *reason) ++__collector_pause_m (const char *reason) + { + hrtime_t now; + char xreason[MAXPATHLEN]; +@@ -2451,8 +2451,8 @@ __collector_dlog (int tflag, int level, + + static void (*__real__exit) (int status) = NULL; /* libc only: _exit */ + static void (*__real__Exit) (int status) = NULL; /* libc only: _Exit */ +-void _exit () __attribute__ ((weak, alias ("__collector_exit"))); +-void _Exit () __attribute__ ((weak, alias ("__collector_Exit"))); ++void _exit (int) __attribute__ ((weak, alias ("__collector_exit"))); ++void _Exit (int) __attribute__ ((weak, alias ("__collector_Exit"))); + + void + __collector_exit (int status) +diff -rup fred/gprofng/libcollector/collector.h binutils-2.41/gprofng/libcollector/collector.h +--- fred/gprofng/libcollector/collector.h 2026-02-26 10:57:17.827982759 +0000 ++++ binutils-2.41/gprofng/libcollector/collector.h 2026-02-26 11:15:04.726908530 +0000 +@@ -122,9 +122,9 @@ extern void __collector_close_experiment + extern void __collector_terminate_expt (); + extern void __collector_terminate_hook (); + extern void __collector_sample (char *name); +-extern void __collector_pause (); +-extern void __collector_pause_m (); +-extern void __collector_resume (); ++extern void __collector_pause (void); ++extern void __collector_pause_m (const char *); ++extern void __collector_resume (void); + extern int collector_sigemt_sigaction (const struct sigaction*, + struct sigaction*); + extern int collector_sigchld_sigaction (const struct sigaction*, +diff -rup fred/gprofng/libcollector/collectorAPI.c binutils-2.41/gprofng/libcollector/collectorAPI.c +--- fred/gprofng/libcollector/collectorAPI.c 2026-02-26 10:57:17.827982759 +0000 ++++ binutils-2.41/gprofng/libcollector/collectorAPI.c 2026-02-26 13:14:07.392589154 +0000 +@@ -26,16 +26,16 @@ + #include "collectorAPI.h" + #include "gp-experiment.h" + +-static void *__real_collector_sample = NULL; +-static void *__real_collector_pause = NULL; +-static void *__real_collector_resume = NULL; +-static void *__real_collector_terminate_expt = NULL; +-static void *__real_collector_func_load = NULL; +-static void *__real_collector_func_unload = NULL; ++static void (*__real_collector_sample)(const char *) = NULL; ++static void (*__real_collector_pause)(void) = NULL; ++static void (*__real_collector_resume)(void) = NULL; ++static void (*__real_collector_terminate_expt)(void) = NULL; ++static void (*__real_collector_func_load)(const char *, const char *, const char *, void *, int, int, Lineno *) = NULL; ++static void (*__real_collector_func_unload)(void *) = NULL; + + #define INIT_API if (init_API == 0) collectorAPI_initAPI() + #define NULL_PTR(x) (__real_##x == NULL) +-#define CALL_REAL(x) (*(void(*)())__real_##x) ++#define CALL_REAL(x) (__real_##x) + #define CALL_IF_REAL(x) INIT_API; if (!NULL_PTR(x)) CALL_REAL(x) + + static int init_API = 0; +diff -rup fred/gprofng/libcollector/dispatcher.c binutils-2.41/gprofng/libcollector/dispatcher.c +--- fred/gprofng/libcollector/dispatcher.c 2026-02-26 10:57:17.827982759 +0000 ++++ binutils-2.41/gprofng/libcollector/dispatcher.c 2026-02-26 11:20:42.432640350 +0000 +@@ -909,8 +909,8 @@ sigset (int sig, sighandler_t handler) + + // map interposed symbol versions + static int +-gprofng_timer_create (int (real_func) (), clockid_t clockid, +- struct sigevent *sevp, timer_t *timerid) ++gprofng_timer_create (int (real_func) (clockid_t, struct sigevent *, timer_t *), ++ clockid_t clockid, struct sigevent *sevp, timer_t *timerid) + { + // collector reserves SIGPROF + if (sevp == NULL || sevp->sigev_notify != SIGEV_SIGNAL || +@@ -1045,7 +1045,7 @@ __collector_thr_sigsetmask (int how, con + // map interposed symbol versions + + static int +-gprofng_pthread_sigmask (int (real_func) (), ++gprofng_pthread_sigmask (int (real_func) (int how, const sigset_t *, sigset_t*), + int how, const sigset_t *iset, sigset_t* oset) + { + sigset_t lsigset; +@@ -1140,7 +1140,8 @@ collector_root (void *cargs) + // map interposed symbol versions + + static int +-gprofng_pthread_create (int (real_func) (), pthread_t *thread, ++gprofng_pthread_create (int (real_func) (pthread_t *, const pthread_attr_t *, void *(*)(void*), void *), ++ pthread_t *thread, + const pthread_attr_t *attr, + void *(*func)(void*), void *arg) + { +@@ -1277,6 +1278,6 @@ __collector_ext_clone_pthread (int (*fn) + } + + // weak symbols: +-int sigprocmask () __attribute__ ((weak, alias ("__collector_sigprocmask"))); +-int thr_sigsetmask () __attribute__ ((weak, alias ("__collector_thr_sigsetmask"))); +-int setitimer () __attribute__ ((weak, alias ("_setitimer"))); ++int sigprocmask (int, const sigset_t *, sigset_t *) __attribute__ ((weak, alias ("__collector_sigprocmask"))); ++int thr_sigsetmask (int, const sigset_t *, sigset_t *) __attribute__ ((weak, alias ("__collector_thr_sigsetmask"))); ++int setitimer (__itimer_which_t, const struct itimerval *, struct itimerval *) __attribute__ ((weak, alias ("_setitimer"))); +diff -rup fred/gprofng/libcollector/envmgmt.c binutils-2.41/gprofng/libcollector/envmgmt.c +--- fred/gprofng/libcollector/envmgmt.c 2026-02-26 10:57:17.827982759 +0000 ++++ binutils-2.41/gprofng/libcollector/envmgmt.c 2026-02-26 11:47:12.920154541 +0000 +@@ -692,8 +692,8 @@ __collector_env_update (char *envp[]) + + + /*------------------------------------------------------------- putenv */ +-int putenv () __attribute__ ((weak, alias ("__collector_putenv"))); +-int _putenv () __attribute__ ((weak, alias ("__collector_putenv"))); ++int putenv (char *) __attribute__ ((weak, alias ("__collector_putenv"))); ++int _putenv (char *) __attribute__ ((weak, alias ("__collector_putenv"))); + + int + __collector_putenv (char * string) +@@ -701,9 +701,9 @@ __collector_putenv (char * string) + if (CALL_UTIL (putenv) == __collector_putenv || + CALL_UTIL (putenv) == NULL) + { // __collector_libc_funcs_init failed +- CALL_UTIL (putenv) = (int(*)())dlsym (RTLD_NEXT, "putenv"); ++ CALL_UTIL (putenv) = (int(*)(char *))dlsym (RTLD_NEXT, "putenv"); + if (CALL_UTIL (putenv) == NULL || CALL_UTIL (putenv) == __collector_putenv) +- CALL_UTIL (putenv) = (int(*)())dlsym (RTLD_DEFAULT, "putenv"); ++ CALL_UTIL (putenv) = (int(*)(char *))dlsym (RTLD_DEFAULT, "putenv"); + if (CALL_UTIL (putenv) == NULL || CALL_UTIL (putenv) == __collector_putenv) + { + TprintfT (DBG_LT2, "__collector_putenv(): ERROR: no pointer found.\n"); +@@ -719,8 +719,8 @@ __collector_putenv (char * string) + } + + /*------------------------------------------------------------- setenv */ +-int setenv () __attribute__ ((weak, alias ("__collector_setenv"))); +-int _setenv () __attribute__ ((weak, alias ("__collector_setenv"))); ++int setenv (const char *, const char *, int) __attribute__ ((weak, alias ("__collector_setenv"))); ++int _setenv (const char *, const char *, int) __attribute__ ((weak, alias ("__collector_setenv"))); + + int + __collector_setenv (const char *name, const char *value, int overwrite) +@@ -728,9 +728,9 @@ __collector_setenv (const char *name, co + if (CALL_UTIL (setenv) == __collector_setenv || + CALL_UTIL (setenv) == NULL) + { // __collector_libc_funcs_init failed +- CALL_UTIL (setenv) = (int(*)())dlsym (RTLD_NEXT, "setenv"); ++ CALL_UTIL (setenv) = (int(*)(const char *, const char *, int))dlsym (RTLD_NEXT, "setenv"); + if (CALL_UTIL (setenv) == NULL || CALL_UTIL (setenv) == __collector_setenv) +- CALL_UTIL (setenv) = (int(*)())dlsym (RTLD_DEFAULT, "setenv"); ++ CALL_UTIL (setenv) = (int(*)(const char *, const char *, int))dlsym (RTLD_DEFAULT, "setenv"); + if (CALL_UTIL (setenv) == NULL || CALL_UTIL (setenv) == __collector_setenv) + { + TprintfT (DBG_LT2, "__collector_setenv(): ERROR: no pointer found.\n"); +@@ -765,8 +765,8 @@ __collector_setenv (const char *name, co + } + + /*------------------------------------------------------------- unsetenv */ +-int unsetenv () __attribute__ ((weak, alias ("__collector_unsetenv"))); +-int _unsetenv () __attribute__ ((weak, alias ("__collector_unsetenv"))); ++int unsetenv (const char *) __attribute__ ((weak, alias ("__collector_unsetenv"))); ++int _unsetenv (const char *) __attribute__ ((weak, alias ("__collector_unsetenv"))); + + int + __collector_unsetenv (const char *name) +@@ -774,9 +774,9 @@ __collector_unsetenv (const char *name) + if (CALL_UTIL (unsetenv) == __collector_unsetenv || + CALL_UTIL (unsetenv) == NULL) + { // __collector_libc_funcs_init failed +- CALL_UTIL (unsetenv) = (int(*)())dlsym (RTLD_NEXT, "unsetenv"); ++ CALL_UTIL (unsetenv) = (int(*)(const char *))dlsym (RTLD_NEXT, "unsetenv"); + if (CALL_UTIL (unsetenv) == NULL || CALL_UTIL (unsetenv) == __collector_unsetenv) +- CALL_UTIL (unsetenv) = (int(*)())dlsym (RTLD_DEFAULT, "unsetenv"); ++ CALL_UTIL (unsetenv) = (int(*)(const char *))dlsym (RTLD_DEFAULT, "unsetenv"); + if (CALL_UTIL (unsetenv) == NULL || CALL_UTIL (unsetenv) == __collector_unsetenv) + { + TprintfT (DBG_LT2, "__collector_unsetenv(): ERROR: no pointer found.\n"); +diff -rup fred/gprofng/libcollector/iolib.c binutils-2.41/gprofng/libcollector/iolib.c +--- fred/gprofng/libcollector/iolib.c 2026-02-26 10:57:17.827982759 +0000 ++++ binutils-2.41/gprofng/libcollector/iolib.c 2026-02-26 11:17:43.975843911 +0000 +@@ -118,7 +118,7 @@ static void deleteBuffer (Buffer *buf); + * Common buffer management routines + */ + static void +-init () ++init (void) + { + /* set the block size */ + long pgsz = CALL_UTIL (sysconf)(_SC_PAGESIZE); +@@ -243,7 +243,7 @@ __collector_create_handle (char *descp) + { + /* allocate our buffers in virtual memory */ + /* later, we will remap buffers individually to the file */ +- uint8_t *memory = (uint8_t*) CALL_UTIL (mmap64_) (0, ++ uint8_t *memory = (uint8_t*) CALL_UTIL (mmap64_) (NULL, + (size_t) (NBUFS * blksz), PROT_READ | PROT_WRITE, + #if ARCH(SPARC) + MAP_SHARED | MAP_ANON, +@@ -514,7 +514,7 @@ allocateChunk (DataHandle *hndl, unsigne + if (__collector_cas_ptr (&hndl->chunks[ichunk], NULL, CHUNK_BUSY) == NULL) + { + /* allocate virtual memory */ +- uint8_t *newchunk = (uint8_t*) CALL_UTIL (mmap64_) (0, ++ uint8_t *newchunk = (uint8_t*) CALL_UTIL (mmap64_) (NULL, + (size_t) (blksz * hndl->nflow), PROT_READ | PROT_WRITE, + #if ARCH(SPARC) + MAP_SHARED | MAP_ANON, +diff -rup fred/gprofng/libcollector/iotrace.c binutils-2.41/gprofng/libcollector/iotrace.c +--- fred/gprofng/libcollector/iotrace.c 2026-02-26 10:57:17.827982759 +0000 ++++ binutils-2.41/gprofng/libcollector/iotrace.c 2026-02-26 13:16:30.257243113 +0000 +@@ -1473,7 +1473,7 @@ close (int fildes) + + /*------------------------------------------------------------- fopen */ + static FILE* +-gprofng_fopen (FILE*(real_fopen) (), const char *filename, const char *mode) ++gprofng_fopen (FILE*(real_fopen) (const char *, const char *), const char *filename, const char *mode) + { + int *guard; + FILE *fp = NULL; +@@ -1547,7 +1547,7 @@ DCL_FOPEN (fopen) + + /*------------------------------------------------------------- fclose */ + static int +-gprofng_fclose (int(real_fclose) (), FILE *stream) ++gprofng_fclose (int(real_fclose) (FILE *), FILE *stream) + { + int *guard; + int stat; +@@ -1633,7 +1633,7 @@ fflush (FILE *stream) + + /*------------------------------------------------------------- fdopen */ + static FILE* +-gprofng_fdopen (FILE*(real_fdopen) (), int fildes, const char *mode) ++gprofng_fdopen (FILE*(real_fdopen) (int, const char *), int fildes, const char *mode) + { + int *guard; + FILE *fp = NULL; +@@ -2945,7 +2945,7 @@ DCL_FGETPOS (fgetpos) + + /*------------------------------------------------------------- fgetpos64 */ + static int +-gprofng_fgetpos64 (int(real_fgetpos64) (), FILE *stream, fpos64_t *pos) ++gprofng_fgetpos64 (int(real_fgetpos64) (FILE *, fpos64_t *), FILE *stream, fpos64_t *pos) + { + int *guard; + int ret; +diff -rup fred/gprofng/libcollector/libcol_util.c binutils-2.41/gprofng/libcollector/libcol_util.c +--- fred/gprofng/libcollector/libcol_util.c 2026-02-26 10:57:17.827982759 +0000 ++++ binutils-2.41/gprofng/libcollector/libcol_util.c 2026-02-26 12:55:01.083418747 +0000 +@@ -1116,7 +1116,7 @@ __collector_util_init () + + ptr = dlsym (libc, "munmap"); + if (ptr) +- __collector_util_funcs.munmap = (int(*)())ptr; ++ __collector_util_funcs.munmap = (int(*)(const void *, size_t))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT munmap: %s\n", dlerror ()); +@@ -1125,7 +1125,7 @@ __collector_util_init () + + ptr = dlsym (libc, "close"); + if (ptr) +- __collector_util_funcs.close = (int(*)())ptr; ++ __collector_util_funcs.close = (int(*)(int))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT close: %s\n", dlerror ()); +@@ -1160,7 +1160,7 @@ __collector_util_init () + + ptr = dlsym (libc, "close"); + if (ptr) +- __collector_util_funcs.close = (int(*)())ptr; ++ __collector_util_funcs.close = (int(*)(int)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT close: %s\n", dlerror ()); +@@ -1169,7 +1169,7 @@ __collector_util_init () + + ptr = dlsym (libc, "read"); + if (ptr) +- __collector_util_funcs.read = (ssize_t (*)())ptr; ++ __collector_util_funcs.read = (ssize_t (*)(int, const void *, size_t)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT read: %s\n", dlerror ()); +@@ -1178,7 +1178,7 @@ __collector_util_init () + + ptr = dlsym (libc, "write"); + if (ptr) +- __collector_util_funcs.write = (ssize_t (*)())ptr; ++ __collector_util_funcs.write = (ssize_t (*)(int, const void *, size_t))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT write: %s\n", dlerror ()); +@@ -1188,14 +1188,14 @@ __collector_util_init () + #if ARCH(Intel) && WSIZE(32) + ptr = dlvsym (libc, "pwrite", "GLIBC_2.2"); // it is in /lib/libpthread.so.0 + if (ptr) +- __collector_util_funcs.pwrite = (ssize_t (*)())ptr; ++ __collector_util_funcs.pwrite = (ssize_t (*)(int, const void *, size_t, off_t)) ptr; + else + { + Tprintf (DBG_LT0, "libcol_util: WARNING: dlvsym for %s@%s failed. Using dlsym() instead.", "pwrite", "GLIBC_2.2"); + #endif /* ARCH(Intel) && WSIZE(32) */ + ptr = dlsym (libc, "pwrite"); + if (ptr) +- __collector_util_funcs.pwrite = (ssize_t (*)())ptr; ++ __collector_util_funcs.pwrite = (ssize_t (*)(int, const void *, size_t, off_t)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT pwrite: %s\n", dlerror ()); +@@ -1208,14 +1208,14 @@ __collector_util_init () + #if ARCH(Intel) && WSIZE(32) + ptr = dlvsym (libc, "pwrite64", "GLIBC_2.2"); // it is in /lib/libpthread.so.0 + if (ptr) +- __collector_util_funcs.pwrite64_ = (ssize_t (*)())ptr; ++ __collector_util_funcs.pwrite64_ = (ssize_t (*)(int, const void *, size_t, off64_t)) ptr; + else + { + Tprintf (DBG_LT0, "libcol_util: WARNING: dlvsym for %s@%s failed. Using dlsym() instead.", "pwrite64", "GLIBC_2.2"); + #endif /* ARCH(Intel) && WSIZE(32) */ + ptr = dlsym (libc, "pwrite64"); + if (ptr) +- __collector_util_funcs.pwrite64_ = (ssize_t (*)())ptr; ++ __collector_util_funcs.pwrite64_ = (ssize_t (*)(int, const void *, size_t, off64_t)) ptr; + else + __collector_util_funcs.pwrite64_ = __collector_util_funcs.pwrite; + #if ARCH(Intel) && WSIZE(32) +@@ -1224,7 +1224,7 @@ __collector_util_init () + + ptr = dlsym (libc, "lseek"); + if (ptr) +- __collector_util_funcs.lseek = (off_t (*)())ptr; ++ __collector_util_funcs.lseek = (off_t (*)(int, off_t, int)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT lseek: %s\n", dlerror ()); +@@ -1233,7 +1233,7 @@ __collector_util_init () + + ptr = dlsym (libc, "access"); + if (ptr) +- __collector_util_funcs.access = (int(*)())ptr; ++ __collector_util_funcs.access = (int(*)(const char *, int)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT access: %s\n", dlerror ()); +@@ -1242,7 +1242,7 @@ __collector_util_init () + + ptr = dlsym (libc, "mkdir"); + if (ptr) +- __collector_util_funcs.mkdir = (int(*)())ptr; ++ __collector_util_funcs.mkdir = (int(*)(const char *, mode_t)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT mkdir: %s\n", dlerror ()); +@@ -1251,7 +1251,7 @@ __collector_util_init () + + ptr = dlsym (libc, "opendir"); + if (ptr) +- __collector_util_funcs.opendir = (DIR * (*)())ptr; ++ __collector_util_funcs.opendir = (DIR * (*)(const char *)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT opendir: %s\n", dlerror ()); +@@ -1260,7 +1260,7 @@ __collector_util_init () + + ptr = dlsym (libc, "closedir"); + if (ptr) +- __collector_util_funcs.closedir = (int(*)())ptr; ++ __collector_util_funcs.closedir = (int(*)(DIR *)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT closedir: %s\n", dlerror ()); +@@ -1269,7 +1269,7 @@ __collector_util_init () + + ptr = dlsym (libc, "execv"); + if (ptr) +- __collector_util_funcs.execv = (int(*)())ptr; ++ __collector_util_funcs.execv = (int(*)(const char *, char * const *))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT execv: %s\n", dlerror ()); +@@ -1278,7 +1278,7 @@ __collector_util_init () + + ptr = dlsym (libc, "exit"); + if (ptr) +- __collector_util_funcs.exit = (void(*)())ptr; ++ __collector_util_funcs.exit = (void(*)(int)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT exit: %s\n", dlerror ()); +@@ -1287,7 +1287,7 @@ __collector_util_init () + + ptr = dlsym (libc, "vfork"); + if (ptr) +- __collector_util_funcs.vfork = (pid_t (*)())ptr; ++ __collector_util_funcs.vfork = (pid_t (*)(void)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT vfork: %s\n", dlerror ()); +@@ -1296,14 +1296,14 @@ __collector_util_init () + + ptr = dlsym (libc, "waitpid"); + if (ptr) +- __collector_util_funcs.waitpid = (pid_t (*)())ptr; ++ __collector_util_funcs.waitpid = (pid_t (*)(pid_t, int *, int)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT waitpid: %s\n", dlerror ()); + err = COL_ERROR_UTIL_INIT; + } + +- int (*__collector_getcpuid)() = (int(*)()) & getcpuid; ++ int (*__collector_getcpuid)() = (int(*)(void)) & getcpuid; + #if ARCH(Intel) + /* if sched_getcpu() not found, init our getcpuid() */ + sched_getcpu_ptr = (sched_getcpu_ptr_t) dlsym (libc, "sched_getcpu"); +@@ -1315,7 +1315,7 @@ __collector_util_init () + + ptr = dlsym (libc, "getcontext"); + if (ptr) +- __collector_util_funcs.getcontext = (int(*)())ptr; ++ __collector_util_funcs.getcontext = (int(*)(ucontext_t *))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT getcontext: %s\n", dlerror ()); +@@ -1333,7 +1333,7 @@ __collector_util_init () + + ptr = dlsym (libc, "putenv"); + if (ptr) +- __collector_util_funcs.putenv = (int(*)())ptr; ++ __collector_util_funcs.putenv = (int(*)(char *))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT putenv: %s\n", dlerror ()); +@@ -1342,7 +1342,7 @@ __collector_util_init () + + ptr = dlsym (libc, "getenv"); + if (ptr) +- __collector_util_funcs.getenv = (char*(*)())ptr; ++ __collector_util_funcs.getenv = (char*(*)(const char *))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT getenv: %s\n", dlerror ()); +@@ -1351,7 +1351,7 @@ __collector_util_init () + + ptr = dlsym (libc, "time"); + if (ptr) +- __collector_util_funcs.time = (time_t (*)())ptr; ++ __collector_util_funcs.time = (time_t (*)(time_t *))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT time: %s\n", dlerror ()); +@@ -1360,7 +1360,7 @@ __collector_util_init () + + ptr = dlsym (libc, "mktime"); + if (ptr) +- __collector_util_funcs.mktime = (time_t (*)())ptr; ++ __collector_util_funcs.mktime = (time_t (*)(struct tm *))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT mktime: %s\n", dlerror ()); +@@ -1374,7 +1374,7 @@ __collector_util_init () + + ptr = dlsym (libc, "gmtime_r"); + if (ptr) +- __collector_util_funcs.gmtime_r = (struct tm * (*)())ptr; ++ __collector_util_funcs.gmtime_r = (struct tm * (*)(const time_t *, struct tm *))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT gmtime_r: %s\n", dlerror ()); +@@ -1383,7 +1383,7 @@ __collector_util_init () + + ptr = dlsym (libc, "strtol"); + if (ptr) +- __collector_util_funcs.strtol = (long (*)())ptr; ++ __collector_util_funcs.strtol = (long (*)(const char *, char **, int))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT strtol: %s\n", dlerror ()); +@@ -1392,7 +1392,7 @@ __collector_util_init () + + ptr = dlsym (libc, "strtoll"); + if (ptr) +- __collector_util_funcs.strtoll = (long long (*)())ptr; ++ __collector_util_funcs.strtoll = (long long (*)(const char *, char **, int))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT strtoll: %s\n", dlerror ()); +@@ -1404,7 +1404,7 @@ __collector_util_init () + + ptr = dlsym (libc, "setenv"); + if (ptr) +- __collector_util_funcs.setenv = (int(*)())ptr; ++ __collector_util_funcs.setenv = (int(*)(const char *, const char *, int)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT setenv: %s\n", dlerror ()); +@@ -1413,7 +1413,7 @@ __collector_util_init () + + ptr = dlsym (libc, "unsetenv"); + if (ptr) +- __collector_util_funcs.unsetenv = (int(*)())ptr; ++ __collector_util_funcs.unsetenv = (int(*)(const char *))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT unsetenv: %s\n", dlerror ()); +@@ -1422,7 +1422,7 @@ __collector_util_init () + + ptr = dlsym (libc, "atof"); + if (ptr) +- __collector_util_funcs.atof = (double (*)())ptr; ++ __collector_util_funcs.atof = (double (*)(const char *))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT atof: %s\n", dlerror ()); +@@ -1431,7 +1431,7 @@ __collector_util_init () + + ptr = dlsym (libc, "sysinfo"); + if (ptr) +- __collector_util_funcs.sysinfo = (long (*)())ptr; ++ __collector_util_funcs.sysinfo = (long (*)(int, char *, long))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT sysinfo: %s\n", dlerror ()); +@@ -1440,7 +1440,7 @@ __collector_util_init () + + ptr = dlsym (libc, "clearenv"); + if (ptr) +- __collector_util_funcs.clearenv = (int(*)())ptr; ++ __collector_util_funcs.clearenv = (int(*)(void))ptr; + else + { + /* suppress warning on S10 or earlier Solaris */ +@@ -1500,7 +1500,7 @@ __collector_util_init () + + ptr = dlsym (libc, "pclose"); + if (ptr) +- __collector_util_funcs.pclose = (int(*)())ptr; ++ __collector_util_funcs.pclose = (int(*)(FILE *))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT pclose: %s\n", dlerror ()); +@@ -1509,7 +1509,7 @@ __collector_util_init () + + ptr = dlsym (libc, "fgets"); + if (ptr) +- __collector_util_funcs.fgets = (char*(*)())ptr; ++ __collector_util_funcs.fgets = (char*(*)(char *, int, FILE *))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT fgets: %s\n", dlerror ()); +@@ -1536,7 +1536,7 @@ __collector_util_init () + + ptr = dlsym (libc, "vsnprintf"); + if (ptr) +- __collector_util_funcs.vsnprintf = (int(*)())ptr; ++ __collector_util_funcs.vsnprintf = (int(*)(char *, size_t, const char *, va_list)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT vsnprintf: %s\n", dlerror ()); +@@ -1545,7 +1545,7 @@ __collector_util_init () + + ptr = dlsym (libc, "atoi"); + if (ptr) +- __collector_util_funcs.atoi = (int(*)())ptr; ++ __collector_util_funcs.atoi = (int(*)(const char *))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT atoi: %s\n", dlerror ()); +@@ -1554,7 +1554,7 @@ __collector_util_init () + + ptr = dlsym (libc, "calloc"); + if (ptr) +- __collector_util_funcs.calloc = (void*(*)())ptr; ++ __collector_util_funcs.calloc = (void*(*)(size_t, size_t))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT calloc: %s\n", dlerror ()); +@@ -1564,7 +1564,7 @@ __collector_util_init () + ptr = dlsym (libc, "free"); + if (ptr) + { +- __collector_util_funcs.free = (void(*)())ptr; ++ __collector_util_funcs.free = (void(*)(void *)) ptr; + } + else + { +@@ -1574,7 +1574,7 @@ __collector_util_init () + + ptr = dlsym (libc, "strdup"); + if (ptr) +- __collector_util_funcs.libc_strdup = (char*(*)())ptr; ++ __collector_util_funcs.libc_strdup = (char*(*)(const char *))ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT strdup: %s\n", dlerror ()); +@@ -1587,7 +1587,7 @@ __collector_util_init () + + ptr = dlsym (libc, "strerror"); + if (ptr) +- __collector_util_funcs.strerror = (char*(*)())ptr; ++ __collector_util_funcs.strerror = (char*(*)(int)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT strerror: %s\n", dlerror ()); +@@ -1595,7 +1595,7 @@ __collector_util_init () + } + ptr = dlsym (libc, "strerror_r"); + if (ptr) +- __collector_util_funcs.strerror_r = (int(*)())ptr; ++ __collector_util_funcs.strerror_r = (int(*)(int, char *, size_t)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT strerror_r: %s\n", dlerror ()); +@@ -1603,7 +1603,7 @@ __collector_util_init () + } + ptr = dlsym (libc, "strspn"); + if (ptr) +- __collector_util_funcs.strspn = (size_t (*)())ptr; ++ __collector_util_funcs.strspn = (size_t (*)(const char *, const char *)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT strspn: %s\n", dlerror ()); +@@ -1612,7 +1612,7 @@ __collector_util_init () + + ptr = dlsym (libc, "strtoul"); + if (ptr) +- __collector_util_funcs.strtoul = (unsigned long int(*)())ptr; ++ __collector_util_funcs.strtoul = (unsigned long int(*)(const char *, char **, int)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT strtoul: %s\n", dlerror ()); +@@ -1621,7 +1621,7 @@ __collector_util_init () + + ptr = dlsym (libc, "strtoull"); + if (ptr) +- __collector_util_funcs.strtoull = (unsigned long long int(*)())ptr; ++ __collector_util_funcs.strtoull = (unsigned long long int(*)(const char *, char **, int)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT strtoull: %s\n", dlerror ()); +@@ -1630,7 +1630,7 @@ __collector_util_init () + + ptr = dlsym (libc, "fcntl"); + if (ptr) +- __collector_util_funcs.fcntl = (int(*)(int, int, ...))ptr; ++ __collector_util_funcs.fcntl = (int(*)(int, int, ...)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT fcntl: %s\n", dlerror ()); +@@ -1639,7 +1639,7 @@ __collector_util_init () + + ptr = dlsym (libc, "ioctl"); + if (ptr) +- __collector_util_funcs.ioctl = (int(*)(int, int, ...))ptr; ++ __collector_util_funcs.ioctl = (int(*)(int, int, ...)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT ioctl: %s\n", dlerror ()); +@@ -1648,7 +1648,7 @@ __collector_util_init () + + ptr = dlsym (libc, "symlink"); + if (ptr) +- __collector_util_funcs.symlink = (int(*)(const char*, const char*))ptr; ++ __collector_util_funcs.symlink = (int(*)(const char*, const char*)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT symlink: %s\n", dlerror ()); +@@ -1666,7 +1666,7 @@ __collector_util_init () + + ptr = dlsym (libc, "sysconf"); + if (ptr) +- __collector_util_funcs.sysconf = (long(*)())ptr; ++ __collector_util_funcs.sysconf = (long(*)(int)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT sysconf: %s\n", dlerror ()); +@@ -1675,7 +1675,7 @@ __collector_util_init () + + ptr = dlsym (libc, "sigfillset"); + if (ptr) +- __collector_util_funcs.sigfillset = (int(*)())ptr; ++ __collector_util_funcs.sigfillset = (int(*)(sigset_t *)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT sigfillset: %s\n", dlerror ()); +@@ -1684,7 +1684,7 @@ __collector_util_init () + + ptr = dlsym (libc, "sigprocmask"); + if (ptr) +- __collector_util_funcs.sigprocmask = (int(*)())ptr; ++ __collector_util_funcs.sigprocmask = (int(*)(int, const sigset_t *, sigset_t *)) ptr; + else + { + CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT sigprocmask: %s\n", dlerror ()); +diff -rup fred/gprofng/libcollector/libcol_util.h binutils-2.41/gprofng/libcollector/libcol_util.h +--- fred/gprofng/libcollector/libcol_util.h 2026-02-26 10:57:17.827982759 +0000 ++++ binutils-2.41/gprofng/libcollector/libcol_util.h 2026-02-26 11:16:33.295428744 +0000 +@@ -82,9 +82,9 @@ extern int __collector_mutex_trylock (co + + void __collector_sample (char *name); + void __collector_terminate_expt (); +-void __collector_pause (); +-void __collector_pause_m (); +-void __collector_resume (); ++void __collector_pause (void); ++void __collector_pause_m (const char *); ++void __collector_resume (void); + + struct DT_lineno; + +diff -rup fred/gprofng/libcollector/linetrace.c binutils-2.41/gprofng/libcollector/linetrace.c +--- fred/gprofng/libcollector/linetrace.c 2026-02-26 10:57:17.827982759 +0000 ++++ binutils-2.41/gprofng/libcollector/linetrace.c 2026-02-26 12:32:17.045604191 +0000 +@@ -1207,7 +1207,7 @@ __collector_vfork (void) + } + + /*------------------------------------------------------------- execve */ +-int execve () __attribute__ ((weak, alias ("__collector_execve"))); ++int execve (const char *, char * const *, char * const *) __attribute__ ((weak, alias ("__collector_execve"))); + + int + __collector_execve (const char* path, char *const argv[], char *const envp[]) +@@ -1237,7 +1237,7 @@ __collector_execve (const char* path, ch + return ret; + } + +-int execvp () __attribute__ ((weak, alias ("__collector_execvp"))); ++int execvp (const char *, char * const *) __attribute__ ((weak, alias ("__collector_execvp"))); + + int + __collector_execvp (const char* file, char *const argv[]) +@@ -1269,7 +1269,7 @@ __collector_execvp (const char* file, ch + return ret; + } + +-int execv () __attribute__ ((weak, alias ("__collector_execv"))); ++int execv (const char *, char * const *) __attribute__ ((weak, alias ("__collector_execv"))); + + int + __collector_execv (const char* path, char *const argv[]) +@@ -1408,7 +1408,7 @@ __collector_execl (const char* path, con + /*-------------------------------------------------------- posix_spawn */ + // map interposed symbol versions + static int +-gprofng_posix_spawn (int(real_posix_spawn) (), ++gprofng_posix_spawn (int (real_posix_spawn) (pid_t *, const char *, const posix_spawn_file_actions_t *, const posix_spawnattr_t *, char *const *, char *const *), + pid_t *pidp, const char *path, + const posix_spawn_file_actions_t *file_actions, + const posix_spawnattr_t *attrp, +@@ -1466,7 +1466,7 @@ DCL_POSIX_SPAWN (posix_spawn) + + /*-------------------------------------------------------- posix_spawnp */ + static int +-gprofng_posix_spawnp (int (real_posix_spawnp) (), ++gprofng_posix_spawnp (int (real_posix_spawnp) (pid_t *, const char *, const posix_spawn_file_actions_t *, const posix_spawnattr_t *, char * const *, char * const *), + pid_t *pidp, const char *path, + const posix_spawn_file_actions_t *file_actions, + const posix_spawnattr_t *attrp, +@@ -1521,7 +1521,7 @@ DCL_FUNC_VER (DCL_POSIX_SPAWNP, posix_sp + DCL_POSIX_SPAWNP (posix_spawnp) + + /*------------------------------------------------------------- system */ +-int system () __attribute__ ((weak, alias ("__collector_system"))); ++int system (char *) __attribute__ ((weak, alias ("__collector_system"))); + + int + __collector_system (const char *cmd) +@@ -1576,7 +1576,7 @@ DCL_FUNC_VER (DCL_POPEN, popen_2_0, pope + DCL_POPEN (popen) + + /*------------------------------------------------------------- grantpt */ +-int grantpt () __attribute__ ((weak, alias ("__collector_grantpt"))); ++int grantpt (int) __attribute__ ((weak, alias ("__collector_grantpt"))); + + int + __collector_grantpt (const int fildes) +@@ -1601,7 +1601,7 @@ __collector_grantpt (const int fildes) + } + + /*------------------------------------------------------------- ptsname */ +-char *ptsname () __attribute__ ((weak, alias ("__collector_ptsname"))); ++char *ptsname (int) __attribute__ ((weak, alias ("__collector_ptsname"))); + + char * + __collector_ptsname (const int fildes) +@@ -1754,8 +1754,8 @@ __collector_clone (int (*fn)(void *), vo + } + + /*-------------------------------------------------------------------- setuid */ +-int setuid () __attribute__ ((weak, alias ("__collector_setuid"))); +-int _setuid () __attribute__ ((weak, alias ("__collector_setuid"))); ++int setuid (uid_t) __attribute__ ((weak, alias ("__collector_setuid"))); ++int _setuid (uid_t) __attribute__ ((weak, alias ("__collector_setuid"))); + + int + __collector_setuid (uid_t ruid) +@@ -1770,8 +1770,8 @@ __collector_setuid (uid_t ruid) + } + + /*------------------------------------------------------------------- seteuid */ +-int seteuid () __attribute__ ((weak, alias ("__collector_seteuid"))); +-int _seteuid () __attribute__ ((weak, alias ("__collector_seteuid"))); ++int seteuid (uid_t) __attribute__ ((weak, alias ("__collector_seteuid"))); ++int _seteuid (uid_t) __attribute__ ((weak, alias ("__collector_seteuid"))); + + int + __collector_seteuid (uid_t euid) +@@ -1786,8 +1786,8 @@ __collector_seteuid (uid_t euid) + } + + /*------------------------------------------------------------------ setreuid */ +-int setreuid () __attribute__ ((weak, alias ("__collector_setreuid"))); +-int _setreuid () __attribute__ ((weak, alias ("__collector_setreuid"))); ++int setreuid (uid_t,uid_t) __attribute__ ((weak, alias ("__collector_setreuid"))); ++int _setreuid (uid_t,uid_t) __attribute__ ((weak, alias ("__collector_setreuid"))); + + int + __collector_setreuid (uid_t ruid, uid_t euid) +@@ -1802,8 +1802,8 @@ __collector_setreuid (uid_t ruid, uid_t + } + + /*-------------------------------------------------------------------- setgid */ +-int setgid () __attribute__ ((weak, alias ("__collector_setgid"))); +-int _setgid () __attribute__ ((weak, alias ("__collector_setgid"))); ++int setgid (gid_t) __attribute__ ((weak, alias ("__collector_setgid"))); ++int _setgid (gid_t) __attribute__ ((weak, alias ("__collector_setgid"))); + + int + __collector_setgid (gid_t rgid) +@@ -1818,8 +1818,8 @@ __collector_setgid (gid_t rgid) + } + + /*------------------------------------------------------------------- setegid */ +-int setegid () __attribute__ ((weak, alias ("__collector_setegid"))); +-int _setegid () __attribute__ ((weak, alias ("__collector_setegid"))); ++int setegid (gid_t) __attribute__ ((weak, alias ("__collector_setegid"))); ++int _setegid (gid_t) __attribute__ ((weak, alias ("__collector_setegid"))); + + int + __collector_setegid (gid_t egid) +@@ -1834,8 +1834,8 @@ __collector_setegid (gid_t egid) + } + + /*------------------------------------------------------------------ setregid */ +-int setregid () __attribute__ ((weak, alias ("__collector_setregid"))); +-int _setregid () __attribute__ ((weak, alias ("__collector_setregid"))); ++int setregid (gid_t,gid_t) __attribute__ ((weak, alias ("__collector_setregid"))); ++int _setregid (gid_t,gid_t) __attribute__ ((weak, alias ("__collector_setregid"))); + + int + __collector_setregid (gid_t rgid, gid_t egid) +diff -rup fred/gprofng/libcollector/mmaptrace.c binutils-2.41/gprofng/libcollector/mmaptrace.c +--- fred/gprofng/libcollector/mmaptrace.c 2026-02-26 10:57:17.827982759 +0000 ++++ binutils-2.41/gprofng/libcollector/mmaptrace.c 2026-02-26 11:24:29.202727459 +0000 +@@ -314,7 +314,7 @@ __collector_mmap_fork_child_cleanup () + } + + static int +-init_mmap_files () ++init_mmap_files (void) + { + TprintfT (DBG_LT2, "init_mmap_files\n"); + /* also create the headerless dyntext file (if required) */ +@@ -1209,7 +1209,7 @@ process_vsyscall_page () + /* + * collector API for dynamic functions + */ +-void collector_func_load () __attribute__ ((weak, alias ("__collector_func_load"))); ++void collector_func_load (char *, char *, char *, void *, int, int, DT_lineno *) __attribute__ ((weak, alias ("__collector_func_load"))); + void + __collector_func_load (char *name, char *alias, char *sourcename, + void *vaddr, int size, int lntsize, DT_lineno *lntable) +@@ -1218,7 +1218,7 @@ __collector_func_load (char *name, char + vaddr, size, lntsize, lntable); + } + +-void collector_func_unload () __attribute__ ((weak, alias ("__collector_func_unload"))); ++void collector_func_unload (void *) __attribute__ ((weak, alias ("__collector_func_unload"))); + void + __collector_func_unload (void *vaddr) + { +diff -rup fred/gprofng/libcollector/unwind.c binutils-2.41/gprofng/libcollector/unwind.c +--- fred/gprofng/libcollector/unwind.c 2026-02-26 10:57:17.827982759 +0000 ++++ binutils-2.41/gprofng/libcollector/unwind.c 2026-02-26 12:33:20.676902736 +0000 +@@ -412,7 +412,7 @@ __collector_ext_unwind_init (int record) + omp_no_walk = 1; + + if (__collector_VM_ReadByteInstruction == NULL) +- __collector_VM_ReadByteInstruction = (int(*)()) dlsym (RTLD_DEFAULT, "Async_VM_ReadByteInstruction"); ++ __collector_VM_ReadByteInstruction = (int(*)(unsigned char *)) dlsym (RTLD_DEFAULT, "Async_VM_ReadByteInstruction"); + + #if ARCH(SPARC) + #if WSIZE(64) +diff -rup fred/gprofng/src/Elf.cc binutils-2.41/gprofng/src/Elf.cc +--- fred/gprofng/src/Elf.cc 2026-02-26 10:57:17.828468817 +0000 ++++ binutils-2.41/gprofng/src/Elf.cc 2026-02-26 13:20:16.074282081 +0000 +@@ -390,6 +390,8 @@ Elf::get_sec_name (unsigned int sec) + Elf_Data * + Elf::elf_getdata (unsigned int sec) + { ++ if (sec >= ehdrp->e_shnum) ++ return NULL; + if (data == NULL) + { + data = (Elf_Data **) malloc (ehdrp->e_shnum * sizeof (Elf_Data *)); +diff -rup fred/gprofng/src/collctrl.cc binutils-2.41/gprofng/src/collctrl.cc +--- fred/gprofng/src/collctrl.cc 2026-02-26 10:57:17.829596072 +0000 ++++ binutils-2.41/gprofng/src/collctrl.cc 2026-02-26 13:22:30.018913076 +0000 +@@ -1080,11 +1080,11 @@ Coll_Ctrl::set_synctrace (const char *st + int tval = (int) strtol (val, &endchar, 0); + if (*endchar != 0 || tval < 0) + { +- free (val); + /* invalid setting */ + /* restore the comma, if it was zeroed out */ + if (comma_p != NULL) + *comma_p = ','; ++ free (val); + return dbe_sprintf (GTXT ("Unrecognized synchronization tracing threshold `%s'\n"), string); + } + free (val); +diff -rup fred/gprofng/src/collector_module.h binutils-2.41/gprofng/src/collector_module.h +--- fred/gprofng/src/collector_module.h 2026-02-26 10:57:17.829596072 +0000 ++++ binutils-2.41/gprofng/src/collector_module.h 2026-02-26 12:47:59.512212113 +0000 +@@ -40,24 +40,24 @@ struct tm; + * If you add any, please put it in the right place */ + typedef struct CollectorUtilFuncs + { +- int (*access)(); ++ int (*access)(const char *, int); + int (*atoi)(const char *nptr); + void *(*calloc)(size_t nelem, size_t elsize); + int (*clearenv)(void); + int (*close)(int); +- int (*closedir)(); ++ int (*closedir)(DIR *); + int (*execv)(const char *path, char *const argv[]); + void (*exit)(int status); + int (*fclose)(FILE *stream); + int (*fcntl)(int fd, int cmd, ...); + char *(*fgets)(char *s, int n, FILE *stream); + FILE *(*fopen)(const char *filename, const char *mode); +- pid_t (*vfork)(); ++ pid_t (*vfork)(void); + int (*fprintf)(FILE *stream, const char *format, ...); + void (*free)(void *ptr); + int (*fstat)(int fd, struct stat *buf); + int (*getcontext)(ucontext_t *ucp); +- int (*getcpuid)(); ++ int (*getcpuid)(void); + char *(*getcwd)(char *buf, size_t size); + char *(*getenv)(const char *name); + struct tm *(*gmtime_r)(const time_t *clock, struct tm *res); +@@ -65,20 +65,20 @@ typedef struct CollectorUtilFuncs + off_t (*lseek)(int fd, off_t offset, int whence); + void *(*malloc)(size_t size); + void *(*memset)(void *s1, int c, size_t n); +- int (*mkdir)(); ++ int (*mkdir)(const char *, mode_t); + time_t (*mktime)(struct tm *timeptr); + void *(*mmap)(void *, size_t, int, int, int, off_t); +- void *(*mmap64_)(); +- int (*munmap)(); ++ void *(*mmap64_)(void *, size_t, int, int, int, off64_t); ++ int (*munmap)(const void *, size_t); + int (*open)(const char *, int, ...); + int (*open_bare)(const char *, int, ...); +- DIR *(*opendir)(); ++ DIR *(*opendir)(const char *); + int (*pclose)(FILE *stream); + FILE *(*popen)(const char *command, const char *mode); + int (*putenv)(char *string); +- ssize_t (*pwrite)(); +- ssize_t (*pwrite64_)(); +- ssize_t (*read)(); ++ ssize_t (*pwrite)(int, const void *, size_t, off_t); ++ ssize_t (*pwrite64_)(int, const void *, size_t, off64_t); ++ ssize_t (*read)(int, const void *, size_t); + int (*setenv)(const char *name, const char *value, int overwrite); + int (*sigfillset)(sigset_t *set); + int (*sigprocmask)(int how, const sigset_t *set, sigset_t *oldset); +@@ -110,8 +110,8 @@ typedef struct CollectorUtilFuncs + int (*unsetenv)(const char *name); + int (*vsnprintf)(char *str, size_t size, const char *format, va_list ap); + pid_t (*waitpid)(pid_t pid, int *stat_loc, int options); +- ssize_t (*write)(); +- double (*atof)(); ++ ssize_t (*write)(int, const void *, size_t); ++ double (*atof)(const char *); + void *n_a; + } CollectorUtilFuncs; + diff --git a/binutils-ld-remote-testing.patch b/binutils-ld-remote-testing.patch new file mode 100644 index 0000000..91153e9 --- /dev/null +++ b/binutils-ld-remote-testing.patch @@ -0,0 +1,328 @@ +From e47e870d46f38189f0e052acc7447923e7cf6c00 Mon Sep 17 00:00:00 2001 +From: "Maciej W. Rozycki" +Date: Tue, 17 Feb 2026 10:42:47 +0000 +Subject: [PATCH] LD/testsuite: Implement target execution availability check + +Complementing `check_compiler_available' procedure for a compilation +check implement `check_execution_available' that checks whether an +executable built the same way can actually successfully run on the +target. + +From 2e806738bdeca6ce5d65d69b12e9fb204629883f Mon Sep 17 00:00:00 2001 +From: "Maciej W. Rozycki" +Date: Tue, 17 Feb 2026 10:42:47 +0000 +Subject: [PATCH] LD/testsuite: Enable execution with remote targets + +Lift target execution limitation from `run_ld_link_exec_tests' procedure +and also handle remote targets, albeit in a restricted way, as follows. + +Numerous test cases have been written such that they refer to a shared +library using a relative path, precluding the use of the runtime library +search path for the dependency to be found at run time. Consequently a +test affected has to be run on the target such that the shared library +required is present at the same relative path rooted at the program's +current working directory. + +Additionally any shared library dependencies are not handled across the +test suite in an organised way, so test invocations only have names of +direct dependencies buried within the linker options supplied. + +Therefore assert that the linker test directory is located at the same +absolute path both on the test host and the test target, typically via +sharing the directory over NFS, and use the DejaGNU `remotedir' feature +to start execution on the target with that location as the test case's +current working directory. + +From 46c365a4c59eeed3fe6c51dea7963ea555fd5b45 Mon Sep 17 00:00:00 2001 +From: "Maciej W. Rozycki" +Date: Tue, 17 Feb 2026 10:42:47 +0000 +Subject: [PATCH] LD/testsuite: Factor out compilation of a dummy executable + +There is a dummy executable compiled for the purpose of determining +whether a target compiler is available that can produce a runnable +program. This is now going to be also used to determine whether a +program produced this way can be executed on the target, so take the +relevant pieces from `check_compiler_available' procedure and factor +them out to `make_dummy_target_executable' procedure leaving the +executable produced in place and returning its name upon successful +compilation. This executable needs to be discarded by the caller once +no longer needed. No functional change overall. +--- +diff -rup binutils.orig/ld/testsuite/lib/ld-lib.exp binutils-2.41/ld/testsuite/lib/ld-lib.exp +--- binutils.orig/ld/testsuite/lib/ld-lib.exp 2026-02-26 10:23:22.698379633 +0000 ++++ binutils-2.41/ld/testsuite/lib/ld-lib.exp 2026-02-26 10:36:35.051785547 +0000 +@@ -721,6 +721,7 @@ proc run_ld_link_exec_tests { ldtests ar + set failed 0 + + if { ![check_compiler_available] } { ++ verbose -log "run_ld_link_exec_tests: unsupported: compiler not available" + unsupported $testname + continue + } +@@ -760,6 +761,7 @@ proc run_ld_link_exec_tests { ldtests ar + } + } + if { $failed != 0 } { ++ verbose -log "run_ld_link_exec_tests: unsupported: compilation failed" + unsupported $testname + continue + } +@@ -800,27 +802,51 @@ proc run_ld_link_exec_tests { ldtests ar + } + } + +- if { $failed == 0 && [isnative] } { +- send_log "Running: $binfile > $binfile.out\n" +- verbose "Running: $binfile > $binfile.out" +- catch "exec $binfile > $binfile.out" exec_output ++ # For remote targets this relies on the LD test subdirectory ++ # being identity mapped between the test host and the test ++ # target, e.g. mounted over NFS. This is due to shared module ++ # dependencies using a relative path, which implies the need ++ # for execution to start in the same directory, arranged via ++ # the `remotedir' setting, the link has been made in. ++ if { $failed == 0 && [check_execution_available] } { ++ global board_info ++ ++ set board [target_info name] ++ if { [info exists board_info($board,remotedir)] } { ++ set remotedir board_info($board,remotedir) ++ } ++ set board_info($board,remotedir) [pwd] ++ ++ send_log "Running: $binfile\n" ++ verbose "Running: $binfile" ++ set result [remote_load target $binfile] ++ set status [lindex $result 0] ++ set exec_output [lindex $result 1] + +- if ![string match "" $exec_output] then { +- send_log "$exec_output\n" +- verbose "$exec_output" 1 +- set failed 1 +- } else { ++ if { $status == "pass" } { ++ set_file_contents $binfile.out $exec_output + send_log [file_contents $binfile.out] + verbose [file_contents $binfile.out] 2 +- if [regexp_diff "$binfile.out" "$srcdir/$subdir/$expfile"] { ++ if [regexp_diff $binfile.out $srcdir/$subdir/$expfile] { + set failed 1 + } ++ } else { ++ send_log "$exec_output\n" ++ verbose "$exec_output" 1 ++ set failed 1 ++ } ++ ++ if { [info exists remotedir] } { ++ set board_info($board,remotedir) $remotedir ++ } else { ++ unset board_info($board,remotedir) + } + } + + if { $failed != 0 } { + fail $testname +- } elseif ![isnative] { ++ } elseif ![check_execution_available] { ++ verbose -log "run_ld_link_exec_tests: unsupported: execution not possible" + unsupported $testname + } else { + set errcnt 0 +@@ -1202,6 +1228,42 @@ proc check_sysroot_available { } { + return $ld_sysroot_available_saved + } + ++# Return a path to a dummy target executable if we can build one ++# or an empty string otherwise. ++proc make_dummy_target_executable { } { ++ global CC_FOR_TARGET ++ ++ if { [which $CC_FOR_TARGET] == 0 } { ++ verbose -log "make_dummy_target_executable: fail: CC_FOR_TARGET not found" ++ return "" ++ } ++ ++ set flags [get_board_flags] ++ set basename "tmpdir/compiler[pid]" ++ set src ${basename}.c ++ set output ${basename}.out ++ set f [open $src "w"] ++ puts $f "int main (void)" ++ puts $f "{" ++ puts $f " return 0; " ++ puts $f "}" ++ close $f ++ if [is_remote host] { ++ set src [remote_download host $src] ++ } ++ ++ set status [run_host_noleak "$CC_FOR_TARGET" "$flags $src -o $output"] ++ remote_file host delete $src ++ file delete $src ++ if { $status == 0 } { ++ remote_file host delete $output ++ verbose -log "make_dummy_target_executable: fail: compilation failed" ++ return "" ++ } ++ ++ return $output ++} ++ + # Return true if we can build a program with the compiler. + # On some targets, CC might be defined, but libraries and startup + # code might be missing or require special options that the ld test +@@ -1209,40 +1271,48 @@ proc check_sysroot_available { } { + + proc check_compiler_available { } { + global compiler_available_saved +- global CC_FOR_TARGET + + if {![info exists compiler_available_saved]} { +- if { [which $CC_FOR_TARGET] == 0 } { +- set compiler_available_saved 0 ++ set compiler_available_saved 0 ++ ++ set binfile [make_dummy_target_executable] ++ if { $binfile != "" } { ++ remote_file host delete $binfile ++ set compiler_available_saved 1 ++ } ++ } ++ return $compiler_available_saved ++} ++ ++# Return true if we can run a program built with the compiler. ++proc check_execution_available { } { ++ global execution_available_saved ++ ++ if { ![info exists execution_available_saved] } { ++ set execution_available_saved 0 ++ ++ if { ![check_compiler_available] } { ++ verbose -log "check_execution_avaialbe: compiler not available" + return 0 + } + +- set flags "" +- if [board_info [target_info name] exists cflags] { +- append flags " [board_info [target_info name] cflags]" +- } +- if [board_info [target_info name] exists ldflags] { +- append flags " [board_info [target_info name] ldflags]" +- } +- +- set basename "tmpdir/compiler[pid]" +- set src ${basename}.c +- set output ${basename}.out +- set f [open $src "w"] +- puts $f "int main (void)" +- puts $f "{" +- puts $f " return 0; " +- puts $f "}" +- close $f +- if [is_remote host] { +- set src [remote_download host $src] ++ set binfile [make_dummy_target_executable] ++ if { $binfile == "" } { ++ verbose -log "check_execution_avaialbe: could not make a dummy executable" ++ return 0 + } +- set compiler_available_saved [run_host_cmd_yesno "$CC_FOR_TARGET" "$flags $src -o $output"] +- remote_file host delete $src +- remote_file host delete $output +- file delete $src ++ ++ set status [lindex [remote_load target $binfile] 0] ++ remote_file host delete $binfile ++ if { $status != "pass" } { ++ verbose -log "check_execution_avaialbe: unable to delete test executable" ++ return 0 ++ } ++ ++ set execution_available_saved 1 + } +- return $compiler_available_saved ++ ++ return $execution_available_saved + } + + # Returns 1 if plugin is enabled in gcc. Returns 0 otherwise. +Only in binutils-2.41/ld/testsuite/lib: ld-lib.exp.orig +Only in binutils-2.41/ld/testsuite/lib: ld-lib.exp.rej +diff -rup fred/ld/testsuite/lib/ld-lib.exp binutils-2.41/ld/testsuite/lib/ld-lib.exp +--- fred/ld/testsuite/lib/ld-lib.exp 2026-02-26 13:40:13.123209638 +0000 ++++ binutils-2.41/ld/testsuite/lib/ld-lib.exp 2026-02-26 13:43:46.249201893 +0000 +@@ -191,6 +191,27 @@ proc is_endian_output_format { object_fl + } + } + ++# Return flags as defined within board_info ++# ++proc get_board_flags {} { ++ global board_cflags ++ global board_ldflags ++ ++ if [board_info [target_info name] exists cflags] { ++ set board_cflags " [board_info [target_info name] cflags]" ++ } else { ++ set board_cflags "" ++ } ++ ++ if [board_info [target_info name] exists ldflags] { ++ set board_ldflags " [board_info [target_info name] ldflags]" ++ } else { ++ set board_ldflags "" ++ } ++ ++ return "$board_cflags $board_ldflags" ++} ++ + # Link a program using ld + # + proc default_ld_link { ld target objects } { +@@ -202,6 +223,17 @@ proc default_ld_link { ld target objects + set flags [big_or_little_endian] + } + ++ # When using GCC as the linker driver, we need to specify board cflags when ++ # linking because cflags may contain linker options. For example when ++ # linker options are included in GCC spec files then we need the -specs ++ # option. ++ set gccexe [string replace $ld 0 [string last "/" $ld] ""] ++ if {[string match "*cc*" $gccexe] || ++ [string match "*++*" $gccexe] || ++ [string match "clang*" $gccexe]} then { ++ set flags "$flags [get_board_flags]" ++ } ++ + remote_file host delete $target + set exec_output [run_host_cmd "$ld" "$flags -o $target $objects"] + set exec_output [prune_warnings $exec_output] +diff -rup fred/ld/testsuite/lib/ld-lib.exp binutils-2.41/ld/testsuite/lib/ld-lib.exp +--- fred/ld/testsuite/lib/ld-lib.exp 2026-02-26 13:59:40.813652711 +0000 ++++ binutils-2.41/ld/testsuite/lib/ld-lib.exp 2026-02-26 13:59:43.943009327 +0000 +@@ -165,6 +165,22 @@ proc run_host_cmd_yesno { prog command } + return 0; + } + ++proc run_host_noleak { prog command } { ++ global env ++ if [info exists env(ASAN_OPTIONS)] { ++ set old_asan "$env(ASAN_OPTIONS)" ++ } ++ # don't fail the test due to gcc plugin or ld memory leaks ++ set env(ASAN_OPTIONS) "detect_leaks=0" ++ set result [run_host_cmd_yesno "$prog" "$command"] ++ if [info exists old_asan] { ++ set env(ASAN_OPTIONS) "$old_asan" ++ } else { ++ unset env(ASAN_OPTIONS) ++ } ++ return $result ++} ++ + # Link an object using relocation. + # + proc default_ld_relocate { ld target objects } { diff --git a/binutils.spec b/binutils.spec index 3eeaa83..83dd46d 100644 --- a/binutils.spec +++ b/binutils.spec @@ -2,7 +2,7 @@ Summary: A GNU collection of binary utilities Name: binutils%{?_with_debug:-debug} Version: 2.41 -Release: 63%{?dist}.alma.1 +Release: 64%{?dist}.alma.1 License: GPL-3.0-or-later AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND BSD-3-Clause AND GFDL-1.3-or-later AND GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.0-or-later URL: https://sourceware.org/binutils @@ -405,6 +405,14 @@ Patch64: binutils-CVE-2025-11083.patch # Lifetime: Fixed in 2.46 Patch65: binutils-error-on-corrupted-group.patch +# Purpose: Improves the linker testsuite's ability to run remote tests +# Lifetime: Fixed in 2.46 +Patch66: binutils-ld-remote-testing.patch + +# Purpose: Fix GprofNG sources so that they will compile with GCC version 15. +# Lifetime: Fixed in 2.46 +Patch67: binutils-gprofng-gcc15-fixes.patch + #---------------------------------------------------------------------------- # Purpose: Suppress the x86 linker's p_align-1 tests due to kernel bug on CentOS-10 @@ -1646,11 +1654,14 @@ exit 0 #---------------------------------------------------------------------------- %changelog -* Wed Feb 04 2026 Andrew Lukoshko - 2.41-63.alma.1 +* Wed Mar 04 2026 Andrew Lukoshko - 2.41-64.alma.1 - Add bison to BuildRequires for RISC-V - Disable LTO for RISC-V - Disable testsuite for RISC-V +* Thu Feb 26 2026 Nick Clifton - 2.41-64 +- Improve the linker testsuite's ability to run remote tests. (RHEL-151495) + * Mon Jan 26 2026 Nick Clifton - 2.41-63 - Run linker tests for cross binutils. Compare the native and cross results. (RHEL-117111)