Added -lgcc_pic to Makefile -- Why do we need this and NetBSD don't ??
Incorporated patch by Guido (inspired by Davidg) that fixes stack problem. May not be final fix but it works more than the current method.
This commit is contained in:
parent
bfa077712f
commit
bcd9d0cf11
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=742
@ -1,4 +1,4 @@
|
|||||||
# $Id: Makefile,v 1.3 1993/11/08 13:20:39 pk Exp $
|
# $Id: Makefile,v 1.3 1993/11/09 04:19:29 paul Exp $
|
||||||
|
|
||||||
PROG= ld.so
|
PROG= ld.so
|
||||||
SRCS= mdprologue.S rtld.c shlib.c etc.c md.c
|
SRCS= mdprologue.S rtld.c shlib.c etc.c md.c
|
||||||
@ -8,7 +8,7 @@ LDDIR?= $(.CURDIR)/..
|
|||||||
PICFLAG=-fpic
|
PICFLAG=-fpic
|
||||||
CFLAGS += -I$(LDDIR) -I$(.CURDIR) -I$(LDDIR)/$(MACHINE) -O $(PICFLAG) -DRTLD
|
CFLAGS += -I$(LDDIR) -I$(.CURDIR) -I$(LDDIR)/$(MACHINE) -O $(PICFLAG) -DRTLD
|
||||||
LDFLAGS = -Bshareable -Bsymbolic -assert nosymbolic
|
LDFLAGS = -Bshareable -Bsymbolic -assert nosymbolic
|
||||||
LIBS = -lc_pic
|
LIBS = -lc_pic -lgcc_pic
|
||||||
BINDIR= /usr/libexec
|
BINDIR= /usr/libexec
|
||||||
|
|
||||||
.PATH: $(LDDIR) $(LDDIR)/$(MACHINE)
|
.PATH: $(LDDIR) $(LDDIR)/$(MACHINE)
|
||||||
|
@ -27,9 +27,10 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: rtld.c,v 1.8 1993/11/08 13:20:40 pk Exp $
|
* $Id: rtld.c,v 1.2 1993/11/09 04:19:31 paul Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <machine/vmparam.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -888,11 +889,10 @@ int *usehints;
|
|||||||
|
|
||||||
if (ld_path != NULL) {
|
if (ld_path != NULL) {
|
||||||
/* Prefer paths from LD_LIBRARY_PATH */
|
/* Prefer paths from LD_LIBRARY_PATH */
|
||||||
while ((cp = strsep(&ld_path, ":")) != NULL) {
|
while ((cp = strtok(ld_path, ":")) != NULL) {
|
||||||
|
|
||||||
|
ld_path = NULL;
|
||||||
hint = findhint(name, major, minor, cp);
|
hint = findhint(name, major, minor, cp);
|
||||||
if (ld_path)
|
|
||||||
*(ld_path-1) = ':';
|
|
||||||
if (hint)
|
if (hint)
|
||||||
return hint;
|
return hint;
|
||||||
}
|
}
|
||||||
@ -951,18 +951,13 @@ init_brk()
|
|||||||
_exit(1);
|
_exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
if (environ < USRSTACK - MAXSSIZ) {
|
||||||
* Walk to the top of stack
|
curbrk = (caddr_t)
|
||||||
*/
|
(((long)(USRSTACK - MAXSSIZ - rlim.rlim_cur) + PAGSIZ) & ~(PAGSIZ - 1));
|
||||||
if (*cpp) {
|
} else {
|
||||||
while (*cpp) cpp++;
|
curbrk = (caddr_t)
|
||||||
cp = *--cpp;
|
(((long)(USRSTACK - rlim.rlim_cur) + PAGSIZ) & ~(PAGSIZ - 1)) ;
|
||||||
while (*cp) cp++;
|
}
|
||||||
} else
|
|
||||||
cp = (char *)&cp;
|
|
||||||
|
|
||||||
curbrk = (caddr_t)
|
|
||||||
(((long)(cp - 1 - rlim.rlim_cur) + PAGSIZ) & ~(PAGSIZ - 1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $Id: Makefile,v 1.3 1993/11/08 13:20:39 pk Exp $
|
# $Id: Makefile,v 1.3 1993/11/09 04:19:29 paul Exp $
|
||||||
|
|
||||||
PROG= ld.so
|
PROG= ld.so
|
||||||
SRCS= mdprologue.S rtld.c shlib.c etc.c md.c
|
SRCS= mdprologue.S rtld.c shlib.c etc.c md.c
|
||||||
@ -8,7 +8,7 @@ LDDIR?= $(.CURDIR)/..
|
|||||||
PICFLAG=-fpic
|
PICFLAG=-fpic
|
||||||
CFLAGS += -I$(LDDIR) -I$(.CURDIR) -I$(LDDIR)/$(MACHINE) -O $(PICFLAG) -DRTLD
|
CFLAGS += -I$(LDDIR) -I$(.CURDIR) -I$(LDDIR)/$(MACHINE) -O $(PICFLAG) -DRTLD
|
||||||
LDFLAGS = -Bshareable -Bsymbolic -assert nosymbolic
|
LDFLAGS = -Bshareable -Bsymbolic -assert nosymbolic
|
||||||
LIBS = -lc_pic
|
LIBS = -lc_pic -lgcc_pic
|
||||||
BINDIR= /usr/libexec
|
BINDIR= /usr/libexec
|
||||||
|
|
||||||
.PATH: $(LDDIR) $(LDDIR)/$(MACHINE)
|
.PATH: $(LDDIR) $(LDDIR)/$(MACHINE)
|
||||||
|
@ -27,9 +27,10 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: rtld.c,v 1.8 1993/11/08 13:20:40 pk Exp $
|
* $Id: rtld.c,v 1.2 1993/11/09 04:19:31 paul Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <machine/vmparam.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -888,11 +889,10 @@ int *usehints;
|
|||||||
|
|
||||||
if (ld_path != NULL) {
|
if (ld_path != NULL) {
|
||||||
/* Prefer paths from LD_LIBRARY_PATH */
|
/* Prefer paths from LD_LIBRARY_PATH */
|
||||||
while ((cp = strsep(&ld_path, ":")) != NULL) {
|
while ((cp = strtok(ld_path, ":")) != NULL) {
|
||||||
|
|
||||||
|
ld_path = NULL;
|
||||||
hint = findhint(name, major, minor, cp);
|
hint = findhint(name, major, minor, cp);
|
||||||
if (ld_path)
|
|
||||||
*(ld_path-1) = ':';
|
|
||||||
if (hint)
|
if (hint)
|
||||||
return hint;
|
return hint;
|
||||||
}
|
}
|
||||||
@ -951,18 +951,13 @@ init_brk()
|
|||||||
_exit(1);
|
_exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
if (environ < USRSTACK - MAXSSIZ) {
|
||||||
* Walk to the top of stack
|
curbrk = (caddr_t)
|
||||||
*/
|
(((long)(USRSTACK - MAXSSIZ - rlim.rlim_cur) + PAGSIZ) & ~(PAGSIZ - 1));
|
||||||
if (*cpp) {
|
} else {
|
||||||
while (*cpp) cpp++;
|
curbrk = (caddr_t)
|
||||||
cp = *--cpp;
|
(((long)(USRSTACK - rlim.rlim_cur) + PAGSIZ) & ~(PAGSIZ - 1)) ;
|
||||||
while (*cp) cp++;
|
}
|
||||||
} else
|
|
||||||
cp = (char *)&cp;
|
|
||||||
|
|
||||||
curbrk = (caddr_t)
|
|
||||||
(((long)(cp - 1 - rlim.rlim_cur) + PAGSIZ) & ~(PAGSIZ - 1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user