Mach-O から自力で関数を見つけて呼び出す その1.1

Mach-O から自力で関数を見つけて呼び出す - EAGLE 雑記 で載せたものが致命的に間違っていたので修正.
gist のほうを修正しておいた.http://gist.github.com/103758


具体的には nlist の n_value を忘れていた.というか見落としていた.

n_value

An integer that contains the value of the symbol. The format of this value is different for each type of symbol table entry (as specified by the n_type field). For the N_SECT symbol type, n_value is the address of the symbol. See the description of the n_type field for information on other possible values.

http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html

というわけで,そのへんを修正.他にもちょっとした書き直しも含まれてるけど.