From b09d64eff32d03db8fbe1ffedc6f6c306e25d0ea Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sat, 5 May 2018 15:09:18 +0300 Subject: [PATCH] output: macho -- Use macho_relocation_info_t Signed-off-by: Cyrill Gorcunov --- output/outmacho.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/output/outmacho.c b/output/outmacho.c index 233efd29b..214c004a2 100644 --- a/output/outmacho.c +++ b/output/outmacho.c @@ -1355,23 +1355,20 @@ static uint32_t macho_write_segment (uint64_t offset) return offset; } -/* For a given chain of relocs r, write out the entire relocation - chain to the object file. */ - -static void macho_write_relocs (struct reloc *r) +static void macho_write_relocs(struct reloc *r) { while (r) { macho_relocation_info_t info; - info.r_address = cpu_to_le32(r->addr); + info.r_address = cpu_to_le32(r->addr); - info.u.r_symbolnum = r->snum; - info.u.r_pcrel = r->pcrel; - info.u.r_length = r->length; - info.u.r_extern = r->ext; - info.u.r_type = r->type; + info.u.s.r_symbolnum= r->snum; + info.u.s.r_pcrel = r->pcrel; + info.u.s.r_length = r->length; + info.u.s.r_extern = r->ext; + info.u.s.r_type = r->type; - info.u.r_raw = cpu_to_le32(info.u.r_raw); + info.u.r_raw = cpu_to_le32(info.u.r_raw); nasm_write(&info, sizeof(info), ofile);