diff mbox

PowerPC section type conflict (created PR 51623)

Message ID 20111229211622.GA309@ibm-tiger.the-meissners.org
State New
Headers show

Commit Message

Michael Meissner Dec. 29, 2011, 9:16 p.m. UTC
On Wed, Dec 28, 2011 at 12:34:25PM -0800, Richard Henderson wrote:
> On 12/28/2011 09:39 AM, Michael Meissner wrote:
> >  	  && in_section != text_section
> > -	  && !unlikely_text_section_p (in_section)
> > +	  && (in_section && (in_section->common.flags & SECTION_CODE)) == 0
> 
> You should be able to delete the text_section test as well,
> and in_section should *never* be null, when emitting data.
> 
> Otherwise this looks much better to me.

In talking to David, I convinced myself that initialized pointers should never
be in the text section (switch statements use relative pointers, not absolute
addresses currently), so I committed this patch on top of the previous one:

2011-12-29  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/51623
	* config/rs6000/rs6000.c (rs6000_assemble_integer): Delete check
	for an initialized pointer being in a text section with
	-mrelocatable, since it should never happen.
diff mbox

Patch

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 182730)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -15456,12 +15456,13 @@  rs6000_assemble_integer (rtx x, unsigned
     {
       static int recurse = 0;
 
-      /* For -mrelocatable, we mark all addresses that need to be fixed up
-	 in the .fixup section.  */
+      /* For -mrelocatable, we mark all addresses that need to be fixed up in
+	 the .fixup section.  Since the TOC section is already relocated, we
+	 don't need to mark it here.  We used to skip the text section, but it
+	 should never be valid for relocated addresses to be placed in the text
+	 section.  */
       if (TARGET_RELOCATABLE
 	  && in_section != toc_section
-	  && in_section != text_section
-	  && (in_section && (in_section->common.flags & SECTION_CODE)) == 0
 	  && !recurse
 	  && GET_CODE (x) != CONST_INT
 	  && GET_CODE (x) != CONST_DOUBLE