public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* vtbl pointer wrong on lm32 target
@ 2020-09-07  7:44 Daniel Anselmi
  0 siblings, 0 replies; only message in thread
From: Daniel Anselmi @ 2020-09-07  7:44 UTC (permalink / raw)
  To: gcc-help

Hello everyone,
 
I'am using binutils 2.35.0 and gcc 10.2.0 for the lm32 target.

The vtable pointers are pointing to the wrong location. It points two words before the vtable in the data section. gdb 9.2:
(gdb) info vtbl d1
vtable for 'D1' @ 0xfec (subobject @ 0x10f4):
[0]: 0x0 <_reset_handler>
(gdb) info symbol *0xfec
_reset_handler in section .boot
(gdb) info symbol *0xff0
typeinfo for D1 in section .rodata
(gdb) info symbol *0xff4
D1::doIt() in section .text
 
If LTO is enabled dring compiling and linking, the generated code and data is ok:
 
(gdb) info vtbl d1
vtable for 'D1' @ 0x5b8 (subobject @ 0x5fc):
[0]: 0x270 <D1::doIt()>
 
I have no idea what I am doing wrong. I believe it is a bug in the toolchain, either in g++ or ld but I am not sure.
What can i do/check?
 
Any ideas?
 
Any help is welcome.
Regards danselmi

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-07  7:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07  7:44 vtbl pointer wrong on lm32 target Daniel Anselmi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).