Author: markj
Date: Sun Dec 29 19:27:32 2013
New Revision: 260051
URL: http://svnweb.freebsd.org/changeset/base/260051

Log:
  When clearing relocations to __dtrace* symbols, handle both SHT_REL and
  SHT_RELA sections properly instead of assuming that the relocation section
  is of type SHT_REL.
  
  Submitted by: Prashanth Kumar <pra_ud...@yahoo.co.in> (original version)
  MFC after:    1 month

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c        Sun Dec 
29 19:21:59 2013        (r260050)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c        Sun Dec 
29 19:27:32 2013        (r260051)
@@ -1620,10 +1620,17 @@ process_obj(dtrace_hdl_t *dtp, const cha
                         * the executable file as the symbol is going to be
                         * change from UND to ABS.
                         */
-                       rela.r_offset = 0;
-                       rela.r_info  = 0;
-                       rela.r_addend = 0;
-                       (void) gelf_update_rela(data_rel, i, &rela);
+                       if (shdr_rel.sh_type == SHT_RELA) {
+                               rela.r_offset = 0;
+                               rela.r_info  = 0;
+                               rela.r_addend = 0;
+                               (void) gelf_update_rela(data_rel, i, &rela);
+                       } else {
+                               GElf_Rel rel;
+                               rel.r_offset = 0;
+                               rel.r_info = 0;
+                               (void) gelf_update_rel(data_rel, i, &rel);
+                       }
 #endif
 
                        mod = 1;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to