[Issue 14814] ld: GOT load reloc does not point to a movq instruction

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jul 21 06:37:48 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14814

--- Comment #4 from Kenji Hara <k.hara.pg at gmail.com> ---
(In reply to Timothee Cour from comment #3)
> ok here's a more fine grained version showing
> https://github.com/D-Programming-Language/dmd/pull/4654 is the culprit:

I don't have Mac OS X environment, so I cannot directly test the reduced case.
But I found a difference in the glue-layer output introduced by the PR.

(In reply to Timothee Cour from comment #0)
> fun3:
> void fun0()
> {
> }
> 
> alias Fun = void function(); //same with delegate()
> 
> void fun4()
> {
>     Fun[TypeInfo] funs;
>     funs[typeid(int)] = &fun0; //same with s/&fun0/(){}/
> }

If you replace the `typeid(int)` with `null`, will the failure disappear?

If so, may following patch fix fix the issue?

---
 src/e2ir.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/e2ir.c b/src/e2ir.c
index 863bd14..88d2a63 100644
--- a/src/e2ir.c
+++ b/src/e2ir.c
@@ -1175,6 +1175,7 @@ elem *toElem(Expression *e, IRState *irs)
             if (Type *t = isType(e->obj))
             {
                 result = getTypeInfo(t, irs);
+                result = el_bin(OPadd, result->Ety, result, el_long(TYsize_t,
t->vtinfo->offset));
                 return;
             }
             if (Expression *ex = isExpression(e->obj))
--

--


More information about the Digitalmars-d-bugs mailing list