symbol preemption

symbol preemption

The "-mno-symbol-preemption" option is the mechanism that tells the compiler that the ADDRESSES will be known at link time and they will not be changed (preempted) while the binary is
running. This option is no longer used and has been replaced by "-fvisibility=hidden -fminshared".

On doing nm on the object thus generated, I notice that some symbols which were earlier in rodata section(using -mno-symbol-preemption) have been now moved to initialized data section for small objects. Are there any other options to the compiler that can ensure that layout seen when compiling with "-mno-symbol-preemption" is completely replicated. The problem symbols were an array of pointers to implicitly defined strings.

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.