www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/25/11:14:31

Date: Mon, 25 Nov 1996 16:21:21 -0200
Message-Id: <1.5.4.16.19961125140532.365f721e@dmeasc.rc.ipt.br>
Mime-Version: 1.0
To: hs AT sbbs DOT se (Henrik), djgpp AT delorie DOT com
From: Cesar Scarpini Rabak <csrabak AT dce03 DOT ipt DOT br>
Subject: Re: ld linker problems

At 22:42 24/11/96 GMT, Henrik wrote:
>Hi everybody! 
>
>ld isn't playing the way I want it to... Assume I compile these two files:
>
>---------- file1.cc
>char silly_buffer[10000];
>----------
>
>---------- file2.cc
>int main(void)
>{
>}
>----------
>
>and link them together with 'gcc file1.cc file2.cc', it turns out that the 

Try to swap the order of the two files in the command line and check the
results!


>10000 bytes buffer is included in the final output file! Since the program
>(the start of which is defined to be main(), of course) doesn't reference it, 
>I don't want it there!
>
>Obviously, ld is doing some kind of incremental linking here, and the only way 
>of solving it is by making file1.o a library and including it with -l.
>
>Is there any better, or at least, any other way of doing this???
>
>
>Any help will be much appreciated.
>
>Please mail a copy of your answer to hs AT sbbs DOT se
>Thanks in advance!!!!
>
>//HSe
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cesar Scarpini Rabak                      E-mail: csrabak AT ipt DOT br
DME/ASC                                   Phone: 55-11-268-35221Ext.350
IPT - Instituto de Pesquisas Tecnologicas Fax:   55-11-268-5996
Av. Prof. Almeida Prado, 532.  Sao Paulo - SP 05508-901 BRAZIL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019