Code signing issues with macports-gcc48 compiled binaries

Nicolas Hatier nicolas.hatier at niversoft.com
Mon Jul 1 12:07:50 PDT 2013


On 2013-07-01 06:11, Rainer Müller wrote:
> On 2013-06-30 20:25, Nicolas Hatier wrote:
>> Compiled with gcc 4.8 (macports)
>>
>>      > /opt/local/bin/gcc-mp-4.8 a.cpp
>>      > security unlock-keychain ~/my.keychain
>>      password to unlock /Users/me/my.keychain: ********
>>      > codesign -f -s "identity" --keychain ~/my.keychain a.out
>>      codesign_allocate: object: /Users/me/a.out malformed object (unknown
>>      load command 9)
>>      a.out: object file format invalid or unsuitable
>>      (failure)
> Can you please provide the output of 'otool -l a.out' to see what the
> offending load command 9 actually is?
>
> Rainer
>

 >  otool -l a.out

Load command 9
       cmd LC_VERSION_MIN_MACOSX
   cmdsize 16
   version 10.6
       sdk n/a

The full output is attached.

Regards
NH

-------------- next part --------------
?Load command 0
      cmd LC_SEGMENT
  cmdsize 56
  segname __PAGEZERO
   vmaddr 0x00000000
   vmsize 0x00001000
  fileoff 0
 filesize 0
  maxprot 0x00000000
 initprot 0x00000000
   nsects 0
    flags 0x0
Load command 1
      cmd LC_SEGMENT
  cmdsize 328
  segname __TEXT
   vmaddr 0x00001000
   vmsize 0x00001000
  fileoff 0
 filesize 4096
  maxprot 0x00000007
 initprot 0x00000005
   nsects 4
    flags 0x0
Section
  sectname __text
   segname __TEXT
      addr 0x00001f50
      size 0x00000048
    offset 3920
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __symbol_stub
   segname __TEXT
      addr 0x00001f98
      size 0x00000006
    offset 3992
     align 2^1 (2)
    reloff 0
    nreloc 0
     flags 0x80000408
 reserved1 0 (index into indirect symbol table)
 reserved2 6 (size of stubs)
Section
  sectname __stub_helper
   segname __TEXT
      addr 0x00001fa0
      size 0x00000018
    offset 4000
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __eh_frame
   segname __TEXT
      addr 0x00001fb8
      size 0x00000044
    offset 4024
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Load command 2
      cmd LC_SEGMENT
  cmdsize 328
  segname __DATA
   vmaddr 0x00002000
   vmsize 0x00001000
  fileoff 4096
 filesize 4096
  maxprot 0x00000007
 initprot 0x00000003
   nsects 4
    flags 0x0
Section
  sectname __program_vars
   segname __DATA
      addr 0x00002000
      size 0x00000014
    offset 4096
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __nl_symbol_ptr
   segname __DATA
      addr 0x00002014
      size 0x00000008
    offset 4116
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000006
 reserved1 1 (index into indirect symbol table)
 reserved2 0
Section
  sectname __la_symbol_ptr
   segname __DATA
      addr 0x0000201c
      size 0x00000004
    offset 4124
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000007
 reserved1 3 (index into indirect symbol table)
 reserved2 0
Section
  sectname __data
   segname __DATA
      addr 0x00002020
      size 0x00000010
    offset 4128
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Load command 3
      cmd LC_SEGMENT
  cmdsize 56
  segname __LINKEDIT
   vmaddr 0x00003000
   vmsize 0x00001000
  fileoff 8192
 filesize 396
  maxprot 0x00000007
 initprot 0x00000001
   nsects 0
    flags 0x0
Load command 4
            cmd LC_DYLD_INFO_ONLY
        cmdsize 48
     rebase_off 0
    rebase_size 0
       bind_off 8192
      bind_size 24
  weak_bind_off 0
 weak_bind_size 0
  lazy_bind_off 8216
 lazy_bind_size 12
     export_off 8228
    export_size 116
Load command 5
     cmd LC_SYMTAB
 cmdsize 24
  symoff 8348
   nsyms 10
  stroff 8484
 strsize 104
Load command 6
            cmd LC_DYSYMTAB
        cmdsize 80
      ilocalsym 0
      nlocalsym 1
     iextdefsym 1
     nextdefsym 7
      iundefsym 8
      nundefsym 2
         tocoff 0
           ntoc 0
      modtaboff 0
        nmodtab 0
   extrefsymoff 0
    nextrefsyms 0
 indirectsymoff 8468
  nindirectsyms 4
      extreloff 0
        nextrel 0
      locreloff 0
        nlocrel 0
Load command 7
          cmd LC_LOAD_DYLINKER
      cmdsize 28
         name /usr/lib/dyld (offset 12)
Load command 8
     cmd LC_UUID
 cmdsize 24
    uuid 525388B5-3EE6-3297-991D-22A5E7D5AF3A
Load command 9
      cmd LC_VERSION_MIN_MACOSX
  cmdsize 16
  version 10.6
      sdk n/a
Load command 10
        cmd LC_UNIXTHREAD
    cmdsize 80
     flavor i386_THREAD_STATE
      count i386_THREAD_STATE_COUNT
            eax 0x00000000 ebx    0x00000000 ecx 0x00000000 edx 0x00000000
            edi 0x00000000 esi    0x00000000 ebp 0x00000000 esp 0x00000000
            ss  0x00000000 eflags 0x00000000 eip 0x00001f50 cs  0x00000000
            ds  0x00000000 es     0x00000000 fs  0x00000000 gs  0x00000000
Load command 11
          cmd LC_LOAD_DYLIB
      cmdsize 52
         name /usr/lib/libSystem.B.dylib (offset 24)
   time stamp 2 Wed Dec 31 19:00:02 1969
      current version 125.2.11
compatibility version 1.0.0
Load command 12
          cmd LC_LOAD_DYLIB
      cmdsize 64
         name /opt/local/lib/gcc48/libgcc_s.1.dylib (offset 24)
   time stamp 2 Wed Dec 31 19:00:02 1969
      current version 1.0.0
compatibility version 1.0.0
Load command 13
      cmd LC_FUNCTION_STARTS
  cmdsize 16
  dataoff 8344
 datasize 4


More information about the macports-users mailing list