public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@adacore.com>
To: Umesh Kalappa <umesh.kalappa0@gmail.com>
Cc: gcc@gcc.gnu.org
Subject: Re: [PowerPC 64]r12 is not updated to GEP when control transferred from virtual thunk function .
Date: Wed, 15 May 2019 16:05:00 -0000	[thread overview]
Message-ID: <3290120.NdSNzDBL4k@polaris> (raw)
In-Reply-To: <CAGfacvQc=X8vcxoVqbjbimTPLctQzKbzex1odEggRsjrphnurw@mail.gmail.com>

> like above the control  from "_ZThn8_N12Intermediate1vEv" (support
> function for this pointer update)  is transferred
> "_ZN12Intermediate1vEv" by b  inst (where its not updating the r12)
> and in the beginning  of   "_ZN12Intermediate1vEv" we are loading the
> toc base from r12 (which is incorrect ) ,we are investigating the
> issue and one way to fix the issue is that make THUNK to update the
> r12 ,the cal like bctrl  or  load the r12 with the function address in
> the _ZN12Intermediate1vEv prologue code .

Is that on VxWorks in kernel mode?  If so, the loader doesn't abide by the 
ELFv2 ABI so the simple way out is to disable asm thunks altogether:

#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK rs6000_can_output_mi_thunk

/* Return true if rs6000_output_mi_thunk would be able to output the
   assembler code for the thunk function specified by the arguments
   it is passed, and false otherwise.  */

static bool
rs6000_can_output_mi_thunk (const_tree, HOST_WIDE_INT, HOST_WIDE_INT,
			    const_tree)
{
  /* The only possible issue is for VxWorks in kernel mode.  */
  if (!TARGET_VXWORKS || TARGET_VXWORKS_RTP)
    return true;

  /* The loader neither creates the glue code sequence that loads r12 nor uses
     the local entry point for the sibcall's target in the ELFv2 ABI.  */
  return DEFAULT_ABI != ABI_ELFv2;
}

-- 
Eric Botcazou

  reply	other threads:[~2019-05-15 16:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-15 15:27 Umesh Kalappa
2019-05-15 16:05 ` Eric Botcazou [this message]
2019-05-15 17:47   ` Umesh Kalappa
2019-05-15 18:31     ` Eric Botcazou
2019-05-15 23:52       ` Segher Boessenkool
2019-05-16  3:30         ` Umesh Kalappa
2019-05-16 12:43           ` Umesh Kalappa
2019-05-16 22:52             ` Segher Boessenkool
2019-05-17  3:58               ` Umesh Kalappa
2019-05-20  6:50               ` Alan Modra
2019-05-20  7:55                 ` Segher Boessenkool
2019-05-20  8:19                   ` Alan Modra
2019-05-20  8:39                     ` Segher Boessenkool
2019-05-20  9:48                       ` Alan Modra
2019-05-15 23:37 ` Segher Boessenkool
2019-05-17  6:22   ` Kewen.Lin
2019-05-17  7:24     ` Eric Botcazou
2019-05-17  9:29       ` Kewen.Lin

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=3290120.NdSNzDBL4k@polaris \
    --to=ebotcazou@adacore.com \
    --cc=gcc@gcc.gnu.org \
    --cc=umesh.kalappa0@gmail.com \
    /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).