Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22296

Force linker to include a section in the binary

$
0
0

I'm instrumenting my program with a custom compiler instrumentation pass. The compiler adds a global variable in each module. All the global go to a particular section (_prof_global). For each module i can see global with objdump -h. But in the final binary the section is removed. Most likely linker is removing it because the globals are unused. Is there a way to force linker to keep that section anyways?


Viewing all articles
Browse latest Browse all 22296

Latest Images

Trending Articles



Latest Images

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