mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 12:34:43 +00:00
ld -w currently causes segmentation faults and other misbehaviour since it changes einfo with %F in the format string (fatal error) to not exit. This patch fixes that by introducing a new variant of einfo called "fatal" that always exits, and replaces all einfo calls using %F with a call to fatal without the %F. I considered modifying einfo to inspect the first 2 or 4 chars in the format string, looking for %F, but decided that was probably a bad idea given that translators might have moved the %F. It's also a little nicer to inform the compiler of a function that doesn't return. The patch also fixes some formatting nits, and makes use of %pA to print section names in a couple of places in aix.em.
46 lines
1.6 KiB
C
46 lines
1.6 KiB
C
/* ldmisc.h -
|
|
Copyright (C) 1991-2025 Free Software Foundation, Inc.
|
|
|
|
This file is part of the GNU Binutils.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
|
MA 02110-1301, USA. */
|
|
|
|
#ifndef LDMISC_H
|
|
#define LDMISC_H
|
|
|
|
extern void vfinfo (FILE *fp, const char *fmt, va_list arg, bool is_warning);
|
|
extern void einfo (const char *, ...);
|
|
extern void fatal (const char *, ...) ATTRIBUTE_NORETURN;
|
|
extern void minfo (const char *, ...);
|
|
extern void info_msg (const char *, ...);
|
|
extern void lfinfo (FILE *, const char *, ...);
|
|
extern void info_assert (const char *, unsigned int);
|
|
extern void queue_unknown_cmdline_warning (const char *, ...);
|
|
extern void output_unknown_cmdline_warnings (void);
|
|
|
|
#define ASSERT(x) \
|
|
do { if (!(x)) info_assert(__FILE__,__LINE__); } while (0)
|
|
|
|
#define FAIL() \
|
|
do { info_assert(__FILE__,__LINE__); } while (0)
|
|
|
|
extern void print_spaces (int);
|
|
#define print_space() print_spaces (1)
|
|
extern void print_nl (void);
|
|
extern void percent_decode (const char *, char *);
|
|
|
|
#endif
|