Hello, Sorry in advance if you find my question naive. I have a C++ program that uses libbfd. I have compiled this program on RedHat 6.1 with egcs-2.91.66. This program works ok on RedHat 6.1 but fails to execute on Redhat 7.0: the loader complains that it cannot find /usr/lib/libbfd-2.9.1.0.24.so (RedHat 7.0 comes with libbfd-2.10.0.18.so) Note: libbfd is the only library that the loader complains about among the numerous other system libraries my program uses. Recompiling the program on RedHat 7.0 of course fixes the problem but this forces me to release two versions of my program instead of one. Is libbfd-2.10.0.18 incompatible with libbfd-2.9.1.0.24? Do I have other solutions than releasing 2 different versions? Did I miss something? Thanks for your help.
libbfd is never meant to be compatible, it is a shared library only so that all of gas/ld/nm/strip/... can share it. The API is changing all the time. If you want to ship a program using libbfd, basically the only option unless you want to run it yourself only is to link libbfd.a in instead of linking with -lbfd, that way the program will run everywhere. Otherwise, even in the same distribution if somebody updates binutils the program will suddenly not work (or rpm dependencies will fail).
I linked my program with libbfd.a and this fixes my problem. Thanks a lot for your help.