Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/external/gpl3/binutils/dist/bfd Pull up following revisio...



details:   https://anonhg.NetBSD.org/src/rev/ec1ddb19a853
branches:  netbsd-9
changeset: 745234:ec1ddb19a853
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Feb 25 20:05:48 2020 +0000

description:
Pull up following revision(s) (requested by rin in ticket #726):

        external/gpl3/binutils/dist/bfd/elf.c: revision 1.14

Fix 'nm /dev/ksyms' (noticed by ryo).

Since binutils 2.15, nm(1) cannot be used for character devices.

We worked around this by a local patch:
http://cvsweb.netbsd.org/bsdweb.cgi/src/gnu/dist/binutils/binutils/Attic/bucomm.c?r1=1.1.1.2&hideattic=0#rev1.2

With recent update of binutils, 'nm /dev/ksyms' got broken again.

This is due to a consistency check involving file size reported by
stat(2), which is always zero for character devices. So, skip this
check if file size is zero.

diffstat:

 external/gpl3/binutils/dist/bfd/elf.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r cdcb696c625a -r ec1ddb19a853 external/gpl3/binutils/dist/bfd/elf.c
--- a/external/gpl3/binutils/dist/bfd/elf.c     Tue Feb 25 20:03:12 2020 +0000
+++ b/external/gpl3/binutils/dist/bfd/elf.c     Tue Feb 25 20:05:48 2020 +0000
@@ -298,7 +298,8 @@
       /* Allocate and clear an extra byte at the end, to prevent crashes
         in case the string table is not terminated.  */
       if (shstrtabsize + 1 <= 1
-         || shstrtabsize > bfd_get_file_size (abfd)
+         || (bfd_get_file_size (abfd) > 0 /* not a character device */
+               && shstrtabsize > bfd_get_file_size (abfd))
          || bfd_seek (abfd, offset, SEEK_SET) != 0
          || (shstrtab = (bfd_byte *) bfd_alloc (abfd, shstrtabsize + 1)) == NULL)
        shstrtab = NULL;



Home | Main Index | Thread Index | Old Index