From: H. P. A. <hp...@zy...> - 2016-05-10 15:37:51
|
On May 10, 2016 5:23:09 AM PDT, Cyrill Gorcunov <gor...@gm...> wrote: >Peter? > >On Tue, May 10, 2016 at 03:08:31PM +0300, Zenith432 wrote: >> -------- Forwarded Message -------- >> Subject: Re: NASM Bug 3392348 >> Date: Tue, 10 May 2016 03:29:58 -0700 >> From: H. Peter Anvin <hp...@zy...> >> To: Zenith432 <zen...@us...> >> >> On May 10, 2016 2:25:17 AM PDT, Zenith432 ><zen...@us...> >> wrote: >> > I'm sending this by email, because the nasm bugzilla does not >provide >> > option for reopening a bug, and I'd rather not open a new one. >> > >> > The commit has a modification that doesn't work. >> > >> > ===== >> > --- output/outmacho.c >> > +++ output/outmacho.c >> > @@ -465,7 +465,7 @@ static int64_t add_reloc(struct section *sect, >> > int32_t section, >> > r->snum = raa_read(extsyms, section); >> > if (reltype == RL_BRANCH) >> > r->type = X86_64_RELOC_BRANCH; >> > - else if (r->type == GENERIC_RELOC_VANILLA) >> > + else if (reltype == GENERIC_RELOC_VANILLA) >> > adjust = -sect->size; >> > } else { >> > /* local */ >> > ===== >> > >> > At that point in the code, reltype has one of the values >> > RL_REL (1) for i386 or x86_64 >> > RL_BRANCH (3) for x86_64 >> > >> > But r->type has one of the values >> > GENERIC_RELOC_VANILLA (0) for i386 >> > X86_64_RELOC_SIGNED (1) for x86_64 >> > X86_64_RELOC_BRANCH (2) for x86_64 >> > >> > so comparing reltype to 0 nullifies the fix. >> > The fix in negative adjustment should be for external, r->pcrel, >> > r->type == GENERIC_RELOC_VANILLA (i386 only). >> > >> > There is also a negative adjustment for local, but that was ok >before. >> > >> > Thanks and Regards. Yes, my mistake. -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting. |