public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Daniel Anselmi <danselmi@gmx.ch>
To: gcc-help@gcc.gnu.org
Subject: vtbl pointer wrong on lm32 target
Date: Mon, 7 Sep 2020 09:44:46 +0200	[thread overview]
Message-ID: <trinity-edbdd256-d9d6-4551-8897-fa4b69a88bfc-1599464686841@3c-app-gmx-bs31> (raw)

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

                 reply	other threads:[~2020-09-07  7:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-edbdd256-d9d6-4551-8897-fa4b69a88bfc-1599464686841@3c-app-gmx-bs31 \
    --to=danselmi@gmx.ch \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).