mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-27 08:10:07 +08:00
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>
This commit is contained in:
parent
1fd4c45c96
commit
b10435f06e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user