|Summary:||base system's objdump -g doesn't display any information|
|Product:||Base System||Reporter:||Kurt Lidl <lidl>|
|Component:||bin||Assignee:||freebsd-bugs mailing list <bugs>|
|Severity:||Affects Some People||CC:||emaste|
Description Kurt Lidl 2015-03-19 03:04:21 UTC
On a relatively recent -CURRENT system: uname -a: FreeBSD busybox.pix.net 11.0-CURRENT FreeBSD 11.0-CURRENT #19 r280171M: Tue Mar 17 10:55:28 EDT 2015 email@example.com:/usr/obj/usr/src/sys/BUSYBOX amd64 clang -v: FreeBSD clang version 3.6.0 (tags/RELEASE_360/final 230434) 20150225 Target: x86_64-unknown-freebsd11.0 Thread model: posix /usr/bin/objdump doesn't display any useful information from a .o object file compiled with 'clang -g': lidl@busybox-234: /usr/bin/objdump -v GNU objdump 2.17.50 [FreeBSD] 2007-07-03 Copyright 2007 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty. lidl@busybox-235: /usr/bin/objdump -g ls.o ls.o: file format elf64-x86-64-freebsd /usr/bin/objdump: ls.o: no recognized debugging information The latest binutils from /usr/ports, however, does work: lidl@busybox-236: /usr/local/bin/objdump -v GNU objdump (GNU Binutils) 2.25 Copyright (C) 2014 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) any later version. This program has absolutely no warranty. lidl@busybox-237: /usr/local/bin/objdump -g ls.o | head ls.o: file format elf64-x86-64-freebsd Contents of the .debug_info section: Compilation Unit @ offset 0x0: Length: 0x1172 (32-bit) Version: 2 Abbrev Offset: 0x0 Pointer Size: 8 Is there any hope for getting a working 'objdump -g' in the base system? Isn't there a 'objdump' in the elf-toolchain? Trying to use 'llvm-objdump -g ls.o' just spits out a usage message.
Comment 1 Ed Maste 2015-03-20 01:54:19 UTC
elftoolchain doesn't include an objdump. Some of objdump's capabilities are also available in other tools, but as elftoolchain currently doesn't have a disassembler it can't provide a viable objdump at the moment. There is llvm-objdump though, which we might bring in.
Comment 2 Ed Maste 2015-10-14 13:27:03 UTC
> There is llvm-objdump though, which we might bring in. Somehow I missed that you commented on llvm-objdump already, reporting that lacked -g. I think the most likely path here is still to add the missing functionality to llvm-objdump and bring it in.
Comment 3 Ed Maste 2015-10-14 13:31:14 UTC
That said, it seems base system objdump does emit the appropriate debug info with -W. It just doesn't detect DWARF debug info with -g like later versions of objdump do.