Module Name:    src
Committed By:   christos
Date:           Tue Apr  2 03:01:50 UTC 2019

Modified Files:
        src/external/gpl3/gcc/dist/gcc/config/vax: vax.c

Log Message:
Compiling some files with -fPIC and -O2 ends up having global
symbols classified as local in pic mode, and that ends up with PC32
relocations "movl *psp, %rx" (/bin/sh parse.c). Treat pic code as
shared libraries to avoid classifying common initialized symbols
as local. Thanks to thorpej@ for his help.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/gpl3/gcc/dist/gcc/config/vax/vax.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/vax/vax.c
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/vax.c:1.17 src/external/gpl3/gcc/dist/gcc/config/vax/vax.c:1.18
--- src/external/gpl3/gcc/dist/gcc/config/vax/vax.c:1.17	Sat Jan 19 07:10:07 2019
+++ src/external/gpl3/gcc/dist/gcc/config/vax/vax.c	Mon Apr  1 23:01:50 2019
@@ -118,6 +118,18 @@ static bool vax_mode_dependent_address_p
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE vax_option_override
 
+#if TARGET_ELF
+#undef TARGET_BINDS_LOCAL_P
+#define TARGET_BINDS_LOCAL_P vax_elf_binds_local_p
+
+static bool
+vax_elf_binds_local_p (const_tree exp)
+{
+  return default_binds_local_p_3 (exp, (flag_shlib | flag_pic) != 0,
+				  true, false, false);
+}
+#endif
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Set global variables as needed for the options enabled.  */
@@ -1828,8 +1840,11 @@ legitimate_pic_operand_p (rtx x)
 static bool
 indirectable_constant_address_p (rtx x, bool indirect)
 {
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (GET_CODE (x) == SYMBOL_REF) {
+    fprintf (asm_out_file, "%s: %d %d %d\n", __func__,
+    !flag_pic, SYMBOL_REF_LOCAL_P (x), !indirect);
     return !flag_pic || SYMBOL_REF_LOCAL_P (x) || !indirect;
+}
 
   if (GET_CODE (x) == CONST)
     return !flag_pic

Reply via email to