This is the mail archive of the libc-alpha@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: glibc-2.0.99 & linux 2.1.125/2.1.126



On Sun, 25 Oct 1998, John Kennedy wrote:

>   Tom Rini pointed out that ftp.yggdrasil.org also has the patch, so
> maybe I'll grab the patch there and reverse the binfmt_elf.c version.
> This list is a little slow (human moderated?), so it is possible that
> there is a success story in the wings.
> 								--- john

I've just reverted the changes from 2.1.125 to 2.1.126 in binfmt_elf.c and
it works for me.

I did not revert the corefile and arch-specific stuff. The patch is
attached to this mail.

I don't know this part of the kernel very well - so I don't understand
what I did. I've just reverted the changes from 2.1.125 to 2.1.126. So
don't see this as a permanent bugfix just becouse the problem disapares!
It's ok as a quick-and-dirty fix - but is primary ment to help others to
debug the problem.

Keep hacking,

  -- clifford

--    --    --    --    --    --    --    --    --    --    --    --    --
Clifford Wolf (CEO and CTO)
The ROCK Projects Workgoup                          IRC: IRCnet / clifford
http://www.rock-projects.com/                      http://www.clifford.at/
e-mail: c.wolf@rock-projects.com                    email: god@clifford.at
diff -ruN linux/fs/binfmt_elf.c linux-2.1.126/fs/binfmt_elf.c
--- linux/fs/binfmt_elf.c	Sun Oct  4 19:22:44 1998
+++ linux/fs/binfmt_elf.c	Wed Oct 21 19:02:48 1998
@@ -273,9 +273,9 @@
 	    if (eppnt->p_flags & PF_R) elf_prot =  PROT_READ;
 	    if (eppnt->p_flags & PF_W) elf_prot |= PROT_WRITE;
 	    if (eppnt->p_flags & PF_X) elf_prot |= PROT_EXEC;
-	    vaddr = eppnt->p_vaddr;
 	    if (interp_elf_ex->e_type == ET_EXEC || load_addr_set) {
 	    	elf_type |= MAP_FIXED;
+	    	vaddr = eppnt->p_vaddr;
 #ifdef __sparc__
 	    } else {
 		load_addr = get_unmapped_area(0, eppnt->p_filesz +
@@ -293,7 +293,7 @@
 		goto out_close;
 
 	    if (!load_addr_set && interp_elf_ex->e_type == ET_DYN) {
+		load_addr = map_addr;
-		load_addr = map_addr - ELF_PAGESTART(vaddr);
 		load_addr_set = 1;
 	    }
 
@@ -613,7 +620,7 @@
 	for(i = 0, elf_ppnt = elf_phdata; i < elf_ex.e_phnum; i++, elf_ppnt++) {
 		if (elf_ppnt->p_type == PT_LOAD) {
 			int elf_prot = 0, elf_flags;
+			unsigned long vaddr = 0;
-			unsigned long vaddr;
 
 			if (elf_ppnt->p_flags & PF_R) elf_prot |= PROT_READ;
 			if (elf_ppnt->p_flags & PF_W) elf_prot |= PROT_WRITE;
@@ -621,8 +628,8 @@
 
 			elf_flags = MAP_PRIVATE|MAP_DENYWRITE|MAP_EXECUTABLE;
 
-			vaddr = elf_ppnt->p_vaddr;
 			if (elf_ex.e_type == ET_EXEC || load_addr_set) {
+				vaddr = elf_ppnt->p_vaddr;
 				elf_flags |= MAP_FIXED;
 			}
 
@@ -639,7 +646,7 @@
 				load_addr = (elf_ppnt->p_vaddr -
 					     elf_ppnt->p_offset);
 				if (elf_ex.e_type == ET_DYN) {
+					load_bias = error;
-					load_bias = error - ELF_PAGESTART(load_bias + vaddr);
 					load_addr += error;
 				}
 			}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]