-----Original Message----- From: John Marshall [mailto:[EMAIL PROTECTED]] Sent: Monday, 17 December 2001 8:38 PM To: Palm Developer Forum Subject: Re: Back to multi-segment: apologies ... and more.
>> Who is this John Marshal [sic] of whom you speak? >> In short, I am so certain because I wrote the code in GCC that does the >> inter-section jumps on m68k-palmos. If you want to be certain too, you >> could study that code. Sorry, John for misspelling your last name. I do so many typos that pretty often I can't undestand my own messages :=) The GCC code is too hard for understanding. However I would like to have a look at build-prc. And if coff format is documented somewhere, it will be also extremely helpful. As I mentioned, the compiler does not understand just "far call", therefore an alternative approach will require assembler stubs: I call an assembler function, which implements a cross-section call. I will need something similar to the code, generated my multigen: declarations of __text__sectionname (these fields presumingly contain start of sections) There is a Gcc function named _GccLoadCodeAndRelocateData, that probably copies other sections into RAM and fills __text__sectionname's with the load arress (BTW where can I get the source code of _GccLoadCodeAndRelocateData ?) You call _GccLoadCodeAndRelocateData at start it by overwriting .text entry point. You might argue that still it is not 'GCC-transparent'. But once I get a working model (will I ?), it will be much easier writing stubs for few global functions that annotating each static function. An it might be a step toward an automatic stub generation: you just make an ld script, while ld will do the rest, provided build-prc processes the coff in an appropriate way. > Will this run correctly on Palm OS? *NO*! Therefore it is a *feature* > if it is not accepted by build-prc. What do you mean by 'it doesn't run correctly on PalmOS' ? This depends mainly on how build-prc processes the binary file. If build-prc does it an inadequate way, it surely won't work. Anyway, I wouldn't blame PalmOS for that. > If you prevent the compiler from knowing this, for example by > rearranging sections behind its back, your code will crash at runtime > as soon as it calls a function in a section which you have rearranged > because it will jump to the wrong place. It won't crash with a correctly written stub. > But it's a fundamental consequence of m68k-palmos GCC's current implementation of > multiple code resources. I believe that current design is not developed on the Heavens, therefore it might have problems: those problems can be tolerated as far there is a way for an alternative approach. Unfortunately current build-prc implemetation doesn't provide any way to implement a multi-segment code appart from having __attribute(section(..)), while a simple build-prc fix (suggested in previous message) can enable that. Please, give a chance to ones who don't like current design and want to try an alternative. You aren't going to adopt MS style (do what we do, and don't ask any questions), are you ? Regards, Michael -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
