Re: out of place comment fs/binfmt_elf.c:365

From: William Lee Irwin III (wli@holomorphy.com)
Date: Mon Jan 20 2003 - 08:13:12 EST


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/



This archive was generated by hypermail 2b29 : Thu Jan 23 2003 - 22:00:23 EST