- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have an application that compiles and somewhat runs on my system. However, it's not very impressive because much of the init stuff is not done at after the application is launched. There are a lot of internal "command not found" errors. This is because there are several global constructors that should be called at the startup of the application, and I'm pretty sure this is not being done.
What I think? The startup file crt0.o does not make calls to the constructors. I've looked at the crti.o and crtn.o, but for now, this stuff is over my head. Also what I think? I see that the linker script has some entries for *(.ctors.*) and *(.ctors) in the .data section, and nothing in the .text section. My problem here is that I can read the script, but I can't make much sense out of it. Again, over my head for now. I can run nios2-elf-readelf, and nios2-elf-objdump. Everything seems to be there. Can I add anything to the linker to get the constructors called? My linker currently goes something like this. /cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/nios2-elf-g++ -o first -Wl,-Bstatic -L../../../li b/NiosII/ -msys-crt0=/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_1.4.0/lib/crt0. o -r -d first_registerRecordDeviceDriver.o dbSubExample.o firstMain.o -lxxxSupport -lrecIoc -lsoftDevIoc -liocs h -lmiscIoc -lrsrvIoc -ldbtoolsIoc -lasIoc -ldbIoc -lregistryIoc -ldbStaticIoc -lca -lCom -lpthread -lm -lrt -lc I have copied libm.a, librt.a, and libc.a to the local directory above for now. DougLink Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page