This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

[PATCH] Fix ppc64_elf_adjust_dynamic_symbol


Hi!

http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239222
contains a testcase (very questionable code, I guess that compiler hasn't
been properly ported for ppc64) which puts OPD entry of two functions into .dynbss
section (without creating any kind of relocations for that place,
and allocating the size of the code of those functions in .dynbss rather
than just the size of OPD entries).

ppc64_elf_adjust_dynamic_symbol is called with caml_alloc (and
caml_sys_exit) symbols with h->type == STT_FUNC, h->needs_plt != 0,
h->u.weakdef == NULL, h->def_regular != 0, h->ref_regular != 0,
h->def_dynamic == 0, info->shared == 0, h->non_got_ref != 0.
Looking many other backends the if (h->type == STT_FUNC || h->needs_plt)
block always ends with return TRUE, except in elf64-ppc.c.
Is there any reason for that?  If not, the following patch can cure it,
if yes, we need some checking before the if (ELIMINATE_COPY_RELOCS)
to make sure we really want copyreloc processing.  Particularly,
when !(h->def_dynamic && h->ref_regular && !h->def_regular), I believe
we never need it.

2007-05-06  Jakub Jelinek  <jakub@redhat.com>

	* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't do copyreloc
	processing for STT_FUNC or needs_plt symbols.

--- bfd/elf64-ppc.c.jj	2007-05-06 17:53:09.000000000 +0200
+++ bfd/elf64-ppc.c	2007-05-06 21:01:50.000000000 +0200
@@ -5821,6 +5821,7 @@ ppc64_elf_adjust_dynamic_symbol (struct 
 	  h->plt.plist = NULL;
 	  h->needs_plt = 0;
 	}
+      return TRUE;
     }
   else
     h->plt.plist = NULL;

	Jakub


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