I am working on a C++ project which uses a (legacy) static library (let's name it foo.a
) which was compiled on an old Intel 32-bit architecture (with gcc-4). I don't have the source code of this library so I can't rebuild it.
Now I have to make a porting of the entire project to an x86-64 linux-based environment with gcc-6.5, and in a first phase I'm trying to compile all with -m32
flag in order to not change anything.
The compilation phase goes well, but during the linking phase I get this warning:
ld: (foo.a)(x.o) relocation of read-only section '.ro-data'
ld: warning: creating a DT_TEXTREL in object.
In any case the executable is created, but in this moment I'm not able to test it (Yes I know, it seems a a disaster announced!).
I read something about the lack of -fPIC
flag when foo.a
was built and on the fact that on old 32-bit architectures the -fPIC
option was unnecessary.
My questions are:
- What is
DT_TEXTREL
? I can't find any documentation on this term, only fragments on manuals. - How can I solve this problem without recompiling
foo.a
? - In case (question 2) is impossible to achieve, what problems should I expect on final executable by ignoring this warnings?
Thank you!