Bug 229046

Summary: [meta] GNU objdump removal tracking PR
Product: Base System Reporter: Ed Maste <emaste>
Component: binAssignee: freebsd-bugs mailing list <bugs>
Status: New ---    
Severity: Affects Only Me CC: eadler, gleb, jmg, marklmi26-fbsd, shawn.webb
Priority: --- Keywords: tracking
Version: CURRENT   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198696
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218387
Bug Depends on: 212319, 229049, 233437    
Bug Blocks: 233094    

Description Ed Maste freebsd_committer 2018-06-15 16:07:28 UTC
An ongoing project in FreeBSD is the migration to modern, permissively licensed components for the tool chain, which includes moving away from the obsolete binutils components still in the base system.

This PR tracks outstanding issues in removing GNU objdump 2.17.50 from the base system.
Comment 1 commit-hook freebsd_committer 2018-06-15 16:15:37 UTC
A commit references this bug:

Author: emaste
Date: Fri Jun 15 16:14:42 UTC 2018
New revision: 335209
URL: https://svnweb.freebsd.org/changeset/base/335209

Log:
  elf.5: add readelf cross-reference

  objdump is sometimes used in cases where readelf is more appropriate,
  but the obsolete GNU objdump we have in the base system will be removed
  in the future.

  .Xr readelf from elf.5 to improve the odds the more appropriate tool
  will be found.

  PR:		229046
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/share/man/man5/elf.5
Comment 2 commit-hook freebsd_committer 2018-06-15 16:19:42 UTC
A commit references this bug:

Author: emaste
Date: Fri Jun 15 16:18:40 UTC 2018
New revision: 335210
URL: https://svnweb.freebsd.org/changeset/base/335210

Log:
  Remove objcopy from BINUTILS option descriptions

  As of r306649 objcopy is always ELF Tool Chain's elfcopy; binutils
  objcopy is never used.

  PR:		229046
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/tools/build/options/WITHOUT_BINUTILS
  head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP
  head/tools/build/options/WITH_BINUTILS
  head/tools/build/options/WITH_BINUTILS_BOOTSTRAP
Comment 3 Ed Maste freebsd_committer 2018-06-15 16:23:47 UTC
release/picobsd/build/picobsd
used to find lib depends

                i="`objdump -x ${tmp} | \
                        awk '$1 == "NEEDED" { print $2 }' | sort | uniq | tr '\n' ' '`"

share/man/man5/elf.5

.Xr objdump 1 ,

sys/conf/kern.pre.mk
seems to be a objcopy typo

# Architecture and output format arguments for objdump to convert image to
# object file

tools/debugscripts/kld_deb.py

        j = popen2.popen4('objdump --section-headers "%s" | grep "\.text"' % p)[0].read().strip().split()

tools/tools/shlib-compat/shlib-compat.py

usr.bin/ldd/sods.c

    if (IS_ELF(*(const Elf32_Ehdr*) align_struct(file_base))) {
        warnx("%s: this is an ELF program; use objdump to examine", fname);

usr.sbin/asf/asf.c

    snprintf(ocbuf, sizeof(ocbuf),
             "/usr/bin/objdump --section-headers %s", path);

usr.sbin/pmcannotate/pmcannotate.8
usr.sbin/pmcannotate/pmcannotate.c
Comment 4 commit-hook freebsd_committer 2018-06-15 16:29:51 UTC
A commit references this bug:

Author: emaste
Date: Fri Jun 15 16:28:50 UTC 2018
New revision: 335213
URL: https://svnweb.freebsd.org/changeset/base/335213

Log:
  ldd: reference readelf instead of objdump in warning message

  We have an obsolete GNU objdump 2.17.50 in the base system, which will
  be removed in the future.  Suggest readelf(1) for examining ELF files
  instead; for most use cases it is the preferred tool anyhow.

  PR:		229046
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/usr.bin/ldd/sods.c
Comment 5 commit-hook freebsd_committer 2018-06-15 16:32:56 UTC
A commit references this bug:

Author: emaste
Date: Fri Jun 15 16:32:18 UTC 2018
New revision: 335214
URL: https://svnweb.freebsd.org/changeset/base/335214

Log:
  Correct kern.pre.mk comment: objcopy, not objdump, copies objects.

  PR:		229046
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/sys/conf/kern.pre.mk
Comment 6 Ed Maste freebsd_committer 2018-06-15 16:43:26 UTC
jmg@, could you update tools/debugscripts/kld_deb.py to use readelf instead of objdump?
Comment 7 Ed Maste freebsd_committer 2018-06-15 16:46:03 UTC
gleb@, could you update tools/tools/shlib-compat/shlib-compat.py to use readelf instead of objdump?
Comment 8 Ed Maste freebsd_committer 2018-06-15 16:49:00 UTC
jhb@ points out that both kld_deb.py and asf are rendered obsolete by kgdb internally handling FreeBSD kernel module state.
Comment 9 Ed Maste freebsd_committer 2018-06-15 16:58:50 UTC
asf removal code review: https://reviews.freebsd.org/D15827
Comment 10 Ed Maste freebsd_committer 2018-06-15 17:00:48 UTC
objdump disconnection code review: https://reviews.freebsd.org/D7338
objdump deprecation notice review: https://reviews.freebsd.org/D13881
Comment 11 commit-hook freebsd_committer 2018-06-15 17:04:20 UTC
A commit references this bug:

Author: emaste
Date: Fri Jun 15 17:03:49 UTC 2018
New revision: 335217
URL: https://svnweb.freebsd.org/changeset/base/335217

Log:
  Add deprecation notice to objdump man page

  PR:		229046
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D13881

Changes:
  head/contrib/binutils/binutils/doc/binutils.texi
Comment 12 commit-hook freebsd_committer 2018-06-15 17:38:50 UTC
A commit references this bug:

Author: emaste
Date: Fri Jun 15 17:38:08 UTC 2018
New revision: 335221
URL: https://svnweb.freebsd.org/changeset/base/335221

Log:
  Add deprecation notice in asf.8

  PR:		229046
  Reviewed by:	jhb
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/usr.sbin/asf/asf.8
Comment 13 commit-hook freebsd_committer 2018-06-15 17:44:57 UTC
A commit references this bug:

Author: emaste
Date: Fri Jun 15 17:44:22 UTC 2018
New revision: 335222
URL: https://svnweb.freebsd.org/changeset/base/335222

Log:
  Remove obsolete asf(8)

  kgdb now handles kernel module state internally, so the asf tool serves
  no purpose.

  PR:		229046
  Reviewed by:	brooks
  Relnotes:	yes
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D15827

Changes:
  head/ObsoleteFiles.inc
  head/targets/pseudo/userland/Makefile.depend
  head/usr.sbin/Makefile.amd64
  head/usr.sbin/Makefile.i386
  head/usr.sbin/asf/
Comment 14 commit-hook freebsd_committer 2018-06-22 00:27:45 UTC
A commit references this bug:

Author: emaste
Date: Fri Jun 22 00:27:32 UTC 2018
New revision: 335518
URL: https://svnweb.freebsd.org/changeset/base/335518

Log:
  MFC r335221: Add deprecation notice in asf.8

  PR:		229046
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/11/
  stable/11/usr.sbin/asf/asf.8
Comment 15 commit-hook freebsd_committer 2018-06-22 00:28:49 UTC
A commit references this bug:

Author: emaste
Date: Fri Jun 22 00:28:28 UTC 2018
New revision: 335519
URL: https://svnweb.freebsd.org/changeset/base/335519

Log:
  MFC r335214: Correct kern.pre.mk comment: objcopy copies objects.

  (Not objdump.)

  PR:		229046
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/11/
  stable/11/sys/conf/kern.pre.mk
Comment 16 commit-hook freebsd_committer 2018-06-22 00:29:52 UTC
A commit references this bug:

Author: emaste
Date: Fri Jun 22 00:29:29 UTC 2018
New revision: 335520
URL: https://svnweb.freebsd.org/changeset/base/335520

Log:
  MFC r335209: elf.5: add readelf cross-reference

  objdump is sometimes used in cases where readelf is more appropriate,
  but the obsolete GNU objdump we have in the base system will be removed
  in the future.

  .Xr readelf from elf.5 to improve the odds the more appropriate tool
  will be found.

  PR:		229046
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/11/
  stable/11/share/man/man5/elf.5
Comment 17 commit-hook freebsd_committer 2018-06-22 00:30:56 UTC
A commit references this bug:

Author: emaste
Date: Fri Jun 22 00:30:25 UTC 2018
New revision: 335521
URL: https://svnweb.freebsd.org/changeset/base/335521

Log:
  MFC r335213: ldd: reference readelf instead of objdump in warning message

  We have an obsolete GNU objdump 2.17.50 in the base system, which will
  be removed in the future.  Suggest readelf(1) for examining ELF files
  instead; for most use cases it is the preferred tool anyhow.

  PR:		229046
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/11/
  stable/11/usr.bin/ldd/sods.c
Comment 18 Mark Millard 2018-08-26 21:46:59 UTC
See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230288
for an example where sysutils/u-boot-master/Makefile can
be made to work for sysutils/u-boot-pine64 with something
like:

BUILD_DEPENDS+=	objdump:devel/binutils

to build a correct u-boot-pine64.

Based on a WITHOUT_BINUTILS_BOOSTRAP= WITHOUT_BINUTILS=
context the build without such a change completed but what
was built was wrong.
Comment 19 Mark Millard 2018-09-19 01:27:02 UTC
(In reply to Mark Millard from comment #18)

Ignore Comment #18: further testing showed that
the problem was intermittent races failing for
multi-process builds: MAKE_JOBS_UNSAFE=yes avoids
the build problem even without the
BUILD_DEPENDS+=objdump:devel/binutils .

This was easier to produce on the Pine64+ 2GB
environment that I've been using than in the
amd64 environment that I've been using.
Comment 20 Ed Maste freebsd_committer 2018-11-23 14:17:10 UTC
Proposal to install llvm-objdump as /usr/bin/objdump on Clang-using architectures: https://reviews.freebsd.org/D18307
Comment 21 commit-hook freebsd_committer 2019-08-01 17:03:50 UTC
A commit references this bug:

Author: emaste
Date: Thu Aug  1 17:02:59 UTC 2019
New revision: 350506
URL: https://svnweb.freebsd.org/changeset/base/350506

Log:
  remove obsolete kernel debugging script

  For quite some time kgdb has been internally handling FreeBSD kernel
  module state; add-on scripts and tools are not needed.  asf(8) served
  a similar purpose to this script and was removed in r335222.

  PR:		229046
  Reported by:	jhb
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/tools/debugscripts/kld_deb.py