'unable to load command 0x2?' warnings under MacOS X
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tarantool |
Won't Fix
|
Undecided
|
Pavel Cherenkov |
Bug Description
Non-static binaries, compiled with gcc-mp-4.6 (from mac ports) and linked with libbfd (also from ports), at initialization point, print out warnings like: 'unable to load command 0x24' or 'unable to load command 0x26', etc.
In most cases (observed with tarantool binaries under Mac OS X Lion), the command code is >= 0x20.
The message comes from bfd/mach-o.c (as in http://
switch (command->type)
{
case BFD_MACH_
if (bfd_mach_
return -1;
break;
.....
default:
fprintf (stderr, "unable to read unknown load command 0x%lx\n",
(unsigned long) command->type);
break;
}
The warning says that BFD cannot recognize the Mach-O section load command it has encountered.
Looking at bfd/mach-o.h (http://
Mac OS X (Lion) defines load constants in /usr/include/
This seems to place it as a BFD-specific issue that should eventually (when the codes are brought in sync) disappear.
The latest (non-ported) release of GNU binutils is 2.22 and it *does* include the required code:
binutils- 2.22/bfd/ mach-o. c: O_LC_DYLD_ INFO: o_read_ dyld_info (abfd, command) != 0) O_LC_VERSION_ MIN_MACOSX: O_LC_VERSION_ MIN_IPHONEOS: o_read_ version_ min (abfd, command))
.............
case BFD_MACH_
if (bfd_mach_
return -1;
break;
case BFD_MACH_
case BFD_MACH_
if (!bfd_mach_
return -1;
break;
binutils- 2.22/include/ mach-o/ loader. h:
BFD_MACH_ O_LC_VERSION_ MIN_IPHONEOS = 0x25, /* Minimal IOS version. */ O_LC_FUNCTION_ STARTS = 0x26, /* Compressed table of func start. */ O_LC_DYLD_ ENVIRONMENT = 0x27 /* Env variable string for dyld. */
BFD_MACH_
BFD_MACH_
However, the latest version is not *yet* in the mac ports:
Mac-mini-tarantool ~/tmp$ port list binutils
binutils @2.21 devel/binutils
Mac-mini-tarantool ~/tmp$ port list installed | grep binutils
binutils @2.21 devel/binutils
Mac-mini-tarantool ~/tmp$ port list outdated | grep binutils
Mac-mini-tarantool ~/tmp$