Mail Archives: djgpp/1996/11/25/11:14:31
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 -