I'm using the CVS version of prc-tools from Dec 19, 2001 to develop a
C++ application. The application uses multiple sections, and I have had
no problems with that until today.

I have one function that I cannot put into a different section. If I do,
I get all the classic symptoms one would expect when the caller's idea
of the section doesn't match the actual section (illegal instructions,
bus errors, basically jumping into random code). If I put the function
into the text section (i.e., by not declaring a section attribute for
it), all is well. The function is called from two different compilation
units; both callers get it wrong.

The function in question is a static class method, so I *know* that I've
only declared the function's section in one place. Furthermore, after
disassembling the code, I'm pretty sure that that the caller has it
right, and thinks that the function is in the "misc" section where it
was declared. I don't really know m68k assembler, but that's what the
following code suggests to me:

     708:       3f00            movew %d0,%sp@-
     70a:       206d 0000       moveal %a5@(0),%a0
                        70c: END16      __text__misc
     70e:       d1fc 0000 0000  addal #0,%a0
                        710: 32 Util::open_bookdb(unsigned short)
     714:       4e90            jsr %a0@

I've also verified that the function really has been put in the right
section by looking at both the linker map and the disassembled object
file.

I could just stick the function in the main section, but that section is
already pretty full with a third-party library. Plus, it has 8KB from
libcrt with what looks like exception and rtti support (btw, why is
that, when I compile with -fno-exceptions and -fno-rtti and link with
-lnoexcept?).

Anyway, unexplained behavior makes me nervous, so I would rather figure
out why this problem is occurring. Does anybody have any suggestions for
what to look at next?

-- 
Dave Carrigan ([EMAIL PROTECTED])            | YOW!!  Now I'm playing with my
UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS | HOLOGRAPHIC ATOMIC SIMULATION
Seattle, WA, USA                            | LASER pinball machine!!  WORLD
http://www.rudedog.org/                     | PEACE is in the BALANCE!!

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to