This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


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

[PATCH] Avoid .rela.stab on ppc


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


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