]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Unconditionally define _initialize_addrmap
authorTom Tromey <tromey@adacore.com>
Fri, 6 Aug 2021 18:30:51 +0000 (12:30 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 6 Aug 2021 18:32:38 +0000 (12:32 -0600)
The way that init.c is generated does not allow for an initialization
function to be conditionally defined -- doing so will result in a link
error.

This patch fixes a build problem that arises from such a conditional
definition.  It can be reproduce with --disable-unit-tests.

gdb/addrmap.c

index 22817824cdc9befb7c4374a55fb2d0b850301652..49e51a388e1acbca45138fb0da37f9331b7b0922 100644 (file)
@@ -681,11 +681,13 @@ test_addrmap ()
 }
 
 } // namespace selftests
+#endif /* GDB_SELF_TEST */
 
 void _initialize_addrmap ();
 void
 _initialize_addrmap ()
 {
+#if GDB_SELF_TEST
   selftests::register_test ("addrmap", selftests::test_addrmap);
-}
 #endif /* GDB_SELF_TEST */
+}