macho/reloc: Fixed offset adjustment in add_reloc()
commitf63d211bcf9a2015276682ce4a9be5960b0aaad4
authorChang S. Bae <changseok.bae@gmail.com>
Tue, 9 Oct 2018 01:49:54 +0000 (8 18:49 -0700)
committerCyrill Gorcunov <gorcunov@gmail.com>
Tue, 9 Oct 2018 07:23:01 +0000 (9 10:23 +0300)
treec72f444df027d5809d5c5a9a84c195363414f8e4
parent960efc3ff2c8a4ecf8b968c6e485b4addd33c92f
macho/reloc: Fixed offset adjustment in add_reloc()

If the target symbol is in the same file, add_reloc() emits an
internal reloc for the target section, and the offset written
is the offset in the target section.  If the target symbol is
external, its offset is zero (or an explicit addend), and
add_reloc() emits an external reloc for the symbol.

Based-on-code-from: zenith432 <zenith432@users.sourceforge.net>
Signed-off-by: Chang S. Bae <changseok.bae@gmail.com>
output/outmacho.c