macho/reloc: Adjust SUB relocation information

As SUB relocation getting deprecated, reset external reference seems to
be enough. Also, print a warning message for this.

Based-on-code-from: zenith432 <zenith432@users.sourceforge.net>
Signed-off-by: Chang S. Bae <changseok.bae@gmail.com>
This commit is contained in:
Chang S. Bae 2018-10-08 18:49:52 -07:00 committed by Cyrill Gorcunov
parent e859ece378
commit 625ea1ca47

View file

@ -551,8 +551,10 @@ static int64_t add_reloc(struct section *sect, int32_t section,
}
break;
case RL_SUB:
r->pcrel = 0;
case RL_SUB: /* obsolete */
nasm_error(ERR_WARNING, "relcation with subtraction"
"becomes to be obsolete");
r->ext = 0;
r->type = X86_64_RELOC_SUBTRACTOR;
break;