On Tuesday 29 December 2009 18:53:10, Kai Tietz wrote: > Hello, > > 2009/12/29 Pedro Alves <alves....@gmail.com>: > > My knee jerk reaction is: you could try a first step at checking if it's > > a problem with loader applied relocations, or, if it's a runtime, > > post loader problem. Replace your debug '#if 0' by, say, > > > > at global scope: > > volatile int print_base = 0; > > > > { > > ... > > if (print_base) > > wsprintf(msg, L"Ptr %p", &__U(_image_base__)); > > wsprintf(msg, L"Ptrs %p %p", &__RUNTIME_PSEUDO_RELOC_LIST__, > > &__RUNTIME_PSEUDO_RELOC_LIST_END__); > > } > > > > And see if that loads and runs. Then try with print_base set to 1. > > Build without optimizations. > > > > -- > > Pedro Alves > > > > I assume, that the use of wsprintf is done before runtime is > initialized,
The runtime is builtin coredll.dll (CE's "equivalent" of ntdll.dll). In any case, Danny's LoadLibrary'ing the dll. The runtime is already initialized by then. > or the image_base symbol is pointing somewhere else (but > this is a simple address and therefore a print failure is a bit > strange as not the location is dereferenced, just a value is shown). Yes, quite strange. That's why I wanted to confirm that it's not a problem with ld generating a bad reloc for _image_base, so that the OS loader ended up doing something that it shouldn't. Building the example I gave should still generate the reloc, even if &_image_base isn't read at runtime, due to print_base == 0. Might be useful to look at the generated code / relocs too. Anyway, these are just wild guesses. :-) -- Pedro Alves ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Cegcc-devel mailing list Cegcc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cegcc-devel