summaryrefslogtreecommitdiff
path: root/output
diff options
context:
space:
mode:
authorChang S. Bae <changseok.bae@gmail.com>2018-10-08 18:49:50 -0700
committerCyrill Gorcunov <gorcunov@gmail.com>2018-10-09 10:22:45 +0300
commit4cbbb3940d8f1b63b8d5e7c48731830dfcb6c49a (patch)
tree49c28a7cd49fde353f5c83be4e5d9e8d031e203b /output
parentbffd2b7deffd9060159cd816db561ed2f89baf06 (diff)
downloadnasm-4cbbb3940d8f1b63b8d5e7c48731830dfcb6c49a.tar.gz
macho/reloc: Simplified relocation for REL/BRANCH
It seems like the relocation for the relative reference to absolute addresses only cares external reference info. Instead of exiting, reset the external reference flag. Based-on-code-from: zenith432 <zenith432@users.sourceforge.net> Signed-off-by: Chang S. Bae <changseok.bae@gmail.com>
Diffstat (limited to 'output')
-rw-r--r--output/outmacho.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/output/outmacho.c b/output/outmacho.c
index 9fa12988..711fe31a 100644
--- a/output/outmacho.c
+++ b/output/outmacho.c
@@ -531,22 +531,8 @@ static int64_t add_reloc(struct section *sect, int32_t section,
r->type = fmt.reloc_rel;
r->pcrel = 1;
if (section == NO_SEG) {
- /* absolute - seems to produce garbage no matter what */
- nasm_error(ERR_NONFATAL, "Mach-O does not support relative "
- "references to absolute addresses");
- goto bail;
-#if 0
- /* This "seems" to be how it ought to work... */
-
- struct symbol *sym = macho_find_sym(&absolute_sect, offset,
- false, false);
- if (!sym)
- goto bail;
-
- sect->extreloc = 1;
- r->snum = NO_SECT;
- adjust = -sect->size;
-#endif
+ /* may optionally be converted below by fmt.forcesym */
+ r->ext = 0;
} else if (fi == NO_SECT) {
/* external */
sect->extreloc = 1;