Received: from mailman by lists.gnu.org with archive (Exim 4.33) id 1C91JG-0003rA-LC for mharc-grub-devel@gnu.org; Sun, 19 Sep 2004 09:00:56 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C91JA-0003qu-Fu for grub-devel@gnu.org; Sun, 19 Sep 2004 09:00:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C91J7-0003qM-Cl for grub-devel@gnu.org; Sun, 19 Sep 2004 09:00:47 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C91J5-0003qI-Mb for grub-devel@gnu.org; Sun, 19 Sep 2004 09:00:44 -0400 Received: from [145.74.66.11] (helo=mail-cn.han.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C91Cu-0000h2-00 for grub-devel@gnu.org; Sun, 19 Sep 2004 08:54:20 -0400 Received: from localhost (charlie.han.nl [145.74.66.9]) by mail-cn.han.nl (Postfix) with ESMTP id A6E5F996A for ; Sun, 19 Sep 2004 14:32:30 +0200 (CEST) Received: from mail-cn.han.nl ([145.74.66.11]) by localhost (charlie.han.nl [145.74.66.9]) (amavisd-new, port 10024) with ESMTP id 22353-07 for ; Sun, 19 Sep 2004 14:32:29 +0200 (CEST) Received: from mail1.han.nl (mail1.han.nl [145.74.103.11]) by mail-cn.han.nl (Postfix) with ESMTP id ED6B692B3 for ; Sun, 19 Sep 2004 14:32:28 +0200 (CEST) Received: from marco.marco-g.com (mgerards.xs4all.nl [82.92.27.129]) by mail1.han.nl (Postfix) with ESMTP id B424AC045 for ; Sun, 19 Sep 2004 14:32:28 +0200 (CEST) Mail-Copies-To: metgerards@student.han.nl To: grub-devel@gnu.org From: Marco Gerards Date: Sun, 19 Sep 2004 12:32:33 +0000 Message-ID: <87vfeal9r2.fsf@marco.marco-g.com> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new@vscan-cn.han.nl Subject: Dynamic loader X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2004 13:00:50 -0000 Hi, As I mentioned earlier I am working on loadable module support for the PPC. I had a lot of problems with this so I decided to play a bit with grub-emu to see what is going on. At the moment this is still a big hack (and a few minutes work), if Thomas does not mind I will make it work properly. I found a big problem in kern/dl.c. Two pointers are added and GRUB is writing outside memory reserved for it, if I understand it correctly. I really hope Okuji can have a look at this and tell me what is going on. I am not familiar with this code and I am afraid it can take a while to understand what is going on for me. In `grub_dl_resolve_symbols' the following things are done: In the case STT_FUNC the `sym->st_value' has a valid pointer. After that the following thing happens: sym->st_value += (Elf_Addr) grub_dl_get_section_addr (mod, sym->st_shndx); Another (valid) pointer gets added. This results in an invalid pointer which is used afterwards. I think this happens consistently and that is why nothing seems wrong when using GRUB. In grub-emu this simply means a segfault. This segfault happens when `mod->init' is called, which points to a non-executable region of memory. When I reserve a lot (100 MB is what I used) of memory using mmap and make sure it is executable it works because the memory that was accidently used was allocated. Any kind of help is appreciated. Thanks, Marco