cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dbrinks
Visitor
Visitor
5,513 Views
Registered: ‎10-13-2009

Modifying crtinit.s for Microblaze

Hi-

I've modified my crtinit.s file to copy some sections on startup and that is working beautifully. However, I'd like to make sure that any builds that i do for other projects aren't tainted by my modified crtinit.o file. So, I'm trying to use the -B<dir_name> argument with gcc but am having little luck. My software is still linking with the crtinit.o file found in $(EDK_ROOT)/gnu/microblaze/nt/microblaze-xilinx-elf/lib/m. If I change the name of that file, then it finds the crtinit.o file located in the directory that I specify with -B. Any thoughts on why the linker isn't first looking at my -B directory?

 

Thanks,

Dan 

0 Kudos
4 Replies
schetz
Observer
Observer
5,499 Views
Registered: ‎11-29-2007

Are you using the -nostartfiles option when linking? I think using this option should force you to add the necessary start files to your project explicitly, instead of looking the the EDK directory. Then, add your modified startup files (I think there are two you need) to your project. Other projects, without the -nostartfiles option, should build normally, using the start files from the EDK directory. Check out this document: http://www.xilinx.com/support/documentation/sw_manuals/xilinx11/est_rm.pdf, especially pages 135-139.

 

 

schetz
Observer
Observer
5,498 Views
Registered: ‎11-29-2007

0 Kudos
dbrinks
Visitor
Visitor
5,488 Views
Registered: ‎10-13-2009

Well, the problem with using -nostartfiles is that the linker then uses none of the provided start files. While I can grab all the start files myself and pull them into the appropriate directory, I'd really just prefer that the linker look in my directory first and then use it's default locations (which also seems to be what documentation indicates -B should do). Also, based on the fact that the linker will use my crtinit.o if I rename the one it normally chooses indicates to me that it is at least recognizing the -B option I'm passing.
0 Kudos
dbrinks
Visitor
Visitor
5,482 Views
Registered: ‎10-13-2009

One more note is that I am using EDK 10.1.03.
0 Kudos