mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 22:48:57 +08:00
Make bfd asserts cause linker errors.
* ldmain.c (default_bfd_assert_handler): New variable. (ld_bfd_assert_handler): New function. (main): Call bfd_set_assert_handler.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2012-04-26 Hans-Peter Nilsson <hp@axis.com>
|
||||||
|
|
||||||
|
Make bfd asserts cause linker errors.
|
||||||
|
* ldmain.c (default_bfd_assert_handler): New variable.
|
||||||
|
(ld_bfd_assert_handler): New function.
|
||||||
|
(main): Call bfd_set_assert_handler.
|
||||||
|
|
||||||
2012-04-24 Alan Modra <amodra@gmail.com>
|
2012-04-24 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* ld/ldlang.c (size_input_section): Use sec_info_type rather than
|
* ld/ldlang.c (size_input_section): Use sec_info_type rather than
|
||||||
|
18
ld/ldmain.c
18
ld/ldmain.c
@ -160,6 +160,8 @@ static struct bfd_link_callbacks link_callbacks =
|
|||||||
ldlang_override_segment_assignment
|
ldlang_override_segment_assignment
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static bfd_assert_handler_type default_bfd_assert_handler;
|
||||||
|
|
||||||
struct bfd_link_info link_info;
|
struct bfd_link_info link_info;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -173,6 +175,17 @@ ld_cleanup (void)
|
|||||||
unlink_if_ordinary (output_filename);
|
unlink_if_ordinary (output_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If there's a BFD assertion, we'll notice and exit with an error
|
||||||
|
unless otherwise instructed. */
|
||||||
|
|
||||||
|
static void
|
||||||
|
ld_bfd_assert_handler (const char *fmt, const char *bfdver,
|
||||||
|
const char *file, int line)
|
||||||
|
{
|
||||||
|
(*default_bfd_assert_handler) (fmt, bfdver, file, line);
|
||||||
|
config.make_executable = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
@ -199,6 +212,11 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
bfd_set_error_program_name (program_name);
|
bfd_set_error_program_name (program_name);
|
||||||
|
|
||||||
|
/* We want to notice and fail on those nasty BFD assertions which are
|
||||||
|
likely to signal incorrect output being generated but otherwise may
|
||||||
|
leave no trace. */
|
||||||
|
default_bfd_assert_handler = bfd_set_assert_handler (ld_bfd_assert_handler);
|
||||||
|
|
||||||
xatexit (ld_cleanup);
|
xatexit (ld_cleanup);
|
||||||
|
|
||||||
/* Set up the sysroot directory. */
|
/* Set up the sysroot directory. */
|
||||||
|
Reference in New Issue
Block a user