This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] Avoid .rela.stab on ppc
- To: geoffk at geoffk dot org, binutils at sources dot redhat dot com
- Subject: [PATCH] Avoid .rela.stab on ppc
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Thu, 4 Oct 2001 18:51:29 +0200
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
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