GCC Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
cobol

COBOL: Support non-unique section names for procedure references

COBOL compiler now correctly handles repeated section names when referencing paragraphs.

The COBOL compiler has been updated to support non-unique section names. This allows paragraphs within sections to be referenced and performed, as long as the specific section and paragraph name pair is unique within the program. The changes improve the symbol table’s handling of section and paragraph mappings and add validation for all referenced procedures.

In Details

This commit refactors the symbol table management in cobol/symbols.cc and cobol/parse.y to correctly handle cbl_section_t and cbl_paragraph_t where section names can be duplicated. Previously, the symbol_table's section->paragraph map assumed unique section names. The changes enable PERFORM statements to correctly indirect via section-name::paragraph-name even if section-name appears multiple times, provided the full section-name::paragraph-name combination is unique. It also adds checks to ensure all PROCEDURE directives are defined.

For Context
section
A named block of code within a COBOL program that can contain paragraphs.
paragraph
A named sequence of statements within a COBOL section or program.
PERFORM
A COBOL control flow statement used to execute a paragraph or section.
symbol table
A data structure used by the compiler to store information about identifiers (like variables, functions, sections, paragraphs) in the source code.
Filed Under: cobolcompilersymbol tableparser