[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Linkage order for compiler-generated code?
- Date: Wed, 22 Aug 2007 18:21:49 -0700
- From: ptorre at zetron.com (Phil Torre)
- Subject: Linkage order for compiler-generated code?
Hi All,
Got a weird problem here. The environment is rtems-4.6.0 or so, built
with gcc-3.2.3 with the RTEMS patches applied.
We build our powerpc-targeted RTEMS code on either Cygwin or Linux,
as suits the particular developer. A while back, I made sure that
we could obtain a bit-identical image from the same source, regardless
of build host. I just went back to revisit that assumption, and found
that it was false.
Details: Both build hosts are generating exactly the same code, except
for the extra "magic C++ goop" that the compiler throws in for free
(__cxa_begin_catch, __cxa_end_catch, and about 25 other functions).
That "bonus" code has the same instructions, but the functions appear
in different order in the final linked elf file, so all code that
calls any of them ends up with different branch addresses. All works
fine, of course, but the different addresses cause the ROM code to
have a different CRC-32 depending on which host it was built on.
Does anyone know what controls the order that the extra functions get
linked in? (This is more appropriate to the gcc list, but I can't
find anything even relevant there.)
Thanks much for any suggestions...
-Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rtems.rtems.org/pipermail/rtems-users/attachments/20070822/4cb590ff/attachment.html