[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Always the problem between gplc/gcc

From: Timo Karjalainen
Subject: Re: Always the problem between gplc/gcc
Date: Wed, 21 Aug 2002 22:22:54 +0300 (EEST)

On Wed, 21 Aug 2002, bruno patin wrote:

> Dear Roberto,
> thank you very much. With your indication I solve my problem. It's the
> order of the library and objects that counts. You have to place first
> the obj_begin object then your objects and then the rest of the
> objects/library.
> What surprise me is that the problem I had does not give life to an
> unresolved symbol because if a memory adress is defined only in
> obj_begin my code would not be able to build except if we rely upon the
> same segment but in this case why do an error occured ? I am at a loss.

The linking order can be significant because the first object is typically
the one where startup code is taken from. I.e. program execution really
starts there, and _main (the main() function from C) is then called from
the startup code.

It could be that the initialization code is written as code to go into
startup. There's no call to it anywhere. Linking it later in the program
than startup means that it won't be run. You can link without problems
because all data symbols are present, only nobody will call the code and
so you end up with uninitialized variables runtime.

Timo Karjalainen             "I don't have a life.
                              I have a program."
                                   - Star Trek: Voyager

reply via email to

[Prev in Thread] Current Thread [Next in Thread]