Update Traditional Chinese translation for the binutils sub-directory.
[deliverable/binutils-gdb.git] / ld / ldmisc.c
index d2011510e2ac28c4bc44065ec26ddd4eac2c89fc..b714b97105369e638f00041079f64ee3d6ff86c5 100644 (file)
@@ -1,5 +1,5 @@
 /* ldmisc.c
-   Copyright (C) 1991-2018 Free Software Foundation, Inc.
+   Copyright (C) 1991-2020 Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support.
 
    This file is part of the GNU Binutils.
@@ -23,6 +23,7 @@
 #include "bfd.h"
 #include "bfdlink.h"
 #include "libiberty.h"
+#include "ctf-api.h"
 #include "safe-ctype.h"
 #include "filenames.h"
 #include "demangle.h"
@@ -35,8 +36,6 @@
 #include "ldlex.h"
 #include "ldmain.h"
 #include "ldfile.h"
-#include "elf-bfd.h"
-#include "coff-bfd.h"
 
 /*
  %% literal %
@@ -323,6 +322,7 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning)
                unsigned int linenumber;
                bfd_boolean discard_last;
                bfd_boolean done;
+               bfd_error_type last_bfd_error = bfd_get_error ();
 
                abfd = args[arg_no].reladdr.abfd;
                section = args[arg_no].reladdr.sec;
@@ -332,7 +332,7 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning)
                if (abfd != NULL)
                  {
                    if (!bfd_generic_link_read_symbols (abfd))
-                     einfo (_("%pB%F: could not read symbols: %E\n"), abfd);
+                     einfo (_("%F%P: %pB: could not read symbols: %E\n"), abfd);
 
                    asymbols = bfd_get_outsymbols (abfd);
                  }
@@ -371,7 +371,7 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning)
                                && filename_cmp (last_file, filename) != 0)
                            || strcmp (last_function, functionname) != 0)
                          {
-                           lfinfo (fp, _("%pB: In function `%pT':\n"),
+                           lfinfo (fp, _("%pB: in function `%pT':\n"),
                                    abfd, functionname);
 
                            last_bfd = abfd;
@@ -407,6 +407,7 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning)
                  }
                if (!done)
                  lfinfo (fp, "(%pA+0x%v)", section, offset);
+               bfd_set_error (last_bfd_error);
 
                if (discard_last)
                  {
@@ -431,26 +432,18 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning)
                  /* section name from a section */
                  asection *sec;
                  bfd *abfd;
-                 const char *group = NULL;
-                 struct coff_comdat_info *ci;
 
                  fmt++;
                  sec = (asection *) args[arg_no].p;
                  ++arg_count;
-                 abfd = sec->owner;
                  fprintf (fp, "%s", sec->name);
-                 if (abfd != NULL
-                     && bfd_get_flavour (abfd) == bfd_target_elf_flavour
-                     && elf_next_in_group (sec) != NULL
-                     && (sec->flags & SEC_GROUP) == 0)
-                   group = elf_group_name (sec);
-                 else if (abfd != NULL
-                          && bfd_get_flavour (abfd) == bfd_target_coff_flavour
-                          && (ci = bfd_coff_get_comdat_section (sec->owner,
-                                                                sec)) != NULL)
-                   group = ci->name;
-                 if (group != NULL)
-                   fprintf (fp, "[%s]", group);
+                 abfd = sec->owner;
+                 if (abfd != NULL)
+                   {
+                     const char *group = bfd_group_name (abfd, sec);
+                     if (group != NULL)
+                       fprintf (fp, "[%s]", group);
+                   }
                }
              else if (*fmt == 'B')
                {
@@ -476,15 +469,13 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning)
                  fmt++;
                  i = (lang_input_statement_type *) args[arg_no].p;
                  ++arg_count;
-                 if (i->the_bfd->my_archive != NULL
+                 if (i->the_bfd != NULL
+                     && i->the_bfd->my_archive != NULL
                      && !bfd_is_thin_archive (i->the_bfd->my_archive))
-                   fprintf (fp, "(%s)",
-                            bfd_get_filename (i->the_bfd->my_archive));
-                 fprintf (fp, "%s", i->local_sym_name);
-                 if ((i->the_bfd->my_archive == NULL
-                      || bfd_is_thin_archive (i->the_bfd->my_archive))
-                     && filename_cmp (i->local_sym_name, i->filename) != 0)
-                   fprintf (fp, " (%s)", i->filename);
+                   fprintf (fp, "(%s)%s", i->the_bfd->my_archive->filename,
+                            i->local_sym_name);
+                 else
+                   fprintf (fp, "%s", i->filename);
                }
              else if (*fmt == 'R')
                {
@@ -700,6 +691,6 @@ ld_abort (const char *file, int line, const char *fn)
   else
     einfo (_("%P: internal error: aborting at %s:%d\n"),
           file, line);
-  einfo (_("%P%F: please report this bug\n"));
+  einfo (_("%F%P: please report this bug\n"));
   xexit (1);
 }
This page took 0.032399 seconds and 4 git commands to generate.