https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71111
Bug ID: 71111 Summary: gcc5 (v5.3.1) - _moddi3: .... error adding symbols: Bad value Product: gcc Version: 5.3.1 Status: UNCONFIRMED Severity: major Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: matthew at giassa dot net CC: matthew at giassa dot net Target Milestone: --- Host: 4.4.0-21-generic Ubuntu SMP i686 GNU/Linux Target: (Same as host, x86) I have a simple project that does some number crunching in C++. The project is built as a simple standalone shared library, libmx2.so. There is a second library, libmx2gui.so, which is a Gtk "wrapper" for the libmx2.so library, providing a means for Gtk apps to have dialogs which act as the equivalent of the command-line functionality provided by the libmx2.so library. The GUI library links dynamically against the other library at build time. Building on Ubuntu 14.04 LTS with GCCv4.8 worked fine, but after upgrading to Ubuntu 16.04 LTS and GCCv5 (5.3.1), I get a bizarre error when linking the GUI library: __moddi3: invalid version 26897 (max 0) ./lib/libmx2.so: error adding symbols: Bad value This issue only occurs on 32-bit machines, not on 64-bit machines. Enabling verbose output via gcc -v provides no additional information. The linker flags used by both libraries is: # libmx LDFLAGS = -Wl,--version-script=exports.map -fvisibility=hidden -fvisibility-inlines-hidden -Wl,-z,defs,-soname,${LIB_OUT_NAME} # libmx2gui LDFLAGS = -Wl,-z,defs,-soname,${LIB_OUT_NAME} Both libraries are linked against their object files via: @${CXX} ${LDFLAGS} -shared -o ${OUTPUT_LIBRARY_NAME} ${OBJ} ${LIBS} Where OBJ is a list of the object files, and LIBS is a list of libraries to link against. Is there any reason to suspect this is a bug in GCCv5, or is it a poor choice of link/compiler settings for my libraries? I've created some additional bare-bones libraries that simply use the API from libmx2.so, and they too have the same error. My initial guess (an obvious one) is there's either something wrong with how I'm building libmx2.so, or there's something wrong with my linking options when having other shared objects link against it. Still baffled why this only occurs on 32-bit GCC5.