[Issue 18798] ld.gold: relocation R_386_GOTOFF against preemptible symbol cannot be used when making a shared object

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 28 13:38:57 UTC 2018


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

--- Comment #1 from Marco Leise <Marco.Leise at gmx.de> ---
Created attachment 1689
  --> https://issues.dlang.org/attachment.cgi?id=1689&action=edit
small reproduction case for the linker error

I attached a test case that can be compiled with dmd 2.079.1 like this:

    dmd -m32 -shared -fPIC -defaultlib=phobos2 reprocase.d

ld.gold has to be your default linker, otherwise you need to split compilation
and linking:

    dmd -m32 -fPIC -c reprocase.d
    ld.gold -shared reprocase.o

What I found interesting about the test case is that it happens when you create
a sufficiently complex switch-case. Remove one case and the error is gone.
Could it be a bug in jump table generation on x86/PIC ?

--


More information about the Digitalmars-d-bugs mailing list