import gdb-2000-02-02 snapshot
[external/binutils.git] / gas / config / tc-sparc.h
index 40ab02c..91fda22 100644 (file)
@@ -123,16 +123,32 @@ extern int elf32_sparc_force_relocation PARAMS ((struct fix *));
 /* Keep relocations against global symbols.  Don't turn them into
    relocations against sections.  This is required for the dynamic
    linker to operate properly.  When generating PIC, we need to keep
-   any non PC relative reloc.  */
+   any non PC relative reloc.  The PIC part of this test must be
+   parallel to the code in tc_gen_reloc which converts relocations to
+   GOT relocations.  */
 #define tc_fix_adjustable(FIX)                                         \
   (! S_IS_EXTERNAL ((FIX)->fx_addsy)                                   \
    && ! S_IS_WEAK ((FIX)->fx_addsy)                                    \
+   && (FIX)->fx_r_type != BFD_RELOC_VTABLE_INHERIT                     \
+   && (FIX)->fx_r_type != BFD_RELOC_VTABLE_ENTRY                       \
    && (! sparc_pic_code                                                        \
-       || (FIX)->fx_pcrel                                              \
-       || ((FIX)->fx_subsy != NULL                                     \
-          && (S_GET_SEGMENT ((FIX)->fx_subsy)                          \
-              == S_GET_SEGMENT ((FIX)->fx_addsy)))                     \
-       || S_IS_LOCAL ((FIX)->fx_addsy)))
+       || ((FIX)->fx_r_type != BFD_RELOC_HI22                          \
+          && (FIX)->fx_r_type != BFD_RELOC_LO10                        \
+          && (FIX)->fx_r_type != BFD_RELOC_SPARC13                     \
+          && ((FIX)->fx_r_type != BFD_RELOC_32_PCREL_S2                \
+              || (S_IS_DEFINED ((FIX)->fx_addsy)                       \
+                  && ! S_IS_COMMON ((FIX)->fx_addsy)                   \
+                  && ! S_IS_EXTERNAL ((FIX)->fx_addsy)                 \
+                  && ! S_IS_WEAK ((FIX)->fx_addsy)))                   \
+          && ((FIX)->fx_pcrel                                          \
+              || ((FIX)->fx_subsy != NULL                              \
+                  && (S_GET_SEGMENT ((FIX)->fx_subsy)                  \
+                      == S_GET_SEGMENT ((FIX)->fx_addsy)))             \
+              || S_IS_LOCAL ((FIX)->fx_addsy)))))
+
+/* Finish up the entire symtab.  */
+#define tc_adjust_symtab() sparc_adjust_symtab ()
+extern void sparc_adjust_symtab PARAMS ((void));
 #endif
 
 #ifdef OBJ_AOUT