Quantcast
Viewing all articles
Browse latest Browse all 46

Answer by Jeremy for Is there a way to prevent an added .o file section of being removed from gnu linker garbage collection?

In principle the KEEP command in your command file should do this.

From the GNU ld manual:

3.6.4.4 Input Section and Garbage Collection

When link-time garbage collection is in use (‘--gc-sections’), it is often useful to marksections that should not be eliminated. This is accomplished bysurrounding an input section’s wildcard entry with KEEP(), as inKEEP((.init)) or KEEP(SORT_BY_NAME()(.ctors)).

This SO answer contains an example of KEEP use that might help.


Viewing all articles
Browse latest Browse all 46

Trending Articles



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