Home > database >  <lib> not valid for use in process: mapped file has no cdhash, completely unsigned? Code has t
<lib> not valid for use in process: mapped file has no cdhash, completely unsigned? Code has t

Time:09-28

Trying to run an executable linking to a dynamic library, I get the following error:

Library not loaded:
[...]
Reason: tried:
    <lib> not valid for use in process: mapped file has no 
    cdhash, completely unsigned? Code has to be at least ad-hoc signed.

How can I ad-hoc sign my lib?

CodePudding user response:

First, you can confirm that your is not signed with:

% codesign -d -v <lib>

Which should say:

<lib>: code object is not signed at all

Ad-hoc sign it with:

% codesign -s - <lib>
  • Related