This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Why deos ELF/PPC care R_PPC_NONE?
- To: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Subject: Re: Why deos ELF/PPC care R_PPC_NONE?
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Thu, 18 Oct 2001 13:28:49 -0700
- Cc: binutils at sourceware dot cygnus dot com
- References: <20011016201334.A31989@lucon.org> <5.1.0.14.2.20011018170201.054d1008@mail.lauterbach.com> <20011018125216.A2750@lucon.org>
On Thu, Oct 18, 2001 at 12:52:16PM -0700, H . J . Lu wrote:
> The PPC linker doesn't give a clue when something goes wrong:
>
> 3262 else if (sec == NULL || sec->owner == NULL)
> 3263 {
> 3264 bfd_set_error (bfd_error_bad_value);
> 3265 return false;
> 3266 }
>
> which I think is a very bad practice. The real problem is ELF/PPC is
> trying to handle R_PPC_NONE like a normal relocation. Unfortunately,
> it is against the removed linkonce section. I have no idea what is
> so special about ELF/PPC that R_PPC_NONE has to be handled that way.
>
> BTW, we need to check all ELF backends to see if they do strange things
> to R_XXX_NONE like ELF/PPC.
>
>
This patch seems to work for me.
H.J.
----
2001-10-18 H.J. Lu <hjl@gnu.org>
* elf32-i370.c (i370_elf_relocate_section): Ignore R_XXX_NONE.
* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
Index: elf32-i370.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-i370.c,v
retrieving revision 1.13
diff -u -p -r1.13 elf32-i370.c
--- elf32-i370.c 2001/09/24 00:03:54 1.13
+++ elf32-i370.c 2001/10/18 20:19:00
@@ -1432,6 +1432,9 @@ i370_elf_relocate_section (output_bfd, i
ret = false;
continue;
+ case (int)R_I370_NONE:
+ continue;
+
/* Relocations that may need to be propagated if this is a shared
object. */
case (int)R_I370_REL31:
@@ -1444,7 +1447,6 @@ i370_elf_relocate_section (output_bfd, i
/* Relocations that always need to be propagated if this is a shared
object. */
- case (int)R_I370_NONE:
case (int)R_I370_ADDR31:
case (int)R_I370_ADDR16:
if (info->shared)
Index: elf32-ppc.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-ppc.c,v
retrieving revision 1.26
diff -u -p -r1.26 elf32-ppc.c
--- elf32-ppc.c 2001/10/15 20:55:58 1.26
+++ elf32-ppc.c 2001/10/18 20:19:00
@@ -3128,6 +3128,9 @@ ppc_elf_relocate_section (output_bfd, in
ret = false;
continue;
+ case (int) R_PPC_NONE:
+ continue;
+
/* Relocations that need no special processing. */
case (int) R_PPC_LOCAL24PC:
/* It makes no sense to point a local relocation
@@ -3163,7 +3166,6 @@ ppc_elf_relocate_section (output_bfd, in
/* Relocations that always need to be propagated if this is a shared
object. */
- case (int) R_PPC_NONE:
case (int) R_PPC_ADDR32:
case (int) R_PPC_ADDR24:
case (int) R_PPC_ADDR16: