Quantcast
Channel: User Jeremy - Stack Overflow
Viewing all articles
Browse latest Browse all 46

Answer by Jeremy for Selectively suppressing glibc link warnings?

$
0
0

First of all, it's important to remember that the warnings are (usually) there for a reason. If you can find a way to avoid linking the symbols that the warning refers to, that's a far preferable course of action.

Now... As the question notes, the linker emits the warnings because they're in library sections named '.gnu.warning.*'. And as explained at length in this answer, there's no way to suppress this with a command line switch.

But renaming the relevant sections will suppress the warnings.

(You could try removing the sections, but the __evoke_* symbols are referenced in the relocation tables. Renaming is simpler, and can be reversed in future - although of course you should back up the original of any library you do this to.)

objcopy --rename-section .gnu.warning.<symbol>=.xgnu.warning.<symbol> libX.a libX-nowarnings.a

You can link the modified library, or replace the original in situ. Of course, whether this is possible or advisable depends on your specific circumstances.


Viewing all articles
Browse latest Browse all 46

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>