diff options
author | Chang S. Bae <chang.seok.bae@intel.com> | 2018-08-23 14:13:45 -0700 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2018-08-24 11:21:58 +0300 |
commit | b10435f06e65df9e8fd2e1d8e8e62524e79ebec2 (patch) | |
tree | ffc3da464b55d0ca31b5682833fff708b191c9e1 | |
parent | 1fd4c45c96994896995c9654aa24d114777d6df5 (diff) | |
download | nasm-b10435f06e65df9e8fd2e1d8e8e62524e79ebec2.tar.gz |
macho: Fix relocation type for relative direct branch
Previously, X86_64_RELOC_BRANCH is only set for external
relocations. Internal relocation also needs this type to be
set, instead of the default (X86_64_RELOC_SIGNED) or
anything.
Reported-by: <zenith432@users.sourceforge.net>
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
-rw-r--r-- | output/outmacho.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/output/outmacho.c b/output/outmacho.c index d092cf23..cb566f0d 100644 --- a/output/outmacho.c +++ b/output/outmacho.c @@ -559,6 +559,8 @@ static int64_t add_reloc(struct section *sect, int32_t section, /* local */ r->ext = 0; r->snum = fi; + if (reltype == RL_BRANCH) + r->type = X86_64_RELOC_BRANCH; adjust = -sect->size; } break; |