2

While compiling one of our dependent tool, a long list relocation error is showing up while linking:

SomeLibrary.a(SomeObject.o)(.text._bla_bla_bla): error: relocation overflow
collect2: error: ld returned 1 exit status
cook: command g++: exit status 1

The dependent tool is being compiled on gcc-8.x and our tool is compiled on gcc-4.x.

This problem is specifically showing up on IBM PowerPC platform, where RHEL is compiling fine.

We are being suggested to use -mcmodel=medium while compiling our code.

Could not find much help online. Any specific purpose of using this option?

Foobar-naut
  • 111
  • 3
  • 11
  • https://stackoverflow.com/questions/12916176/gfortran-for-dummies-what-does-mcmodel-medium-do-exactly – PiRocks Feb 27 '20 at 18:57
  • Does this answer your question? [gfortran for dummies: What does mcmodel=medium do exactly?](https://stackoverflow.com/questions/12916176/gfortran-for-dummies-what-does-mcmodel-medium-do-exactly) – PiRocks Feb 27 '20 at 18:58
  • Looking for PowerPC specific solution. Maybe some more sophistication? Not sure. – Foobar-naut Feb 27 '20 at 19:02
  • I'm not super familiar with PowerPC, but I assume the answer would be the same. By using -mcmodel=medium you get larger sections at the cost of some instruction density? – PiRocks Feb 27 '20 at 19:07
  • Not sure what you mean by "more sophistication" – PiRocks Feb 27 '20 at 19:08
  • The Power and gcc toolchain developers try to make all options look the same. Does mcmodel=medium work for you? – danblack Mar 10 '20 at 22:22

0 Answers0