This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Gcc driver and -T option


Thanks for replying.  Here is some relevant  part from the linker script that is linked explicitly.
Basically I'm creating the overlay of data and rodata from 1.o and 2.o 
If I don't include 1.o 2.o , how should I achieve this overlay ?
Any idea ?

 OVERLAY :
  {
    .program0_pd_data
    { 
        __program0_data_start = .;
       1.o (.data)
       1.o (.rodata)
       . = ALIGN(32 / 8);
        __program0_bss_start = .;
       1.o (.bss)
       . = ALIGN(32 / 8);
        __program0_bss_end = .;
    }
    .program1_pd_data
    { 
        __program1_data_start = .;
       2.o (.data)
       2.o (.rodata)
       . = ALIGN(32 / 8);
        __program1_bss_start = .;
       2.o (.bss)
       . = ALIGN(32 / 8);
        __program1_bss_end = .;
    }
  }
There could be other situations where one needs to specify the object files in the linker script. If that is the case , then shouldn't driver detect 
explict usage of linker script and hence generate .o s in the current directory ?

Thanks in advace,
U7400
Daniel Jacobowitz <drow@mvista.com> wrote:

>On Wed, Aug 28, 2002 at 02:22:59AM -0400, 7400 wrote:
>> I would like to know the opinion about following situation related with gcc driver.
>> 
>>  - I have a directory under which there are 2 c files say  - 1.c and 2.c
>>  - I compile these file using gcc -o test.exe *.c -Tscript.ld
>>  - This script.ld uses 1.o and 2.o
>> 
>>  Since 1.o and 2.o are NOT created in the cwd the link fails
>>  I'm aware that driver chooses $TMPDIR to create temporary file and deletes them when linking
>>  is done
>>  Temporary files are never created in the current directory Also when temporary files are
>>  created their names are
>>  different than that of the .c files .    No doubt the linking will fail in the case the
>>  above as specified object files are not found in current directory  Since gcc
>>  drive is not aware of what obj files are  specified in the linker script ( and why it should
>>  be ? ) it will try to pass the object files in  $(TMPDIR)/temporary files with 
>>  generated names to linker (-v option shows the temporary files used )
>
>You should not have to mention 1.o and 2.o by name in your linker
>script.  Just place the sections you want.
>
>-- 
>Daniel Jacobowitz
>MontaVista Software                         Debian GNU/Linux Developer
>


__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/


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