changeset 3304:7e1905f59c95

6501793 GOTOP relocation transition (optimization) fails with offsets > 2^32
author rie
date Wed, 20 Dec 2006 21:51:02 -0800
parents a703946f073b
children 904e0ec142b5
files usr/src/cmd/sgs/include/debug.h usr/src/cmd/sgs/include/i386/machdep.h usr/src/cmd/sgs/include/sparc/machdep.h usr/src/cmd/sgs/libld/common/machrel.amd.c usr/src/cmd/sgs/libld/common/machrel.intel.c usr/src/cmd/sgs/libld/common/machrel.sparc.c usr/src/cmd/sgs/libld/common/relocate.c usr/src/cmd/sgs/liblddbg/common/liblddbg.msg usr/src/cmd/sgs/liblddbg/common/llib-llddbg usr/src/cmd/sgs/liblddbg/common/mapfile-vers usr/src/cmd/sgs/liblddbg/common/relocate.c usr/src/cmd/sgs/packages/common/SUNWonld-README usr/src/cmd/sgs/rtld/common/util.c usr/src/uts/common/krtld/reloc.h usr/src/uts/sparc/krtld/doreloc.c
diffstat 15 files changed, 93 insertions(+), 97 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/sgs/include/debug.h	Wed Dec 20 21:31:33 2006 -0800
+++ b/usr/src/cmd/sgs/include/debug.h	Wed Dec 20 21:51:02 2006 -0800
@@ -713,8 +713,7 @@
 		    const char *);
 extern	void	Dbg_reloc_proc(Lm_list *, Os_desc *, Is_desc *, Is_desc *);
 extern	void	Dbg_reloc_run(Rt_map *, uint_t, int, int);
-extern	void	Dbg_reloc_transition(Lm_list *, Half, Word, Word, Xword,
-		    const char *);
+extern	void	Dbg_reloc_transition(Lm_list *, Half, Word, Rel_desc *);
 extern	void	Dbg_reloc_sloppycomdat(Lm_list *, const char *, Sym_desc *);
 
 extern	void	Dbg_sec_added(Lm_list *, Os_desc *, Sg_desc *);
--- a/usr/src/cmd/sgs/include/i386/machdep.h	Wed Dec 20 21:31:33 2006 -0800
+++ b/usr/src/cmd/sgs/include/i386/machdep.h	Wed Dec 20 21:51:02 2006 -0800
@@ -240,11 +240,6 @@
 #endif
 
 /*
- * Length of R_AMD64_
- */
-#define	M_R_STR_LEN	8
-
-/*
  * The following are defined as M_R_NONE so that checks
  * for these relocations can be performed in common code - although
  * the checks are really only relevant to SPARC.
--- a/usr/src/cmd/sgs/include/sparc/machdep.h	Wed Dec 20 21:31:33 2006 -0800
+++ b/usr/src/cmd/sgs/include/sparc/machdep.h	Wed Dec 20 21:51:02 2006 -0800
@@ -245,11 +245,6 @@
 #define	M_R_FPTR	R_SPARC_NONE
 #define	M_R_NUM		R_SPARC_NUM
 
-/*
- * Length of R_SPARC_
- */
-#define	M_R_STR_LEN	8
-
 #ifdef	_ELF64
 #define	M_R_ARRAYADDR	R_SPARC_64
 #define	M_R_DTPMOD	R_SPARC_TLS_DTPMOD64
--- a/usr/src/cmd/sgs/libld/common/machrel.amd.c	Wed Dec 20 21:31:33 2006 -0800
+++ b/usr/src/cmd/sgs/libld/common/machrel.amd.c	Wed Dec 20 21:51:02 2006 -0800
@@ -475,14 +475,13 @@
 			 *	0x10
 			 */
 			DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
-			    rtype, R_AMD64_GOTTPOFF, arsp->rel_roffset,
-			    sdp->sd_name));
+			    R_AMD64_GOTTPOFF, arsp));
 			arsp->rel_rtype = R_AMD64_GOTTPOFF;
 			arsp->rel_roffset += 8;
 			arsp->rel_raddend = (Sxword)-4;
 
 			/*
-			 * Addjust 'offset' to beginning of instruction
+			 * Adjust 'offset' to beginning of instruction
 			 * sequence.
 			 */
 			offset -= 4;
@@ -492,11 +491,10 @@
 
 		case R_AMD64_PLT32:
 			/*
-			 * Fixup done via the TLS_GD relocation
+			 * Fixup done via the TLS_GD relocation.
 			 */
 			DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
-			    rtype, R_AMD64_NONE, arsp->rel_roffset,
-			    sdp->sd_name));
+			    R_AMD64_NONE, arsp));
 			return (FIX_DONE);
 		}
 	}
@@ -522,15 +520,13 @@
 		 *	0x10
 		 */
 		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
-		    rtype, R_AMD64_TPOFF32, arsp->rel_roffset, sdp->sd_name));
-
+		    R_AMD64_TPOFF32, arsp));
 		arsp->rel_rtype = R_AMD64_TPOFF32;
 		arsp->rel_roffset += 8;
 		arsp->rel_raddend = 0;
 
 		/*
-		 * Addjust 'offset' to beginning of instruction
-		 * sequence.
+		 * Adjust 'offset' to beginning of instruction sequence.
 		 */
 		offset -= 4;
 		(void) memcpy(offset, tlsinstr_gd_le, sizeof (tlsinstr_gd_le));
@@ -549,21 +545,18 @@
 		 *	0x09 leaq x@tpoff(%rax), %rax
 		 *	0x10
 		 */
-		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH, rtype,
-		    R_AMD64_TPOFF32, arsp->rel_roffset, sdp->sd_name));
-
+		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
+		    R_AMD64_TPOFF32, arsp));
 		arsp->rel_rtype = R_AMD64_TPOFF32;
 		arsp->rel_raddend = 0;
 
 		/*
-		 * Addjust 'offset' to beginning of instruction
-		 * sequence.
+		 * Adjust 'offset' to beginning of instruction sequence.
 		 */
 		offset -= 12;
 
 		/*
-		 * Same code sequence used in the GD -> LE
-		 * transition.
+		 * Same code sequence used in the GD -> LE transition.
 		 */
 		(void) memcpy(offset, tlsinstr_gd_le, sizeof (tlsinstr_gd_le));
 		return (FIX_RELOC);
@@ -582,8 +575,8 @@
 		 *	0x02 .byte 0x66
 		 *	0x03 movq %fs:0, %rax
 		 */
-		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH, rtype,
-		    R_AMD64_NONE, arsp->rel_roffset, sdp->sd_name));
+		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
+		    R_AMD64_NONE, arsp));
 		offset -= 3;
 		(void) memcpy(offset, tlsinstr_ld_le, sizeof (tlsinstr_ld_le));
 		return (FIX_DONE);
@@ -597,8 +590,8 @@
 		 * To:
 		 *	0x00 leaq x1@tpoff(%rax), %rcx
 		 */
-		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH, rtype,
-		    R_AMD64_TPOFF32, arsp->rel_roffset, sdp->sd_name));
+		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
+		    R_AMD64_TPOFF32, arsp));
 		arsp->rel_rtype = R_AMD64_TPOFF32;
 		arsp->rel_raddend = 0;
 		return (FIX_RELOC);
--- a/usr/src/cmd/sgs/libld/common/machrel.intel.c	Wed Dec 20 21:31:33 2006 -0800
+++ b/usr/src/cmd/sgs/libld/common/machrel.intel.c	Wed Dec 20 21:51:02 2006 -0800
@@ -382,13 +382,12 @@
 			 *	0x6 addl x@gotntpoff(r1), %eax
 			 */
 			DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
-			    rtype, R_386_TLS_GOTIE, arsp->rel_roffset,
-			    sdp->sd_name));
+			    R_386_TLS_GOTIE, arsp));
 			arsp->rel_rtype = R_386_TLS_GOTIE;
 			arsp->rel_roffset += 5;
 
 			/*
-			 * Addjust 'offset' to beginning of instruction
+			 * Adjust 'offset' to beginning of instruction
 			 * sequence.
 			 */
 			offset -= 3;
@@ -408,8 +407,7 @@
 			 * Fixup done via the TLS_GD relocation
 			 */
 			DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
-			    rtype, R_386_NONE, arsp->rel_roffset,
-			    sdp->sd_name));
+			    R_386_NONE, arsp));
 			return (FIX_DONE);
 		}
 	}
@@ -431,13 +429,13 @@
 		 *	0xc
 		 */
 		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
-		    rtype, R_386_TLS_LE, arsp->rel_roffset, sdp->sd_name));
+		    R_386_TLS_LE, arsp));
 
 		arsp->rel_rtype = R_386_TLS_LE;
 		arsp->rel_roffset += 4;
 
 		/*
-		 * Addjust 'offset' to beginning of instruction
+		 * Adjust 'offset' to beginning of instruction
 		 * sequence.
 		 */
 		offset -= 3;
@@ -451,12 +449,12 @@
 		 * Fixup done via the TLS_GD relocation
 		 */
 		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
-		    rtype, R_386_NONE, arsp->rel_roffset, sdp->sd_name));
+		    R_386_NONE, arsp));
 		return (FIX_DONE);
 
 	case R_386_TLS_LDM_PLT:
 		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
-		    rtype, R_386_NONE, arsp->rel_roffset, sdp->sd_name));
+		    R_386_NONE, arsp));
 
 		/*
 		 * Transition:
@@ -477,7 +475,7 @@
 
 	case R_386_TLS_LDM:
 		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
-		    rtype, R_386_NONE, arsp->rel_roffset, sdp->sd_name));
+		    R_386_NONE, arsp));
 
 		/*
 		 * Transition:
@@ -505,7 +503,7 @@
 		offset -= 2;
 
 		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
-		    rtype, R_386_TLS_LE, arsp->rel_roffset, sdp->sd_name));
+		    R_386_TLS_LE, arsp));
 		arsp->rel_rtype = R_386_TLS_LE;
 		return (FIX_RELOC);
 
@@ -535,7 +533,7 @@
 		 * Note: reg1 != 4 (%esp)
 		 */
 		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
-		    rtype, R_386_TLS_LE, arsp->rel_roffset, sdp->sd_name));
+		    R_386_TLS_LE, arsp));
 		arsp->rel_rtype = R_386_TLS_LE;
 
 		offset -= 2;
--- a/usr/src/cmd/sgs/libld/common/machrel.sparc.c	Wed Dec 20 21:31:33 2006 -0800
+++ b/usr/src/cmd/sgs/libld/common/machrel.sparc.c	Wed Dec 20 21:51:02 2006 -0800
@@ -753,30 +753,26 @@
 		switch (rtype) {
 		case R_SPARC_TLS_GD_HI22:
 			DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
-			    rtype, R_SPARC_TLS_IE_HI22, arsp->rel_roffset,
-			    sdp->sd_name));
+			    R_SPARC_TLS_IE_HI22, arsp));
 			arsp->rel_rtype = R_SPARC_TLS_IE_HI22;
 			return (FIX_RELOC);
 
 		case R_SPARC_TLS_GD_LO10:
 			DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
-			    rtype, R_SPARC_TLS_IE_LO10, arsp->rel_roffset,
-			    sdp->sd_name));
+			    R_SPARC_TLS_IE_LO10, arsp));
 			arsp->rel_rtype = R_SPARC_TLS_IE_LO10;
 			return (FIX_RELOC);
 
 		case R_SPARC_TLS_GD_ADD:
 			DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
-			    rtype, R_SPARC_NONE, arsp->rel_roffset,
-			    sdp->sd_name));
+			    R_SPARC_NONE, arsp));
 			*offset = (TLS_GD_IE_LD |
 			    (*offset & (FM3_REG_MSK_RS1 | FM3_REG_MSK_RS2)));
 			return (FIX_DONE);
 
 		case R_SPARC_TLS_GD_CALL:
 			DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
-			    rtype, R_SPARC_NONE, arsp->rel_roffset,
-			    sdp->sd_name));
+			    R_SPARC_NONE, arsp));
 			*offset = TLS_GD_IE_ADD;
 			return (FIX_DONE);
 		}
@@ -790,14 +786,14 @@
 	case R_SPARC_TLS_IE_HI22:
 	case R_SPARC_TLS_GD_HI22:
 	case R_SPARC_TLS_LDO_HIX22:
-		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH, rtype,
-		    R_SPARC_TLS_LE_HIX22, arsp->rel_roffset, sdp->sd_name));
+		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
+		    R_SPARC_TLS_LE_HIX22, arsp));
 		arsp->rel_rtype = R_SPARC_TLS_LE_HIX22;
 		return (FIX_RELOC);
 
 	case R_SPARC_TLS_LDO_LOX10:
-		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH, rtype,
-		    R_SPARC_TLS_LE_LOX10, arsp->rel_roffset, sdp->sd_name));
+		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
+		    R_SPARC_TLS_LE_LOX10, arsp));
 		arsp->rel_rtype = R_SPARC_TLS_LE_LOX10;
 		return (FIX_RELOC);
 
@@ -815,8 +811,8 @@
 		 *
 		 *	xor r1, %lox(x), r2
 		 */
-		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH, rtype,
-		    R_SPARC_TLS_LE_LOX10, arsp->rel_roffset, sdp->sd_name));
+		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
+		    R_SPARC_TLS_LE_LOX10, arsp));
 		*offset = TLS_GD_LE_XOR |
 		    (*offset & (FM3_REG_MSK_RS1 | FM3_REG_MSK_RD));
 		arsp->rel_rtype = R_SPARC_TLS_LE_LOX10;
@@ -832,8 +828,8 @@
 		 *
 		 *	mov	r2, r3   (or  %g0, r2, r3)
 		 */
-		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH, rtype,
-		    R_SPARC_NONE, arsp->rel_roffset, sdp->sd_name));
+		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
+		    R_SPARC_NONE, arsp));
 		*offset = ((*offset) & (FM3_REG_MSK_RS2 | FM3_REG_MSK_RD)) |
 		    TLS_IE_LE_OR;
 		return (FIX_DONE);
@@ -849,15 +845,15 @@
 		 *
 		 *	add %g7, r2, r3
 		 */
-		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH, rtype,
-		    R_SPARC_NONE, arsp->rel_roffset, sdp->sd_name));
+		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
+		    R_SPARC_NONE, arsp));
 		*offset = *offset & (~FM3_REG_MSK_RS1);
 		*offset = *offset | (REG_G7 << 14);
 		return (FIX_DONE);
 
 	case R_SPARC_TLS_LDM_CALL:
-		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH, rtype,
-		    R_SPARC_NONE, arsp->rel_roffset, sdp->sd_name));
+		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
+		    R_SPARC_NONE, arsp));
 		*offset = TLS_LD_LE_CLRO0;
 		return (FIX_DONE);
 
@@ -866,8 +862,8 @@
 	case R_SPARC_TLS_LDM_ADD:
 	case R_SPARC_TLS_IE_ADD:
 	case R_SPARC_TLS_GD_CALL:
-		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH, rtype,
-		    R_SPARC_NONE, arsp->rel_roffset, sdp->sd_name));
+		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
+		    R_SPARC_NONE, arsp));
 		*offset = M_NOP;
 		return (FIX_DONE);
 	}
@@ -879,21 +875,20 @@
 static Fixupret
 gotop_fixups(Ofl_desc *ofl, Rel_desc *arsp)
 {
-	Sym_desc	*sdp = arsp->rel_sym;
 	Word		rtype = arsp->rel_rtype;
 	uint_t		*offset;
 	const char	*ifl_name;
 
 	switch (rtype) {
 	case R_SPARC_GOTDATA_OP_HIX22:
-		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH, rtype,
-		    R_SPARC_GOTDATA_HIX22, arsp->rel_roffset, sdp->sd_name));
+		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
+		    R_SPARC_GOTDATA_HIX22, arsp));
 		arsp->rel_rtype = R_SPARC_GOTDATA_HIX22;
 		return (FIX_RELOC);
 
 	case R_SPARC_GOTDATA_OP_LOX10:
-		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH, rtype,
-		    R_SPARC_GOTDATA_LOX10, arsp->rel_roffset, sdp->sd_name));
+		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
+		    R_SPARC_GOTDATA_LOX10, arsp));
 		arsp->rel_rtype = R_SPARC_GOTDATA_LOX10;
 		return (FIX_RELOC);
 
@@ -906,8 +901,8 @@
 		 *
 		 *	add	r1, r2, r3
 		 */
-		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH, rtype,
-		    R_SPARC_NONE, arsp->rel_roffset, sdp->sd_name));
+		DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
+		    R_SPARC_NONE, arsp));
 		offset = (uint_t *)(uintptr_t)(arsp->rel_roffset +
 		    _elf_getxoff(arsp->rel_isdesc->is_indata) +
 		    (uintptr_t)arsp->rel_osdesc->os_outdata->d_buf);
@@ -1597,12 +1592,28 @@
 	return (ld_add_actrel(NULL, rsp, ofl));
 }
 
+/*
+ * Establish a relocation transition.  Note, at this point of input relocation
+ * processing, we have no idea of the relocation value that will be used in
+ * the eventual relocation calculation.  This value is only known after the
+ * initial image has been constructed.  Therefore, there is a small chance
+ * that a value can exceed the capabilities of the transitioned relocation.
+ * One example might be the offset from the GOT to a symbol.
+ *
+ * The only instance of this failure discovered so far has been via the use of
+ * ABS symbols to represent an external memory location.  This situation is
+ * rare, since ABS symbols aren't typically generated by the compilers.
+ * Therefore, our solution is to excluded ABS symbols from the transition
+ * relocation possibilities.  As an additional safeguard, if an inappropriate
+ * value is passed to the final relocation engine, a verification ("V")
+ * relocation should trigger a fatal error condition.
+ */
 uintptr_t
-ld_reloc_GOTOP(Boolean local, Rel_desc * rsp, Ofl_desc * ofl)
+ld_reloc_GOTOP(Boolean local, Rel_desc *rsp, Ofl_desc *ofl)
 {
 	Word	rtype = rsp->rel_rtype;
 
-	if (!local) {
+	if (!local || (rsp->rel_sym->sd_sym->st_shndx == SHN_ABS)) {
 		/*
 		 * When binding to a external symbol, no fixups are required
 		 * and the GOTDATA_OP relocation can be ignored.
@@ -1623,7 +1634,7 @@
 }
 
 uintptr_t
-ld_reloc_TLS(Boolean local, Rel_desc * rsp, Ofl_desc * ofl)
+ld_reloc_TLS(Boolean local, Rel_desc *rsp, Ofl_desc *ofl)
 {
 	Word		rtype = rsp->rel_rtype;
 	Sym_desc	*sdp = rsp->rel_sym;
--- a/usr/src/cmd/sgs/libld/common/relocate.c	Wed Dec 20 21:31:33 2006 -0800
+++ b/usr/src/cmd/sgs/libld/common/relocate.c	Wed Dec 20 21:51:02 2006 -0800
@@ -1218,7 +1218,7 @@
 	if (IS_TLS_INS(rtype))
 		return (reloc_TLS(local, reld, ofl));
 
-	if (IS_GOT_INS(rtype))
+	if (IS_GOT_OPINS(rtype))
 		return (ld_reloc_GOTOP(local, reld, ofl));
 
 	if (IS_GOT_RELATIVE(rtype))
--- a/usr/src/cmd/sgs/liblddbg/common/liblddbg.msg	Wed Dec 20 21:31:33 2006 -0800
+++ b/usr/src/cmd/sgs/liblddbg/common/liblddbg.msg	Wed Dec 20 21:51:02 2006 -0800
@@ -329,8 +329,8 @@
 @ MSG_REL_BADROFFSET	"<offset lies outside memory image; \
 			 relocation discarded>"
 
-@ MSG_REL_TRANS		"relocation transition: offset: %#llx old reloc: %s \
-			 new reloc: %s symbol `%s'"
+@ MSG_REL_TRANSITION	"relocation: %s: section=%s; input from file=%s; \
+			 offset=0x%llx; symbol=%s; transitioned to: %s"
 @ MSG_REL_DISCARDED	"relocation against discarded section=%s from file=%s; \
 			 relocation type=%s offset=0x%llx; relocation discarded"
 @ MSG_REL_COPY		"copy data from file=%s to file=%s: symbol `%s'%s"
--- a/usr/src/cmd/sgs/liblddbg/common/llib-llddbg	Wed Dec 20 21:31:33 2006 -0800
+++ b/usr/src/cmd/sgs/liblddbg/common/llib-llddbg	Wed Dec 20 21:51:02 2006 -0800
@@ -268,10 +268,8 @@
 void	Dbg64_reloc_proc(Lm_list *, Os_desc *, Is_desc *, Is_desc *);
 void	Dbg32_reloc_run(Rt_map *, uint_t, int, int);
 void	Dbg64_reloc_run(Rt_map *, uint_t, int, int);
-void	Dbg32_reloc_transition(Lm_list *, Elf32_Half, Elf32_Word, Elf32_Word,
-	    Elf32_Word, const char *);
-void	Dbg64_reloc_transition(Lm_list *, Elf64_Half, Elf64_Word, Elf64_Word,
-	    Elf64_Xword, const char *);
+void	Dbg32_reloc_transition(Lm_list *, Elf32_Half, Elf32_Word, Rel_desc *);
+void	Dbg64_reloc_transition(Lm_list *, Elf64_Half, Elf64_Word, Rel_desc *);
 
 void	Dbg32_sec_added(Lm_list *, Os_desc *, Sg_desc *);
 void	Dbg64_sec_added(Lm_list *, Os_desc *, Sg_desc *);
--- a/usr/src/cmd/sgs/liblddbg/common/mapfile-vers	Wed Dec 20 21:31:33 2006 -0800
+++ b/usr/src/cmd/sgs/liblddbg/common/mapfile-vers	Wed Dec 20 21:51:02 2006 -0800
@@ -38,7 +38,7 @@
 #	Policy for Shared Library Version Names and Interface Definitions
 
 
-SUNWprivate_4.54 {
+SUNWprivate_4.55 {
 	global:
 		dbg_desc = NODIRECT;	# interposed - ld.so.1(1)
 		dbg_print = NODIRECT;	# interposed - ld(1) and ld.so.1(1)
--- a/usr/src/cmd/sgs/liblddbg/common/relocate.c	Wed Dec 20 21:31:33 2006 -0800
+++ b/usr/src/cmd/sgs/liblddbg/common/relocate.c	Wed Dec 20 21:51:02 2006 -0800
@@ -233,27 +233,32 @@
 void
 Dbg_reloc_discard(Lm_list *lml, Half mach, Rel_desc *rsp)
 {
+	Is_desc	*isp;
+
 	if (DBG_NOTCLASS(DBG_C_RELOC))
 		return;
 	if (DBG_NOTDETAIL())
 		return;
 
-	dbg_print(lml, MSG_INTL(MSG_REL_DISCARDED),
-	    rsp->rel_isdesc->is_basename, rsp->rel_isdesc->is_file->ifl_name,
-	    conv_reloc_type(mach, rsp->rel_rtype, 0),
+	isp = rsp->rel_isdesc;
+	dbg_print(lml, MSG_INTL(MSG_REL_DISCARDED), isp->is_basename,
+	    isp->is_file->ifl_name, conv_reloc_type(mach, rsp->rel_rtype, 0),
 	    EC_OFF(rsp->rel_roffset));
 }
 
 void
-Dbg_reloc_transition(Lm_list *lml, Half mach, Word oldrtype, Word newrtype,
-    Xword off, const char *sym)
+Dbg_reloc_transition(Lm_list *lml, Half mach, Word rtype, Rel_desc *rsp)
 {
+	Is_desc	*isp;
+
 	if (DBG_NOTCLASS(DBG_C_RELOC))
 		return;
 
-	dbg_print(lml, MSG_INTL(MSG_REL_TRANS), EC_OFF(off),
-	    conv_reloc_type(mach, oldrtype, 0) + M_R_STR_LEN,
-	    conv_reloc_type(mach, newrtype, 0) + M_R_STR_LEN, sym);
+	isp = rsp->rel_isdesc;
+	dbg_print(lml, MSG_INTL(MSG_REL_TRANSITION),
+	    conv_reloc_type(mach, rsp->rel_rtype, 0), isp->is_basename,
+	    isp->is_file->ifl_name, EC_OFF(rsp->rel_roffset), rsp->rel_sname,
+	    conv_reloc_type(mach, rtype, 0));
 }
 
 void
--- a/usr/src/cmd/sgs/packages/common/SUNWonld-README	Wed Dec 20 21:31:33 2006 -0800
+++ b/usr/src/cmd/sgs/packages/common/SUNWonld-README	Wed Dec 20 21:51:02 2006 -0800
@@ -1150,3 +1150,4 @@
 6487284 ld.so.1: buffer overflow in doprf() function
 6496718 restricted visibility symbol references should trigger archive
 	extraction
+6501793 GOTOP relocation transition (optimization) fails with offsets > 2^32
--- a/usr/src/cmd/sgs/rtld/common/util.c	Wed Dec 20 21:31:33 2006 -0800
+++ b/usr/src/cmd/sgs/rtld/common/util.c	Wed Dec 20 21:51:02 2006 -0800
@@ -2446,7 +2446,7 @@
  * Define a local buffer size for building a numeric value - large enough to
  * hold a 64-bit value.
  */
-#define	NUM_SIZE	20
+#define	NUM_SIZE	22
 
 size_t
 doprf(const char *format, va_list args, Prfbuf *prf)
--- a/usr/src/uts/common/krtld/reloc.h	Wed Dec 20 21:31:33 2006 -0800
+++ b/usr/src/uts/common/krtld/reloc.h	Wed Dec 20 21:51:02 2006 -0800
@@ -113,7 +113,7 @@
 					(FLG_RE_GOTPC | FLG_RE_GOTADD))
 #define	IS_GOT_BASED(X)		((reloc_table[(X)].re_flags & \
 					FLG_RE_GOTREL) != 0)
-#define	IS_GOT_INS(X)		((reloc_table[(X)].re_flags & \
+#define	IS_GOT_OPINS(X)		((reloc_table[(X)].re_flags & \
 					FLG_RE_GOTOPINS) != 0)
 #define	IS_GOT_REQUIRED(X)	((reloc_table[(X)].re_flags & \
 					(FLG_RE_GOTADD | FLG_RE_GOTREL | \
--- a/usr/src/uts/sparc/krtld/doreloc.c	Wed Dec 20 21:31:33 2006 -0800
+++ b/usr/src/uts/sparc/krtld/doreloc.c	Wed Dec 20 21:51:02 2006 -0800
@@ -168,7 +168,8 @@
 /* R_SPARC_TLS_DTPOFF64 */  {0x0, FLG_RE_NOTREL, 8, 0, 0},
 /* R_SPARC_TLS_TPOFF32 */   {0x0, FLG_RE_NOTREL, 4, 0, 0},
 /* R_SPARC_TLS_TPOFF64 */   {0x0, FLG_RE_NOTREL, 8, 0, 0},
-/* R_SPARC_GOTDATA_HIX22 */	{0, FLG_RE_GOTREL, 4, 10, 22},
+/* R_SPARC_GOTDATA_HIX22 */	{0, FLG_RE_SIGN | FLG_RE_GOTREL |
+					FLG_RE_VERIFY, 4, 10, 22},
 /* R_SPARC_GOTDATA_LOX10 */	{ 0x3ff, FLG_RE_GOTREL | FLG_RE_SIGN, 4, 0, 13},
 /* R_SPARC_GOTDATA_OP_HIX22 */	{ 0x0, FLG_RE_GOTOPINS | FLG_RE_GOTADD,
 					4, 10, 22},
@@ -270,7 +271,7 @@
  * R_SPARC_TLS_DTPOFF64	    77	V-word64	@dtpoff(S + A)
  * R_SPARC_TLS_TPOFF32	    78	V-word32	@tpoff(S + A)
  * R_SPARC_TLS_TPOFF64	    79	V-word64	@tpoff(S + A)
- * R_SPARC_GOTDATA_HIX22    80	T-imm22		((S + A - GOT) >> 10) ^
+ * R_SPARC_GOTDATA_HIX22    80	V-imm22		((S + A - GOT) >> 10) ^
  *						  ((S + A - GOT) >> 31)
  * R_SPARC_GOTDATA_LOX10    81	T-simm13	((S + A - GOT) & 0x3ff) |
  *						  (((S + A - GOT) >> 31) &