[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [open-cobol-list] calling std c library calls from cobol and cob_i
Re: [open-cobol-list] calling std c library calls from cobol and cob_inspect_tallying() segmentation violation
Wed Jun 5 19:09:03 2002
Wanderlust/2.6.0 (Twist And Shout) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (Unebigoryōmae) APEL/10.3 Emacs/21.2 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)
At Wed, 05 Jun 2002 09:51:37 -0600,
Richard A. Painter <address@hidden> wrote:
> why does cobc need to have a -main like option? for example, cc or
> gcc when using the -c doesn't care whether you have a main or not and
> you don't have to tell them.
Because without it, I was not able to decide what function name
should be produced by cobc. A module (i.e., shared object) need to
have a function name derived from PROGRAM-ID, while an executable
must have a main(), not PROGRAM-ID.
> how about using
> -static forces .o
> -dynamic (default if you like) forces .so
No, -static and -dynamic flags tell how a program should *call*
other programs, while -m tells how a program *is called* from
Technically, -static and -dynamic define the way to implement
CALL statements. If you give the -static flag to cobc, CALL
will be implemented directly without using cob_call_resolve.
This is not equivalent to building a .o object. It is also
possible to build a .so object that uses static CALL.