This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]