This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Help needed with linking



Have you tried initializing x?

Since it is uninitialized, x is probably being allocated to .bss or
COMMON.  Putting an initializer on x should cause it to be allocated
in .data.  You might try that if you haven't already.

Art

Joel Coltoff wrote:
> ...
> When I compile this program
> 
>     int x;
>     int *y = &x;
> 
>     int
>     main()
>     {
>         return(1);
>     }
> ...
> As best as I can tell it has to do with the statement, int *y = &x;
> i.e. The linker bombs anytime I try to resolve a reference to another
> variable at link time rather than at run time.
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]