public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ld: Output error for warnings with --fatal-warnings
@ 2024-01-26 18:56 H.J. Lu
  2024-01-26 18:56 ` [PATCH 1/2] ld: Output error for linker " H.J. Lu
  2024-01-26 18:56 ` [PATCH 2/2] bfd: Output error for linker --fatal-warnings option H.J. Lu
  0 siblings, 2 replies; 4+ messages in thread
From: H.J. Lu @ 2024-01-26 18:56 UTC (permalink / raw)
  To: binutils

1. Since --fatal-warnings changes warnings into errors, we should output
error, instead of warning, for linker warnings.

Add %w to vfinfo to output "warning" if --fatal-warnings isn't used or
"error" otherwise.  Replace warning with %w in linker warnings.

2. Update _bfd_error_handler to output the warning prefix, which is default
to "warning".  Add %%w to _bfd_doprnt to output "error", instead of
"warning", when --fatal-warnings is used.  Update bfd_set_error_handler
to allow linker to set the warning prefix to "error" for --fatal-warnings.
Call bfd_set_error_handler after parsing all linker command-line arguments
so that config.fatal_warnings will be set for --fatal-warnings.

H.J. Lu (2):
  ld: Output error for linker warnings with --fatal-warnings
  bfd: Output error for linker --fatal-warnings option

 bfd/archive.c                          |   2 +-
 bfd/bfd-in2.h                          |   3 +-
 bfd/bfd.c                              |  34 +++-
 bfd/binary.c                           |   2 +-
 bfd/coff-arm.c                         |  14 +-
 bfd/coff-go32.c                        |   2 +-
 bfd/coff-mcore.c                       |   2 +-
 bfd/coff-sh.c                          |  14 +-
 bfd/coff-tic30.c                       |   2 +-
 bfd/coff-tic4x.c                       |   2 +-
 bfd/coff-tic54x.c                      |   2 +-
 bfd/coff-z80.c                         |   2 +-
 bfd/coff-z8k.c                         |   2 +-
 bfd/coffcode.h                         |  26 +--
 bfd/coffgen.c                          |   7 +-
 bfd/cofflink.c                         |   6 +-
 bfd/coffswap.h                         |   2 +-
 bfd/cpu-arm.c                          |   2 +-
 bfd/cpu-m68k.c                         |   2 +-
 bfd/ecoff.c                            |   2 +-
 bfd/elf-properties.c                   |  10 +-
 bfd/elf-s390-common.c                  |   6 +-
 bfd/elf.c                              |  24 +--
 bfd/elf32-arc.c                        |   8 +-
 bfd/elf32-arm.c                        |  44 ++---
 bfd/elf32-bfin.c                       |   2 +-
 bfd/elf32-csky.c                       |   8 +-
 bfd/elf32-msp430.c                     |   2 +-
 bfd/elf32-nds32.c                      |  18 +-
 bfd/elf32-ppc.c                        |   6 +-
 bfd/elf32-rl78.c                       |   2 +-
 bfd/elf32-rx.c                         |   6 +-
 bfd/elf32-score.c                      |   2 +-
 bfd/elf32-score7.c                     |   2 +-
 bfd/elf32-sh.c                         |  16 +-
 bfd/elf32-spu.c                        |   6 +-
 bfd/elf32-tic6x.c                      |  10 +-
 bfd/elf32-v850.c                       |  14 +-
 bfd/elf32-vax.c                        |   8 +-
 bfd/elf64-alpha.c                      |   4 +-
 bfd/elf64-ia64-vms.c                   |   8 +-
 bfd/elf64-ppc.c                        |  12 +-
 bfd/elfcode.h                          |   6 +-
 bfd/elfcore.h                          |   2 +-
 bfd/elflink.c                          |  36 ++--
 bfd/elfnn-aarch64.c                    |   4 +-
 bfd/elfnn-loongarch.c                  |   2 +-
 bfd/elfnn-riscv.c                      |  10 +-
 bfd/elfxx-aarch64.c                    |   4 +-
 bfd/elfxx-mips.c                       |  34 ++--
 bfd/elfxx-x86.c                        |   4 +-
 bfd/format.c                           |   7 +-
 bfd/mmo.c                              |   2 +-
 bfd/xcofflink.c                        |   2 +-
 ld/emultempl/aix.em                    |  24 +--
 ld/emultempl/armelf.em                 |   4 +-
 ld/emultempl/beos.em                   |   2 +-
 ld/emultempl/m68hc1xelf.em             |   2 +-
 ld/emultempl/msp430.em                 |   4 +-
 ld/emultempl/nto.em                    |   4 +-
 ld/emultempl/pe.em                     |  18 +-
 ld/emultempl/pep.em                    |  12 +-
 ld/emultempl/xtensaelf.em              |   6 +-
 ld/ldelf.c                             |  20 +-
 ld/ldelfgen.c                          |   6 +-
 ld/ldexp.c                             |   2 +-
 ld/ldlang.c                            |  44 ++---
 ld/ldmain.c                            |  53 +++---
 ld/ldmisc.c                            |   8 +-
 ld/pdb.c                               | 246 ++++++++++++-------------
 ld/pe-dll.c                            |   2 +-
 ld/testsuite/ld-elf/fatal-warnings-5.d |   6 +
 ld/testsuite/ld-elf/note-4.l           |   2 +
 ld/testsuite/ld-elf/shared.exp         |   5 +
 ld/testsuite/ld-i386/pr28894.d         |   2 +-
 ld/testsuite/ld-i386/warn1.d           |   2 +-
 ld/testsuite/ld-scripts/defined.exp    |   1 +
 ld/testsuite/ld-scripts/defined7.d     |   3 +
 78 files changed, 493 insertions(+), 446 deletions(-)
 create mode 100644 ld/testsuite/ld-elf/fatal-warnings-5.d
 create mode 100644 ld/testsuite/ld-elf/note-4.l
 create mode 100644 ld/testsuite/ld-scripts/defined7.d

-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-26 19:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-26 18:56 [PATCH 0/2] ld: Output error for warnings with --fatal-warnings H.J. Lu
2024-01-26 18:56 ` [PATCH 1/2] ld: Output error for linker " H.J. Lu
2024-01-26 19:20   ` Fangrui Song
2024-01-26 18:56 ` [PATCH 2/2] bfd: Output error for linker --fatal-warnings option H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).