lkml.org 
[lkml]   [2003]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: out of place comment fs/binfmt_elf.c:365
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.030 / U:1.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site