@@ -58,8 +58,6 @@ suitable for gas to consume.
5858#include <stdio.h>
5959#include <string.h>
6060#include <getopt.h>
61- #include <signal.h>
62- #include <execinfo.h>
6361
6462#ifdef HAVE_STDLIB_H
6563#include <stdlib.h>
@@ -4346,50 +4344,13 @@ show_help (void)
43464344 show_usage (stdout , 0 );
43474345}
43484346
4349- /* Install a SIGABRT handler to capture a backtrace when aborting in non-ASAN builds. */
4350- static void crash_signal_handler (int sig )
4351- {
4352- void * buffer [64 ];
4353- int nptrs = backtrace (buffer , (int )(sizeof (buffer ) / sizeof (buffer [0 ])));
4354- char logpath [256 ];
4355- snprintf (logpath , sizeof logpath , "/tmp/masp_abort_%d.log" , getpid ());
4356- FILE * f = fopen (logpath , "w" );
4357- if (f ) {
4358- fprintf (f , "Signal %d received (PID %d)\n" , sig , getpid ());
4359- char * * symbols = backtrace_symbols (buffer , nptrs );
4360- if (symbols ) {
4361- fprintf (f , "Backtrace (%d frames):\n" , nptrs );
4362- for (int i = 0 ; i < nptrs ; ++ i ) {
4363- fprintf (f , " %s\n" , symbols [i ]);
4364- }
4365- free (symbols );
4366- }
4367- fclose (f );
4368- }
4369- /* Re-raise default to generate core/abort semantics */
4370- signal (sig , SIG_DFL );
4371- raise (sig );
4372- }
4373-
4374- static void install_crash_handlers (void )
4375- {
4376- struct sigaction sa ;
4377- memset (& sa , 0 , sizeof (sa ));
4378- sa .sa_handler = crash_signal_handler ;
4379- sigemptyset (& sa .sa_mask );
4380- sa .sa_flags = SA_RESETHAND ;
4381- sigaction (SIGABRT , & sa , NULL );
4382- }
4383-
43844347int
43854348main (int argc , char * argv [])
43864349{
43874350 int opt ;
43884351 char * out_name = 0 ;
43894352 sp = include_stack ;
43904353
4391- install_crash_handlers ();
4392-
43934354 cml_prefix_char = prefix_char = '.' ; // The default
43944355 masp_syntax = 1 ; // The default
43954356 line_info = 0 ; // Default
0 commit comments