Grant Edwards wrote:
but there is a problem in my code. If --gc-sections with
--fdata-sections removes all variables from .data or .bss
section,
Just to clarify: were all of the symbols in .data and .bss
sections unreference? IOW, is the --gc-sections and
--fdata-sections feature working properly?
Yes, feature working fine.
Too bad the elimination of the copy/clear code can't happen
automatically when size of .data or .bss is 0.
Do you have any idea how to do it? I'm not. I can't find anything like
section-wide ".required symbol_name" in ld documentation.
Sergey.