Use bfd_get_filename throughout gas
authorAlan Modra <amodra@gmail.com>
Tue, 19 May 2020 03:25:27 +0000 (12:55 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 19 May 2020 03:25:27 +0000 (12:55 +0930)
* write.c (write_contents): Use bfd_get_filename rather than
accessing bfd->filename directly.  Use bfd_section_name rather
than accessing section->name directly.

gas/ChangeLog
gas/write.c

index c73d02a5da5ce5bc9df98bd8ccd7f2c43448f7a5..05f5f2385ccf5155f2e26dfef04d5cdc4c6e486e 100644 (file)
@@ -1,3 +1,9 @@
+2020-05-19  Alan Modra  <amodra@gmail.com>
+
+       * write.c (write_contents): Use bfd_get_filename rather than
+       accessing bfd->filename directly.  Use bfd_section_name rather
+       than accessing section->name directly.
+
 2020-05-19  Alan Modra  <amodra@gmail.com>
 
        * symbols.c (local_symbol_make): Init all of lsy_flags.
index 0a6f07aa07795df47f8c7e0aced35c1683a60664..5825117548c7687c326646056ab4745f0c9824c3 100644 (file)
@@ -1625,7 +1625,7 @@ write_contents (bfd *abfd ATTRIBUTE_UNUSED,
                                "to section %s of %s: '%s'",
                                (long) f->fr_fix),
                      (long) f->fr_fix,
-                     sec->name, stdoutput->filename,
+                     bfd_section_name (sec), bfd_get_filename (stdoutput),
                      bfd_errmsg (bfd_get_error ()));
          offset += f->fr_fix;
        }
@@ -1649,9 +1649,11 @@ write_contents (bfd *abfd ATTRIBUTE_UNUSED,
                                    "in section %s of %s: '%s'",
                                    "can't fill %ld bytes "
                                    "in section %s of %s: '%s'",
-                                   (long) count), (long) count,
-                                   sec->name, stdoutput->filename,
-                                   bfd_errmsg (bfd_get_error ()));
+                                   (long) count),
+                         (long) count,
+                         bfd_section_name (sec),
+                         bfd_get_filename (stdoutput),
+                         bfd_errmsg (bfd_get_error ()));
              offset += count;
              free (buf);
            }
@@ -1678,7 +1680,8 @@ write_contents (bfd *abfd ATTRIBUTE_UNUSED,
                                        "in section %s of %s: '%s'",
                                        (long) fill_size),
                              (long) fill_size,
-                             sec->name, stdoutput->filename,
+                             bfd_section_name (sec),
+                             bfd_get_filename (stdoutput),
                              bfd_errmsg (bfd_get_error ()));
                  offset += fill_size;
                }
@@ -1714,7 +1717,8 @@ write_contents (bfd *abfd ATTRIBUTE_UNUSED,
                                        "in section %s of %s: '%s'",
                                        (long) (n_per_buf * fill_size)),
                              (long) (n_per_buf * fill_size),
-                             sec->name, stdoutput->filename,
+                             bfd_section_name (sec),
+                             bfd_get_filename (stdoutput),
                              bfd_errmsg (bfd_get_error ()));
                  offset += n_per_buf * fill_size;
                }