From: nasm-bot f. C. S. B. <cha...@in...> - 2018-08-24 08:24:22
|
Commit-ID: b10435f06e65df9e8fd2e1d8e8e62524e79ebec2 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=b10435f06e65df9e8fd2e1d8e8e62524e79ebec2 Author: Chang S. Bae <cha...@in...> AuthorDate: Thu, 23 Aug 2018 14:13:45 -0700 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 24 Aug 2018 11:21:58 +0300 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: <zen...@us...> Signed-off-by: Chang S. Bae <cha...@in...> --- output/outmacho.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/output/outmacho.c b/output/outmacho.c index d092cf2..cb566f0 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; |