Basic block sections enables function sections implicitly, this is not needed and is inefficient with "=list" option.
We had basic block sections enable function sections implicitly in clang. This is particularly inefficient with "=list" option as it places functions that do not have any basic block sections in separate sections. This causes unnecessary object file overhead for large applications.
This patch disables this implicit behavior. It only creates function sections for those functions that require basic block sections.
Further, there was an inconistent behavior with llc as llc was not turning on function sections by default. This patch makes llc and clang consistent and tests are added to check the new behavior.
Can we add const here?