[Nasm-bugs] [Bug 3392348] nasm 2.12.01 generates bad pc-relative relocations for macho32 target

no-reply at bugzilla-nasm.gorcunov.org no-reply at bugzilla-nasm.gorcunov.org
Mon May 9 10:30:07 PDT 2016


http://bugzilla.nasm.us/show_bug.cgi?id=3392348

zenith432 at users.sourceforge.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zenith432 at users.sourceforge
                   |                            |.net
           Assignee|nobody at nasm.us              |hpa at zytor.com

--- Comment #1 from zenith432 at users.sourceforge.net ---
Following patch fixes it

--- output/outmacho.c
+++ output/outmacho.c
@@ -465,6 +465,8 @@
            r->snum = raa_read(extsyms, section);
            if (reltype == RL_BRANCH)
                r->type = X86_64_RELOC_BRANCH;
+           else if (r->type == GENERIC_RELOC_VANILLA)
+               adjust = -sect->size;
        } else {
            /* local */
            r->ext = 0;
@@ -1321,6 +1323,8 @@
                l += sectstab[r->snum]->addr;
                if (r->pcrel)
                    l -= s->addr;
+           } else if (r->pcrel && r->type == GENERIC_RELOC_VANILLA) {
+               l -= s->addr;
            }

            /* write new offset back */

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.


More information about the Nasm-bugs mailing list