Skip to content

cobcd generates files that cannot be processed by gnu assembler

Seen with cobc -O vtest007.cob resulting in things like:

gcc -std=c89 -Wdeclaration-after-statement -fstack-protector-strong -fstack-clash-protection -pipe -Wno-unused -fsigned-char -Wno-pointer-sign -O -fcf-protection=none -ggdb -o vtest007.s vtest007.c -S
cobcd-sfix -q vtest007.s vtest007.s vtest007.c vtest007.cbl
gcc -c -std=c89 -Wdeclaration-after-statement -fstack-protector-strong -fstack-clash-protection -pipe -Wno-unused -fsigned-char -Wno-pointer-sign -O -fcf-protection=none -ggdb -o vtest007.o vtest007.s
vtest007.s: Assembler messages:
vtest007.s:10647: Error: leb128 operand is an undefined symbol: LVU17
vtest007.s:10648: Error: leb128 operand is an undefined symbol: LVU96

(and a lot of others more)

The reason is that gas needs some line references that are dropped by cobcd-sfix. The likely best option is to let cobcd, when it executes gcc -c add -O0 at the end of the command line (this way the assembler itself can still be optimized).