> > Yep, c++ vs. c linkage e.g. Therefore the symbols are different even if the > > source is the same ! > > Doesn't helped my suggestion from "Re: [rtl] Using C++ in rtlinux" 29.01.01 ??? > > What do you get for error messages on loading the module. > > Sorry that it took us so long to prepare a response to Herman Bruyninckx. > We did not manage to check your suggestion when we send it. If you are in the rtl-mailing list these should be distributed. > We look upon this problem as a compiler bug and wanted some more persons to see this, > especially the GNU compiler writers ... > Your suggestion (-O0) works. > We also tried -O2 and a reference to "__module_kernel_version" in our code, Do I misunderstand you ? Why do you refer to this symbol. It's build/imported by module.h and used by kernel module loader. Imo there is no other use on it. > but, although the kernel version string appears in the object file, it did not work >and > compiling that file with -O0 resulted in th double occurrence of the string in the >.o file! You have to define __NO_VERSION__ on all other sources/headers else you will get multiple symbols if you include linux/module.h ! May suggestion is to use one c file and compile it as usually as c source -> obj file and link it to the other c++ obj files, compiled with __NO_VERSION__ (defined in source or header each time) with -O{1-3} > Since we do not want to compile all our code with -O0, we have to "combine" a number > of object files. We tried ld -Ur -o out.o a.o b.o ... but we got unresolved name >errors from It's the common way. No idea what is -Ur at moment. I use: $(LD) -m elf_i386 -static -r -o mymod.o $(CRTBEGIN) $(rmymod_OBJECTS) $(CRTEND) > insmod. What would be the correct way to do this? What for symbols by name ? There are some articles concerning c++ && kernel/rtl in the mailing list archive. Even you have to compile without exception handling and rtti. Regards Olaf -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED] --- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/