Index: b/usr/src/cmd/sgs/lddstub/Makefile.targ =================================================================== --- a/usr/src/cmd/sgs/lddstub/Makefile.targ +++ b/usr/src/cmd/sgs/lddstub/Makefile.targ @@ -30,10 +30,16 @@ all: $(PROG) +%.o: %.s + $(COMPILE.s) $< -o $@ + + $(PROG): $(OBJS) $(LD) -o $@ $(LDFLAGS) $(OBJS) $(POST_PROCESS) +CLEANFILES += $(PROG) + clean: $(RM) $(OBJS) $(CLEANFILES) Index: b/usr/src/cmd/sgs/lddstub/Makefile.com =================================================================== --- a/usr/src/cmd/sgs/lddstub/Makefile.com +++ b/usr/src/cmd/sgs/lddstub/Makefile.com @@ -35,8 +35,6 @@ include ../../Makefile.com # As of Solaris 9 the kernel accepts $ORIGIN within the interpreter field. -INTERP= $(VAR_LDDSTUB_INTERP) - ASFLAGS= -P -D_ASM LDFLAGS= $(VERSREF) $(INTERP) $(CONVLIBDIR) -lconv -e stub \ $(LDFLAGS.cmd) Index: b/usr/src/cmd/sgs/lddstub/amd64/Makefile =================================================================== --- a/usr/src/cmd/sgs/lddstub/amd64/Makefile +++ b/usr/src/cmd/sgs/lddstub/amd64/Makefile @@ -34,7 +34,9 @@ CONVLIBDIR= $(CONVLIBDIR64) ASFLAGS += -D__amd64 $(amd64_AS_XARCH) -install: all $(ROOTLIB64)/$(PROG) +install: all .WAIT $(ROOT)/$(DEB_USRLIBDIR_64)/$(PROG) +$(ROOT)/$(DEB_USRLIBDIR_64)/$(PROG): $(PROG) + $(INS.file) include ../Makefile.targ include ../../Makefile.sub.64 Index: b/usr/src/cmd/sgs/lddstub/i386/Makefile =================================================================== --- a/usr/src/cmd/sgs/lddstub/i386/Makefile +++ b/usr/src/cmd/sgs/lddstub/i386/Makefile @@ -29,6 +29,9 @@ include ../Makefile.com .KEEP_STATE: -install: $(ROOTLIBPROG) +install: all .WAIT $(ROOT)/$(DEB_USRLIBDIR_32)/$(PROG) +$(ROOT)/$(DEB_USRLIBDIR_32)/$(PROG): $(PROG) + $(INS.file) + include ../Makefile.targ Index: b/usr/src/cmd/sgs/libconv/common/lddstub.c =================================================================== --- a/usr/src/cmd/sgs/libconv/common/lddstub.c +++ b/usr/src/cmd/sgs/libconv/common/lddstub.c @@ -31,27 +31,6 @@ #include "_conv.h" #include "lddstub_msg.h" -static int -originlddstub(char *buffer, const char *orgfile) -{ - int len; - - if (dlinfo(RTLD_SELF, RTLD_DI_ORIGIN, (void *)buffer) == -1) - return (-1); - if (strlcat(buffer, orgfile, PATH_MAX) >= PATH_MAX) - return (-1); - if ((len = resolvepath(buffer, buffer, (PATH_MAX - 1))) == -1) - return (-1); - buffer[len] = '\0'; - if (access(buffer, X_OK) == -1) - return (-1); - - return (1); -} - -static char orgstub[PATH_MAX], orgstub64[PATH_MAX]; -static int orgflag, orgflag64; - /* * Determine what lddstub to run. */ @@ -60,47 +39,10 @@ conv_lddstub(int class) { const char *stub; - /* - * Establish defaults. - */ if (class == ELFCLASS32) - stub = MSG_ORIG(MSG_PTH_LDDSTUB); + stub = DEB_USRLIBDIR_32 "/lddstub"; else - stub = MSG_ORIG(MSG_PTH_LDDSTUB_64); + stub = DEB_USRLIBDIR_64 "/lddstub"; - /* - * Provided we're not secure, determine lddstub's location from our - * own origin. - */ - if (geteuid()) { - if ((class == ELFCLASS32) && (orgflag != -1)) { - if (orgflag == 0) { - /* BEGIN CSTYLED */ - if ((orgflag = originlddstub(orgstub, -#ifdef _LP64 - MSG_ORIG(MSG_ORG_64LDD_32STUB))) == -1) -#else - MSG_ORIG(MSG_ORG_32LDD_32STUB))) == -1) -#endif - return (stub); - /* END CSTYLED */ - } - stub = (const char *)orgstub; - } - if ((class == ELFCLASS64) && (orgflag64 != -1)) { - if (orgflag64 == 0) { - /* BEGIN CSTYLED */ - if ((orgflag64 = originlddstub(orgstub64, -#ifdef _LP64 - MSG_ORIG(MSG_ORG_64LDD_64STUB))) == -1) -#else - MSG_ORIG(MSG_ORG_32LDD_64STUB))) == -1) -#endif - return (stub); - /* END CSTYLED */ - } - stub = (const char *)orgstub64; - } - } return (stub); } Index: b/usr/src/cmd/sgs/libconv/Makefile.com =================================================================== --- a/usr/src/cmd/sgs/libconv/Makefile.com +++ b/usr/src/cmd/sgs/libconv/Makefile.com @@ -100,6 +100,10 @@ PICS= $(OBJECTS:%=pics/%) CPPFLAGS += -I$(SRCBASE)/lib/libc/inc -I$(ELFCAP) \ -I$(SRC)/common/sgsrtcid +CPPFLAGS += \ + -DDEB_USRLIBDIR_32=\"$(DEB_USRLIBDIR_32)\" \ + -DDEB_USRLIBDIR_64=\"$(DEB_USRLIBDIR_64)\" \ + ARFLAGS= cr AS_CPPFLAGS= -P -D_ASM $(CPPFLAGS)