#pragma options [no]funcsect
Places instructions for each function in a separate object file control section or CSECT which may reduce the size of your program. Placing each function in its own CSECT enables the linker to perform garbage collection on a per function basis rather than per object file.
When -qfuncsect is specified the compiler generates references from each function to the static data area, if one exists, in order to ensure that if any function from that object file is included in the final executable, the static data area also is included. This is done to ensure that any static strings or strings from a pragma comment, possible containing copyright information, are also included in the executable. This can, in some cases, cause code bloat or unresolved symbols at link time.
When -qnofuncsect is in effect, each object file consists of a single control section combining all functions defined in the corresponding source file. You can use -qfuncsect to place each function in a separate control section.
.-nofuncsect-------------------------------. >>- -q--+-funcsect--+----------------------------+-+----------->< | .-implicitstaticref---. | '-=--+-noimplicitstaticref-+-'
-qnofuncsect
When your code contains a #pragma comment directive or a static string for copyright information purposes, the compiler automatically places these strings in the static data area, and generates references to these static data areas in the object code.
When implicitstaticref is in effect, a reference to the static area is generated even if not otherwise referenced.
When noimplicitstaticref is in effect, a reference to the static area is only generated if referenced by the program.
Specifying -qfuncsect with no suboption implies implicitstaticref.
Using multiple control sections increases the size of the object file, but can reduce the size of the final executable by allowing the linker to remove functions that are not called or that have been inlined by the optimizer at all places they are called.
The pragma directive must be specified before the first statement in the compilation unit.
None.