Input Section Keep (LD)
Next: Input Section Example, Previous: Input Section for Common Symbols, Up: Input Section Description [Contents][Index]
3.6.4.4 Input Section and Garbage Collection ¶
When link-time garbage collection is in use (‘--gc-sections’),
it is often useful to mark sections that should not be eliminated.
This is accomplished by surrounding an input section’s wildcard entry
with KEEP(), as in KEEP(*(.init)) or
KEEP(SORT_BY_NAME(*)(.ctors)).