From 84dcde01bdb678f5fca3a237d798fe9d7b297215 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 2 Dec 2004 02:21:28 +0000 Subject: [PATCH] re PR target/16952 (GCC for powerpc cross target with -mrelocatable reports error) PR target/16952 * config/rs6000/rs6000.c (rs6000_assemble_integer): Replace #ifdef RELOCATABLE_NEEDS_FIXUP with if. * config/rs6000/linux.h (RELOCATABLE_NEEDS_FIXUP): Define in terms of target_flags_explicit. * config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Ditto for biarch case. Define as 0 for non-biarch. From-SVN: r91605 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/rs6000/linux.h | 5 ++++- gcc/config/rs6000/linux64.h | 12 +++++++----- gcc/config/rs6000/rs6000.c | 8 +++++--- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 132b1e1f0b1..88593cfee8e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2004-12-02 Alan Modra + + PR target/16952 + * config/rs6000/rs6000.c (rs6000_assemble_integer): Replace + #ifdef RELOCATABLE_NEEDS_FIXUP with if. + * config/rs6000/linux.h (RELOCATABLE_NEEDS_FIXUP): Define in terms + of target_flags_explicit. + * config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Ditto for biarch + case. Define as 0 for non-biarch. + 2004-12-01 Zack Weinberg * config/rs6000/t-aix43, config/rs6000/t-aix52 (SHLIB_LINK): diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h index d4ce10531fc..e35f03347e1 100644 --- a/gcc/config/rs6000/linux.h +++ b/gcc/config/rs6000/linux.h @@ -99,8 +99,11 @@ #undef TARGET_64BIT #define TARGET_64BIT 0 -/* We don't need to generate entries in .fixup. */ +/* We don't need to generate entries in .fixup, except when + -mrelocatable or -mrelocatable-lib is given. */ #undef RELOCATABLE_NEEDS_FIXUP +#define RELOCATABLE_NEEDS_FIXUP \ + (target_flags & target_flags_explicit & MASK_RELOCATABLE) #define TARGET_ASM_FILE_END file_end_indicate_exec_stack diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h index 8168cd3413b..2cfabb636d3 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -62,8 +62,11 @@ extern int dot_symbols; #undef PROCESSOR_DEFAULT64 #define PROCESSOR_DEFAULT64 PROCESSOR_POWER4 -#undef TARGET_RELOCATABLE -#define TARGET_RELOCATABLE (!TARGET_64BIT && (target_flags & MASK_RELOCATABLE)) +/* We don't need to generate entries in .fixup, except when + -mrelocatable or -mrelocatable-lib is given. */ +#undef RELOCATABLE_NEEDS_FIXUP +#define RELOCATABLE_NEEDS_FIXUP \ + (target_flags & target_flags_explicit & MASK_RELOCATABLE) #undef RS6000_ABI_NAME #define RS6000_ABI_NAME "linux" @@ -198,6 +201,8 @@ extern int dot_symbols; #define TARGET_EABI 0 #undef TARGET_PROTOTYPE #define TARGET_PROTOTYPE 0 +#undef RELOCATABLE_NEEDS_FIXUP +#define RELOCATABLE_NEEDS_FIXUP 0 #endif @@ -222,9 +227,6 @@ extern int dot_symbols; #define PROFILE_HOOK(LABEL) \ do { if (TARGET_64BIT) output_profile_hook (LABEL); } while (0) -/* We don't need to generate entries in .fixup. */ -#undef RELOCATABLE_NEEDS_FIXUP - /* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */ #undef ADJUST_FIELD_ALIGN #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index d9b363a864b..89f533563e5 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -11124,6 +11124,10 @@ print_operand_address (FILE *file, rtx x) abort (); } +#ifndef RELOCATABLE_NEEDS_FIXUP +#define RELOCATABLE_NEEDS_FIXUP 0 +#endif + /* Target hook for assembling integer objects. The PowerPC version has to handle fixup entries for relocatable code if RELOCATABLE_NEEDS_FIXUP is defined. It also needs to handle DI-mode objects on 64-bit @@ -11132,9 +11136,8 @@ print_operand_address (FILE *file, rtx x) static bool rs6000_assemble_integer (rtx x, unsigned int size, int aligned_p) { -#ifdef RELOCATABLE_NEEDS_FIXUP /* Special handling for SI values. */ - if (size == 4 && aligned_p) + if (RELOCATABLE_NEEDS_FIXUP && size == 4 && aligned_p) { extern int in_toc_section (void); static int recurse = 0; @@ -11182,7 +11185,6 @@ rs6000_assemble_integer (rtx x, unsigned int size, int aligned_p) return true; } } -#endif /* RELOCATABLE_NEEDS_FIXUP */ return default_assemble_integer (x, size, aligned_p); } -- 2.30.2