public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* out of place comment fs/binfmt_elf.c:365
@ 2003-01-20  0:53 Dave Airlie
  2003-01-20 13:13 ` William Lee Irwin III
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Airlie @ 2003-01-20  0:53 UTC (permalink / raw)
  To: linux-kernel


in fs/binfmt_elf.c around line 365 in 2.5 and same sorta place in 2.4 is a
comment like so...

/* Now use mmap to map the library into memory. */

but the code proceeds to do no such thing.. it has done it already....

the next lines are another comment stating now fill out the bss..

Dave.

-- 
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / airlied@skynet.ie
pam_smb / Linux DecStation / Linux VAX / ILUG person



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: out of place comment fs/binfmt_elf.c:365
  2003-01-20  0:53 out of place comment fs/binfmt_elf.c:365 Dave Airlie
@ 2003-01-20 13:13 ` William Lee Irwin III
  0 siblings, 0 replies; 2+ messages in thread
From: William Lee Irwin III @ 2003-01-20 13:13 UTC (permalink / raw)
  To: Dave Airlie; +Cc: linux-kernel

On Mon, Jan 20, 2003 at 12:53:19AM +0000, Dave Airlie wrote:
> in fs/binfmt_elf.c around line 365 in 2.5 and same sorta place in 2.4 is a
> comment like so...
> /* Now use mmap to map the library into memory. */
> but the code proceeds to do no such thing.. it has done it already....
> the next lines are another comment stating now fill out the bss..
> Dave.

It looks like code got shuffled around into elf_map() and no one
bothered moving the comment alongside the corresponding code. And
it's actually mapping the interpreter. There's a second comment
which is actually accurate there; I suspect the interpreter mapping
code was copied from the library mapping code without resynching the
comment either.

-- wli


Realign ancient comment with modern source, including adjusting the
name of the function said to be used to map things.

 binfmt_elf.c |    3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)


diff -urpN mpc-2.5.59-2/fs/binfmt_elf.c elf-2.5.59-1/fs/binfmt_elf.c
--- mpc-2.5.59-2/fs/binfmt_elf.c	2003-01-16 18:22:06.000000000 -0800
+++ elf-2.5.59-1/fs/binfmt_elf.c	2003-01-20 05:11:16.000000000 -0800
@@ -335,6 +335,7 @@ static unsigned long load_elf_interp(str
 	    if (interp_elf_ex->e_type == ET_EXEC || load_addr_set)
 	    	elf_type |= MAP_FIXED;
 
+	    /* Now use elf_map() to map the interpreter into memory. */
 	    map_addr = elf_map(interpreter, load_addr + vaddr, eppnt, elf_prot, elf_type);
 	    if (BAD_ADDR(map_addr))
 	    	goto out_close;
@@ -362,8 +363,6 @@ static unsigned long load_elf_interp(str
 	  }
 	}
 
-	/* Now use mmap to map the library into memory. */
-
 	/*
 	 * Now fill out the bss section.  First pad the last page up
 	 * to the page boundary, and then perform a mmap to make sure

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-01-20 13:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-20  0:53 out of place comment fs/binfmt_elf.c:365 Dave Airlie
2003-01-20 13:13 ` William Lee Irwin III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox