Illegal Instruction

Bottled Gin gin at bottle.com
Tue Dec 12 13:55:45 UTC 2017


A simple testcase:

// test.d
void foo() {}


// main.d
import test;
void main() {
   foo();
}


$ ldmd2 -fPIC -g -shared test.d
$ ldmd2 main.d -g -L-ltest -L-L/tmp -L-R/tmp
$ ./main
Illegal instruction (core dumped)

$ gdb ./main
(gdb) bt
#0  0x00007ffff7b73158 in _d_dso_registry () from /tmp/libtest.so
#1  0x0000000000400822 in ldc.register_dso ()
#2  0x0000000000400842 in ldc.dso_ctor.4main ()
#3  0x00000000004008ed in __libc_csu_init ()
#4  0x00007ffff776a7bf in __libc_start_main (main=0x400870 
<main>, argc=1,
     argv=0x7fffffffdf58, init=0x4008a0 <__libc_csu_init>, 
fini=<optimized out>,
     rtld_fini=<optimized out>, stack_end=0x7fffffffdf48) at 
../csu/libc-start.c:247
#5  0x00000000004006c9 in _start ()
(gdb) quit
A debugging session is active.

         Inferior 1 [process 8038] will be killed.



More information about the digitalmars-d-ldc mailing list