This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem with overlays and virtual functions.


Hi all,

We have a problem with vtables and segments when using overlays for SPUs on
the CELL.

The seg.map shows that a virtual function seems to be put on address zero:

xxxx.seg.map
-----------------------------
.a(lib_a-impure.o)
?.data.impure_data
??????????????? 0x00000000000001b0????? 0x300
/opt/cell/sysroot/usr/spu/lib/libc.a(lib_a-impure.o)

.rodata._ZTVZ20GOPFilterxxxE10CLinexxx
??????????????? 0x0000000000000000?????? 0x10
?.rodata._ZTVZ20GOPFilterxxxE10CLinexxx
??????????????? 0x0000000000000000?????? 0x10 ../spu_obj/GOPFilterxxx.o
??????????????? 0x0000000000000000??????????????? vtable for
GOPFilterxxx::CLinexxx
-----------------------------

Notice that the address changes from 0x00000000000001b0 to
0x0000000000000000.

The following addresses are then incremented from zero. This also gives the
consequence that the .toe section is not calculated correctly.

We have put all our classes locally inside a C declared function to ?hide?
the C++ features from the linker and it seems to work well except for
virtual functions.

Because of the vtable problem we are now thinking of abandoning using
virtual functions and using function pointers instead. We have not managed
to find detailed information regarding linking overlays and C++ source code.

Do you recommend against using virtual functions or is there a way to get
around this problem?

Thank you,
Peter Ronnquist





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]