Skip to contentSkip to conversation

-pie is broken on hppa

parisc-linux John David Anglin 3 participants 5 messages Jun 4, 2007 – Jul 6, 2007 4 messages not in the archive PA-RISC architecture

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 2 lines

I don't suppose you could strace in a chroot with a older working glibc and see what syscalls are there?

Probably, I won't have time until next weekend.

Dave

Signature · 6 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#3 lore raw
In reply to a message not in the archive
Quoted 5 lines · John David Anglin
Quoted 2 lines

I don't suppose you could strace in a chroot with a older working glibc and see what syscalls are there?

Probably, I won't have time until next weekend.

Could you try this patch?

Thanks,
Kyle M.

Quoted 1 line
Quoted 1 line
Quoted 1 line

From 0deea67e075b5152d427426583500b8d9cf0a56c Mon Sep 17 00:00:00 2001

From: Kyle McMartin <[email protected]>
Date: Fri, 29 Jun 2007 03:38:10 -0400
Subject: [PARISC] Use compat_sys_getdents

Switch to using the generic compat_sys_getdents instead of a homebrew one.

---
 arch/parisc/kernel/sys_parisc32.c  |  141 ------------------------------------
 arch/parisc/kernel/syscall_table.S |    4 +-
 2 files changed, 1 insertions(+), 144 deletions(-)
arch/parisc/kernel/sys_parisc32.c +0 -140
index bb23ff7..2989c66 100644
@@ -285,147 +285,6 @@ int cp_compat_stat(struct kstat *stat, struct compat_stat __user *statbuf)
 	return err;
 }
 
-struct linux32_dirent {
-	u32		d_ino;
-	compat_off_t	d_off;
-	u16		d_reclen;
-	char		d_name[1];
-};
-
-struct old_linux32_dirent {
-	u32	d_ino;
-	u32	d_offset;
-	u16	d_namlen;
-	char	d_name[1];
-};
-
-struct getdents32_callback {
-	struct linux32_dirent __user * current_dir;
-	struct linux32_dirent __user * previous;
-	int count;
-	int error;
-};
-
-struct readdir32_callback {
-	struct old_linux32_dirent __user * dirent;
-	int count;
-};
-
-#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
-static int filldir32 (void *__buf, const char *name, int namlen,
-			loff_t offset, u64 ino, unsigned int d_type)
-{
-	struct linux32_dirent __user * dirent;
-	struct getdents32_callback * buf = (struct getdents32_callback *) __buf;
-	int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, 4);
-	u32 d_ino;
-
-	buf->error = -EINVAL;	/* only used if we fail.. */
-	if (reclen > buf->count)
-		return -EINVAL;
-	d_ino = ino;
-	if (sizeof(d_ino) < sizeof(ino) && d_ino != ino)
-		return -EOVERFLOW;
-	dirent = buf->previous;
-	if (dirent)
-		put_user(offset, &dirent->d_off);
-	dirent = buf->current_dir;
-	buf->previous = dirent;
-	put_user(d_ino, &dirent->d_ino);
-	put_user(reclen, &dirent->d_reclen);
-	copy_to_user(dirent->d_name, name, namlen);
-	put_user(0, dirent->d_name + namlen);
-	dirent = ((void __user *)dirent) + reclen;
-	buf->current_dir = dirent;
-	buf->count -= reclen;
-	return 0;
-}
-
-asmlinkage long
-sys32_getdents (unsigned int fd, void __user * dirent, unsigned int count)
-{
-	struct file * file;
-	struct linux32_dirent __user * lastdirent;
-	struct getdents32_callback buf;
-	int error;
-
-	error = -EFAULT;
-	if (!access_ok(VERIFY_WRITE, dirent, count))
-		goto out;
-
-	error = -EBADF;
-	file = fget(fd);
-	if (!file)
-		goto out;
-
-	buf.current_dir = (struct linux32_dirent __user *) dirent;
-	buf.previous = NULL;
-	buf.count = count;
-	buf.error = 0;
-
-	error = vfs_readdir(file, filldir32, &buf);
-	if (error < 0)
-		goto out_putf;
-	error = buf.error;
-	lastdirent = buf.previous;
-	if (lastdirent) {
-		if (put_user(file->f_pos, &lastdirent->d_off))
-			error = -EFAULT;
-		else
-			error = count - buf.count;
-	}
-
-out_putf:
-	fput(file);
-out:
-	return error;
-}
-
-static int fillonedir32(void * __buf, const char * name, int namlen,
-			loff_t offset, u64 ino, unsigned int d_type)
-{
-	struct readdir32_callback * buf = (struct readdir32_callback *) __buf;
-	struct old_linux32_dirent __user * dirent;
-	u32 d_ino;
-
-	if (buf->count)
-		return -EINVAL;
-	d_ino = ino;
-	if (sizeof(d_ino) < sizeof(ino) && d_ino != ino)
-		return -EOVERFLOW;
-	buf->count++;
-	dirent = buf->dirent;
-	put_user(d_ino, &dirent->d_ino);
-	put_user(offset, &dirent->d_offset);
-	put_user(namlen, &dirent->d_namlen);
-	copy_to_user(dirent->d_name, name, namlen);
-	put_user(0, dirent->d_name + namlen);
-	return 0;
-}
-
-asmlinkage long
-sys32_readdir (unsigned int fd, void __user * dirent, unsigned int count)
-{
-	int error;
-	struct file * file;
-	struct readdir32_callback buf;
-
-	error = -EBADF;
-	file = fget(fd);
-	if (!file)
-		goto out;
-
-	buf.count = 0;
-	buf.dirent = dirent;
-
-	error = vfs_readdir(file, fillonedir32, &buf);
-	if (error >= 0)
-		error = buf.count;
-	fput(file);
-out:
-	return error;
-}
#5 lore raw
In reply to a message not in the archive
Quoted 1 line

Could you try this patch?

I installed it last night. svn works, gcc bootstraps and I haven't seen any other problems. There was a problem building libjava with the getdents bug.

Review

Quoted 2 lines
(quoted diff) +0 -2
-	/* struct linux_dirent has longs, like 'unsigned long d_ino' which
-	 * almost definitely should be 'ino_t d_ino' but it's too late now */

This is my only concern.

Dave

Signature · 6 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#7 lore raw
In reply to a message not in the archive
Quoted 6 lines · John David Anglin
Quoted 1 line

Could you try this patch?

I installed it last night. svn works, gcc bootstraps and I haven't seen any other problems. There was a problem building libjava with the getdents bug.

OK. I'll try to build a HEAD kernel and boot with an old glibc to see if it fucks up. Is there a really easy testcase I can try to reproduce this?

Quoted 5 lines

Review

Quoted 2 lines
(quoted diff) +0 -2
-	/* struct linux_dirent has longs, like 'unsigned long d_ino' which
-	 * almost definitely should be 'ino_t d_ino' but it's too late now */

This is my only concern.

It should be fine, since all other compat arches have the same problem.
_______________________________________________
parisc-linux mailing list [email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#8 lore raw
In reply to a message not in the archive
Quoted 8 lines · Kyle McMartin
Quoted 5 lines · John David Anglin
Quoted 2 lines

I don't suppose you could strace in a chroot with a older working glibc and see what syscalls are there?

Probably, I won't have time until next weekend.

Could you try this patch?

I tried it to see if it would fix the strangeness in the glibc testsuite where three tests can't find files, but if run a couple seconds later finds them fine. It doesn't fix this, but it also doesn't cause any further regressions.

Signature · 5 lines
Jeff Bailey - http://www.raspberryginger.com/jbailey/
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux