include/ 2003-04-17 H.J. Lu * bfdlink.h (bfd_link_callbacks): Add error_handler. ld/ 2003-04-17 H.J. Lu * ldmain.c (link_callbacks): Initialize error_handler. * ldmisc.c (error_handler): New function. * ldmisc.h (error_handler): New prototype. --- binutils/include/bfdlink.h.cb 2003-01-02 09:57:40.000000000 -0800 +++ binutils/include/bfdlink.h 2003-04-17 15:40:47.000000000 -0700 @@ -481,6 +481,11 @@ struct bfd_link_callbacks bfd_boolean (*notice) PARAMS ((struct bfd_link_info *, const char *name, bfd *abfd, asection *section, bfd_vma address)); + /* A function which is called for reporting a linker error. ID is the + error identifier. The remaining input is the same as einfo () in + ld. */ + bfd_boolean (*error_handler) + PARAMS ((int id, const char * fmt, ...)); }; /* The linker builds link_order structures which tell the code how to --- binutils/ld/ldmain.c.cb 2003-04-01 14:29:10.000000000 -0800 +++ binutils/ld/ldmain.c 2003-04-17 15:53:06.000000000 -0700 @@ -155,7 +155,8 @@ static struct bfd_link_callbacks link_ca reloc_overflow, reloc_dangerous, unattached_reloc, - notice + notice, + error_handler }; struct bfd_link_info link_info; --- binutils/ld/ldmisc.c.cb 2003-04-01 14:29:10.000000000 -0800 +++ binutils/ld/ldmisc.c 2003-04-17 21:23:39.000000000 -0700 @@ -506,3 +529,14 @@ ld_abort (file, line, fn) einfo (_("%P%F: please report this bug\n")); xexit (1); } + +bfd_boolean +error_handler VPARAMS ((int id ATTRIBUTE_UNUSED, const char *fmt, ...)) +{ + VA_OPEN (arg, fmt); + VA_FIXEDARG (arg, const char *, fmt); + + vfinfo (stderr, fmt, arg); + VA_CLOSE (arg); + return TRUE; +} --- binutils/ld/ldmisc.h.cb 2001-09-27 10:28:34.000000000 -0700 +++ binutils/ld/ldmisc.h 2003-04-17 15:54:30.000000000 -0700 @@ -22,6 +22,7 @@ #ifndef LDMISC_H #define LDMISC_H +extern bfd_boolean error_handler PARAMS ((int, const char *, ...)); extern void einfo PARAMS ((const char *, ...)); extern void minfo PARAMS ((const char *, ...)); extern void info_msg PARAMS ((const char *, ...));