This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 6/7] [ARC] [Cxx] Fix calling multiple inheritances.
- From: Claudiu Zissulescu <Claudiu dot Zissulescu at synopsys dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: <Claudiu dot Zissulescu at synopsys dot com>, <Francois dot Bedard at synopsys dot com>, <andrew dot burgess at embecosm dot com>
- Date: Fri, 14 Apr 2017 14:14:43 +0200
- Subject: [PATCH 6/7] [ARC] [Cxx] Fix calling multiple inheritances.
- Authentication-results: sourceware.org; auth=none
- References: <1492172084-3921-1-git-send-email-claziss@synopsys.com>
The TARGET_ASM_OUTPUT_MI_THUNK hook doesn't take into account the
variant when we compile for PIC.
gcc/
2016-12-13 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.c (arc_output_mi_thunk): Emit PIC calls.
---
gcc/config/arc/arc.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 73d72c68..36582d2 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -6434,10 +6434,28 @@ arc_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
fnaddr = XEXP (DECL_RTL (function), 0);
if (arc_is_longcall_p (fnaddr))
- fputs ("\tj\t", file);
+ {
+ if (flag_pic)
+ {
+ asm_fprintf (file, "\tld\t%s, [pcl, @",
+ ARC_TEMP_SCRATCH_REG);
+ assemble_name (file, XSTR (fnaddr, 0));
+ fputs ("@gotpc]\n", file);
+ asm_fprintf (file, "\tj\t[%s]", ARC_TEMP_SCRATCH_REG);
+ }
+ else
+ {
+ fputs ("\tj\t@", file);
+ assemble_name (file, XSTR (fnaddr, 0));
+ }
+ }
else
- fputs ("\tb\t", file);
- assemble_name (file, XSTR (fnaddr, 0));
+ {
+ fputs ("\tb\t@", file);
+ assemble_name (file, XSTR (fnaddr, 0));
+ if (flag_pic)
+ fputs ("@plt\n", file);
+ }
fputc ('\n', file);
}
--
1.9.1