[Tizen Application-dev] tizen native development - global operator new / delete override issue
nick.dodonov at gmail.com
Fri Jun 14 18:33:47 GMT 2013
The problem (and sample) in details is described on forum:
In short: global new/delete operators overriding behave differently when
application is executed with a debugger or just launched (by tap f.e.).
With further researches I've got:
* When application is executed with a debugger
- it's executed as a separate process.
- `sdb shell pmap <pid>` gives info that executable is loaded *first*
before any dynamic library.
- run-time dynamic linker correctly resolves undefined/weak symbols from
loaded dynamic libraries to my executable, so symbols just
like _Znwj/_ZdlPv/etc (operator new/delete/etc) correctly resolved to my
- OspMain is called after everything is loaded via
- all works correctly!
* When application is just launched
- it is executed as fork()
- `pmap` for 'launchpad' gives that it's already loaded every platform's
dynamic library, so all their undefined/weak symbols are possibly already
- forked launchpad's uiapp_loader.c/main() loads my executable via dlopen()
(so it became *last* loaded in pmap) and calls OspMain
So in launch mode, in case executable uses code like this:
SomeLibraryClass* p = new SomeLibraryClass();
'operator new' is called from executable, but 'operator delete' from
libstdc++ (because gcc compiler puts 'operator delete' invocation into
So question now is: Is it possible to override global operator new/delete
in Tizen native application?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Application-dev