Linux linker errors with binutils >= 2.27

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 5 12:06:42 PDT 2017


Since binutils 2.27 I can not compile dmd with the `gold`
linker any more. On my Gentoo Linux amd64 host, when linking
the 32-bit version of druntime the following error is
repeatedly output for all kinds of symbols:

  libdruntime.so.a(libdruntime.so.o):
  relocation R_386_GOTOFF against preemptible symbol <some
  mangled name> cannot be used when making a shared object

Now starting with binutils 2.28 - in addition to the above -
dynamically linked Dlang executables error out in druntime
with an error message of this type:

  Fatal Error while loading '/usr/lib64/libphobos2.so.0.74':
  The module '<some module>' is already defined in '<executable>'.

Does anyone have solutions to one or both of these issues at
hand? For Gentoo packages I made shared linking the default
and unless my configuration is a unique snowflake this is
right now affecting all DMD users there.
From reading `checkModuleCollisions()`
[https://github.com/dlang/druntime/blob/master/src/rt/sections_elf_shared.d#L891]
it would seem that changes in copy-relocations have something
to do with the second issue it.

-- 
Marco



More information about the Digitalmars-d mailing list