[PATCH] Avoid .rela.stab on ppc

Jakub Jelinek jakub@redhat.com
Thu Oct 4 09:47:00 GMT 2001


Hi!

This is similar to my sparc32 patch from July.
Basically, I don't think we should output .rela.* sections for debugging
sections in shared libraries (of course, unless --emit-relocs), gdb doesn't
use it anyway and most other ELF backends don't emit them.
Ok to commit?

2001-10-04  Jakub Jelinek  <jakub@redhat.com>

	* elf32-ppc.c (ppc_elf_check_relocs): Don't output relocations for
	debugging sections.
	(ppc_elf_relocate_section): Likewise.
	* elf64-ppc.c (ppc64_elf_check_relocs): Don't output relocations for
	debugging sections.
	(ppc64_elf_relocate_section): Likewise.

--- bfd/elf64-ppc.c.jj	Mon Aug 27 12:22:03 2001
+++ bfd/elf64-ppc.c	Thu Oct  4 20:44:00 2001
@@ -1838,7 +1838,7 @@ ppc64_elf_check_relocs (abfd, info, sec,
 	  /* fall through */
 
 	default:
-	  if (info->shared)
+	  if (info->shared && (sec->flags & SEC_ALLOC) != 0)
 	    {
 #ifdef DEBUG
 	      fprintf (stderr, "ppc64_elf_check_relocs need to create relocation for %s\n",
@@ -2957,7 +2957,7 @@ ppc64_elf_relocate_section (output_bfd, 
 	case (int) R_PPC64_UADDR32:
 	case (int) R_PPC64_UADDR16:
 	case (int) R_PPC64_TOC:
-	  if (info->shared)
+	  if (info->shared && (input_section->flags & SEC_ALLOC) != 0)
 	    {
 	      Elf_Internal_Rela outrel;
 	      boolean skip;
--- bfd/elf32-ppc.c.jj	Thu Oct  4 20:36:53 2001
+++ bfd/elf32-ppc.c	Thu Oct  4 20:39:31 2001
@@ -2382,7 +2382,7 @@ ppc_elf_check_relocs (abfd, info, sec, r
 	  /* fall through */
 
 	default:
-	  if (info->shared)
+	  if (info->shared && (sec->flags & SEC_ALLOC))
 	    {
 #ifdef DEBUG
 	      fprintf (stderr, "ppc_elf_check_relocs need to create relocation for %s\n",
@@ -3171,7 +3171,7 @@ ppc_elf_relocate_section (output_bfd, in
 	case (int) R_PPC_ADDR14:
 	case (int) R_PPC_UADDR32:
 	case (int) R_PPC_UADDR16:
-	  if (info->shared)
+	  if (info->shared && (input_section->flags & SEC_ALLOC))
 	    {
 	      Elf_Internal_Rela outrel;
 	      boolean skip;

	Jakub



More information about the Binutils mailing list