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

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

$
0
0

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 47

Latest Images

Trending Articles



Latest Images

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