]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/compile: add missing entry in bfd_link_callbacks array
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 20 Feb 2025 15:13:38 +0000 (10:13 -0500)
committerAlan Modra <amodra@gmail.com>
Tue, 22 Apr 2025 02:58:06 +0000 (12:28 +0930)
commit37d12dd25d8235fa175d6220b9182000717d3130
treef1f08638df3fd9cb64403c68a6e33132b671e5a4
parent31e9e2e8d1090da0c1da97a70005d8841fff8ddd
gdb/compile: add missing entry in bfd_link_callbacks array

clang 19 fails to build gdb with this error:

    /home/simark/src/binutils-gdb/gdb/compile/compile-object-load.c:302:3: error: cannot initialize a member subobject of type 'void (*)(const char *, ...) __attribute__((noreturn))' with an lvalue of type 'void (const char *, ...)'
      302 |   link_callbacks_einfo, /* einfo */
          |   ^~~~~~~~~~~~~~~~~~~~

This illustrates that the bfd_link_callbacks array is missing an entry
for the "fatal" callback, add it.

The fatal field was added very recently, in d26161914 ("PR 32603, more
ld -w misbehaviour").  We're lucky that the new callback was marked with
the noreturn attribute and that clang checks that, otherwise this would
have gone unnoticed.

Change-Id: I68b63d89f2707359e6254da23bdc0776b0e03ba2
(cherry picked from commit 1961e699340fc042ff2e5cbdb250694575679afe)
gdb/compile/compile-object-load.c