* ld.texinfo: Document --fatal-warnings.
* ld.1: Regenerate. * ldmisc.c (vfinfo): Set flag to inhibit making executable if warnings have been turned into errors. * lexsup.c (OPTION_WARN_FATAL): Define. (ld_options): Entry for --fatal-warnings. (parse_args): Handle OPTION_WARN_FATAL. * ld.h (ld_config_type): Add fatal_warnings field.
This commit is contained in:
parent
f5fa8ca231
commit
7ce691aec4
6 changed files with 47 additions and 5 deletions
12
ld/ChangeLog
12
ld/ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2001-04-13 J.T. Conklin <jtc@redback.com>
|
||||
|
||||
* ld.texinfo: Document --fatal-warnings.
|
||||
* ld.1: Regenerate.
|
||||
|
||||
* ldmisc.c (vfinfo): Set flag to inhibit making executable if
|
||||
warnings have been turned into errors.
|
||||
* lexsup.c (OPTION_WARN_FATAL): Define.
|
||||
(ld_options): Entry for --fatal-warnings.
|
||||
(parse_args): Handle OPTION_WARN_FATAL.
|
||||
* ld.h (ld_config_type): Add fatal_warnings field.
|
||||
|
||||
2001-04-13 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* ldmain.c (main): Default to discard_sec_merge.
|
||||
|
|
18
ld/ld.1
18
ld/ld.1
|
@ -2,8 +2,16 @@
|
|||
''' $RCSfile$$Revision$$Date$
|
||||
'''
|
||||
''' $Log$
|
||||
''' Revision 1.9 2001/03/25 20:32:31 nickc
|
||||
''' Automate generate on man pages
|
||||
''' Revision 1.10 2001/04/13 02:22:23 jtc
|
||||
''' * ld.texinfo: Document --fatal-warnings.
|
||||
''' * ld.1: Regenerate.
|
||||
'''
|
||||
''' * ldmisc.c (vfinfo): Set flag to inhibit making executable if
|
||||
''' warnings have been turned into errors.
|
||||
''' * lexsup.c (OPTION_WARN_FATAL): Define.
|
||||
''' (ld_options): Entry for --fatal-warnings.
|
||||
''' (parse_args): Handle OPTION_WARN_FATAL.
|
||||
''' * ld.h (ld_config_type): Add fatal_warnings field.
|
||||
'''
|
||||
'''
|
||||
.de Sh
|
||||
|
@ -96,7 +104,7 @@
|
|||
.nr % 0
|
||||
.rr F
|
||||
.\}
|
||||
.TH LD 1 "binutils-2.11.90" "23/Mar/101" "GNU"
|
||||
.TH LD 1 "binutils-2.11.90" "30/Mar/2001" "GNU"
|
||||
.UC
|
||||
.if n .hy 0
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
|
@ -753,6 +761,8 @@ generated by the \-membedded-pic option to the \s-1GNU\s0 compiler and
|
|||
assembler. It causes the linker to create a table which may be used at
|
||||
runtime to relocate any data which was statically initialized to pointer
|
||||
values. See the code in testsuite/ld-empic for details.
|
||||
.Ip "\f(CW--fatal-warnings\fR" 4
|
||||
Treat all warnings as errors.
|
||||
.Ip "\f(CW--force-exe-suffix\fR" 4
|
||||
Make sure that an output file has a .exe suffix.
|
||||
.Sp
|
||||
|
@ -1492,6 +1502,8 @@ section entitled \*(L"GNU Free Documentation License\*(R".
|
|||
|
||||
.IX Item "\f(CW--embedded-relocs\fR"
|
||||
|
||||
.IX Item "\f(CW--fatal-warnings\fR"
|
||||
|
||||
.IX Item "\f(CW--force-exe-suffix\fR"
|
||||
|
||||
.IX Item "\f(CW--no-gc-sections\fR"
|
||||
|
|
3
ld/ld.h
3
ld/ld.h
|
@ -192,6 +192,9 @@ typedef struct {
|
|||
changes due to the alignment of an input section. */
|
||||
boolean warn_section_align;
|
||||
|
||||
/* If true, warning messages are fatal */
|
||||
boolean fatal_warnings;
|
||||
|
||||
boolean sort_common;
|
||||
|
||||
boolean text_read_only;
|
||||
|
|
|
@ -982,6 +982,11 @@ assembler. It causes the linker to create a table which may be used at
|
|||
runtime to relocate any data which was statically initialized to pointer
|
||||
values. See the code in testsuite/ld-empic for details.
|
||||
|
||||
|
||||
@kindex --fatal-warnings
|
||||
@item --fatal-warnings
|
||||
Treat all warnings as errors.
|
||||
|
||||
@kindex --force-exe-suffix
|
||||
@item --force-exe-suffix
|
||||
Make sure that an output file has a .exe suffix.
|
||||
|
@ -1333,7 +1338,7 @@ about the version heirarchy for the library being created. This option
|
|||
is only meaningful on ELF platforms which support shared libraries.
|
||||
@xref{VERSION}.
|
||||
|
||||
@kindex --warn-comon
|
||||
@kindex --warn-common
|
||||
@cindex warnings, on combining symbols
|
||||
@cindex combining symbols, warnings on
|
||||
@item --warn-common
|
||||
|
|
|
@ -399,6 +399,9 @@ vfinfo (fp, fmt, arg)
|
|||
}
|
||||
}
|
||||
|
||||
if (config.fatal_warnings)
|
||||
config.make_executable = false;
|
||||
|
||||
if (fatal == true)
|
||||
xexit (1);
|
||||
}
|
||||
|
|
|
@ -109,7 +109,8 @@ int parsing_defsym = 0;
|
|||
#define OPTION_VERSION_EXPORTS_SECTION (OPTION_VERSION_SCRIPT + 1)
|
||||
#define OPTION_WARN_COMMON (OPTION_VERSION_EXPORTS_SECTION + 1)
|
||||
#define OPTION_WARN_CONSTRUCTORS (OPTION_WARN_COMMON + 1)
|
||||
#define OPTION_WARN_MULTIPLE_GP (OPTION_WARN_CONSTRUCTORS + 1)
|
||||
#define OPTION_WARN_FATAL (OPTION_WARN_CONSTRUCTORS + 1)
|
||||
#define OPTION_WARN_MULTIPLE_GP (OPTION_WARN_FATAL + 1)
|
||||
#define OPTION_WARN_ONCE (OPTION_WARN_MULTIPLE_GP + 1)
|
||||
#define OPTION_WARN_SECTION_ALIGN (OPTION_WARN_ONCE + 1)
|
||||
#define OPTION_SPLIT_BY_RELOC (OPTION_WARN_SECTION_ALIGN + 1)
|
||||
|
@ -388,6 +389,9 @@ static const struct ld_option ld_options[] =
|
|||
{ {"warn-section-align", no_argument, NULL, OPTION_WARN_SECTION_ALIGN},
|
||||
'\0', NULL, N_("Warn if start of section changes due to alignment"),
|
||||
TWO_DASHES },
|
||||
{ {"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL},
|
||||
'\0', NULL, N_("Treat warnings as errors"),
|
||||
TWO_DASHES },
|
||||
{ {"whole-archive", no_argument, NULL, OPTION_WHOLE_ARCHIVE},
|
||||
'\0', NULL, N_("Include all objects from following archives"), TWO_DASHES },
|
||||
{ {"wrap", required_argument, NULL, OPTION_WRAP},
|
||||
|
@ -1032,6 +1036,9 @@ the GNU General Public License. This program has absolutely no warranty.\n"));
|
|||
case OPTION_WARN_CONSTRUCTORS:
|
||||
config.warn_constructors = true;
|
||||
break;
|
||||
case OPTION_WARN_FATAL:
|
||||
config.fatal_warnings = true;
|
||||
break;
|
||||
case OPTION_WARN_MULTIPLE_GP:
|
||||
config.warn_multiple_gp = true;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue