[nasm:macho-unify] output: macho -- Use macho_relocation_info_t
nasm-bot for Cyrill Gorcunov
gorcunov at gmail.com
Tue Jun 30 17:03:03 PDT 2020
Commit-ID: b09d64eff32d03db8fbe1ffedc6f6c306e25d0ea
Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=b09d64eff32d03db8fbe1ffedc6f6c306e25d0ea
Author: Cyrill Gorcunov <gorcunov at gmail.com>
AuthorDate: Sat, 5 May 2018 15:09:18 +0300
Committer: Cyrill Gorcunov <gorcunov at gmail.com>
CommitDate: Wed, 9 May 2018 18:03:50 +0300
output: macho -- Use macho_relocation_info_t
Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
output/outmacho.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/output/outmacho.c b/output/outmacho.c
index 233efd29..214c004a 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);
More information about the Nasm-commits
mailing list