This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: select_rtx_section and relocations on Darwin.
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: apinski at apple dot com, Geoff Keating <geoffk at geoffk dot org>, Andrew Pinski <pinskia at physics dot uc dot edu>
- Date: Sat, 20 Sep 2003 13:44:02 -0700
- Subject: Re: select_rtx_section and relocations on Darwin.
Geoff,
Your patch for fixing this problem was not right for the dynamic-no-pic
case or the static case.
The right macro to check is MACHOPIC_INDIRECT (not
MACHO_DYNAMIC_NO_PIC_P) which says
either PIC code or dynamic-no-pic code is being generated (not just
static or no PIC code).
Since dynamic-no-pic still need most of the same as PIC code when
dealing with
relocations, unlike non-PIC code. This patch fixes this problem. Also
it fixes gap
(part of SPEC CPU 2000) when compiled with -mdynamic-no-pic which fails
currently.
Ok?
ChangeLog:
* config/darwin.c (machopic_select_rtx_section): Fix check for PIC
code.
Patch:
Index: darwin.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.c,v
retrieving revision 1.42
diff -u -p -r1.42 darwin.c
--- darwin.c 12 Sep 2003 23:45:03 -0000 1.42
+++ darwin.c 20 Sep 2003 20:31:17 -0000
@@ -1242,7 +1242,7 @@ machopic_select_rtx_section (enum machin
&& (GET_CODE (x) == CONST_INT
|| GET_CODE (x) == CONST_DOUBLE))
literal4_section ();
- else if (! MACHO_DYNAMIC_NO_PIC_P
+ else if (MACHOPIC_INDIRECT
&& (GET_CODE (x) == SYMBOL_REF
|| GET_CODE (x) == CONST
|| GET_CODE (x) == LABEL_REF))