Fix DT_TEXTREL for ppc32

Andreas Schwab schwab@suse.de
Wed Jan 15 00:19:00 GMT 2003


It seems I don't get support for removing relocs against unallocated
section altogether; this will at least fix the setting of DT_TEXTREL.

Andreas.

2003-01-15  Andreas Schwab  <schwab@suse.de>

	* elf32-ppc.c (ppc_elf_check_relocs): Don't set DF_TEXTREL for a
	relocation against a non-allocated readonly section.

--- bfd/elf32-ppc.c.~1.61.~	2003-01-14 23:57:59.000000000 +0100
+++ bfd/elf32-ppc.c	2003-01-15 01:07:00.000000000 +0100
@@ -2068,7 +2068,6 @@ ppc_elf_size_dynamic_sections (output_bf
 	{
 	  if (!add_dynamic_entry (DT_TEXTREL, 0))
 	    return FALSE;
-	  info->flags |= DF_TEXTREL;
 	}
     }
 #undef add_dynamic_entry
@@ -2437,7 +2436,8 @@ ppc_elf_check_relocs (abfd, info, sec, r
 			  || ! bfd_set_section_alignment (dynobj, sreloc, 2))
 			return FALSE;
 		    }
-		  if (sec->flags & SEC_READONLY)
+		  if ((sec->flags & (SEC_READONLY | SEC_ALLOC))
+		      == (SEC_READONLY | SEC_ALLOC))
 		    info->flags |= DF_TEXTREL;
 		}
 



More information about the Binutils mailing list