https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90513

            Bug ID: 90513
           Summary: Pwerplcelfv2 :R2 is not updated to the  TOC base .
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: umesh.kalappa0 at gmail dot com
  Target Milestone: ---

the attached case is failing with segfault  and found that r2 was not updated
with toc base ,since r12 doesn't point to Global entry point for the function
,since its local call (like bl func).

like eric mentioned,its the issue with vxworks kernel module and following fix
in the compiler 

#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;
}

will fix the issue ,but not optimal .

Reply via email to