lkml.org 
[lkml]   [1999]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] 2.3.17 -- shut up binfmt_aout, and put back old flocking
Date

This little patch does two things.

1) It makes binfmt_aout shut up about non-pagealigned libraries and
executables (an a.out library (libc 4.8.0) built last month with gcc
2.7.2.3 and binutils 2.9.1 makes binfmt_aout scream) and gives me
back about 10k of syslog when the system boots up.

2) It puts back the old mappings of F_SHLCK -> F_RDLCK and F_EXLCK -> F_WRLCK
so that old binaries (statically linked a.out and dynamically linked
a.out against libraries older than libc 4.8.0) won't fail when they
try to make rdlocks and wrlocks.

The first part has a negative space impact, and the second has a small
positive space impact, but that's compensated for by keeping an binary
interface compatable.

This patch goes cleanly into 2.3.13, 2.3.14, 2.3.15, 2.3.16, and 2.3.17pre1,
so ignore the 2.3.13 behind the curtain.

Is there any chance they could go into 2.3.18, and cut down my carnival
of patches that I need to apply to the development kernels so I can use
them on Mastodon?

____
david parsons \bi/ <Insert blatant grovelling here>
\/


diff -Naur linux-2.3.13-orig/fs/binfmt_aout.c linux-2.3.13/fs/binfmt_aout.c
--- linux-2.3.13-orig/fs/binfmt_aout.c Tue Aug 3 10:18:39 1999
+++ linux-2.3.13/fs/binfmt_aout.c Sun Aug 15 00:50:50 1999
@@ -355,21 +355,25 @@
flush_icache_range((unsigned long) 0,
(unsigned long) ex.a_text+ex.a_data);
} else {
+#if 0
if ((ex.a_text & 0xfff || ex.a_data & 0xfff) &&
(N_MAGIC(ex) != NMAGIC))
printk(KERN_NOTICE "executable not page aligned\n");
+#endif

fd = open_dentry(bprm->dentry, O_RDONLY);
if (fd < 0)
return fd;
file = fget(fd);

+#if 0
if ((fd_offset & ~PAGE_MASK) != 0) {
printk(KERN_WARNING
"fd_offset is not page aligned. Please convert program: %s\n",
file->f_dentry->d_name.name
);
}
+#endif

if (!file->f_op || !file->f_op->mmap || ((fd_offset & ~PAGE_MASK) != 0)) {
fput(file);
@@ -499,10 +503,12 @@
start_addr = ex.a_entry & 0xfffff000;

if ((N_TXTOFF(ex) & ~PAGE_MASK) != 0) {
+#if 0
printk(KERN_WARNING
"N_TXTOFF is not page aligned. Please convert library: %s\n",
file->f_dentry->d_name.name
);
+#endif

do_mmap(NULL, start_addr & PAGE_MASK, ex.a_text + ex.a_data + ex.a_bss,
PROT_READ | PROT_WRITE | PROT_EXEC,
diff -Naur linux-2.3.13-orig/fs/locks.c linux-2.3.13/fs/locks.c
--- linux-2.3.13-orig/fs/locks.c Mon Jul 5 20:11:07 1999
+++ linux-2.3.13/fs/locks.c Sun Aug 15 00:50:50 1999
@@ -448,10 +448,10 @@
current->pid, current->comm);
}
}
+#endif
if (!(filp->f_mode & 3))
goto out_putf;
break;
-#endif
default:
error = -EINVAL;
goto out_putf;
@@ -648,11 +648,20 @@
init_waitqueue_head(&fl->fl_wait);
fl->fl_flags = FL_POSIX;

+ /*
+ * remap old-style locks into the locking method de jour
+ */
switch (l->l_type) {
case F_RDLCK:
case F_WRLCK:
case F_UNLCK:
fl->fl_type = l->l_type;
+ break;
+ case F_SHLCK :
+ fl->fl_type = F_RDLCK;
+ break;
+ case F_EXLCK :
+ fl->fl_type = F_WRLCK;
break;
default:
return (0);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.064 / U:1.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site