From owner-freebsd-mips@FreeBSD.ORG Mon Apr 11 09:42:08 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE95A106564A; Mon, 11 Apr 2011 09:42:08 +0000 (UTC) (envelope-from ray@dlink.ua) Received: from dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id E14308FC13; Mon, 11 Apr 2011 09:42:07 +0000 (UTC) Received: from gw-lan1.kiev.dlink.ua ([192.168.10.10] helo=terran.dlink.ua) by dlink.ua with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Q9DdE-0004je-2Y; Mon, 11 Apr 2011 12:42:04 +0300 Date: Mon, 11 Apr 2011 12:41:59 +0300 From: Aleksandr Rybalko To: Milan Obuch Message-Id: <20110411124159.8b93df20.ray@dlink.ua> In-Reply-To: <20110409142931.3d1884a9@atom.dino.sk> References: <20110331101554.68171eed@atom.dino.sk> <20110331142640.07f2101b@atom.dino.sk> <20110401005733.3598e82c.ray@ddteam.net> <20110408095712.1fc36066@atom.dino.sk> <20110408113132.3c1df0a8.ray@dlink.ua> <20110409142931.3d1884a9@atom.dino.sk> Organization: D-Link X-Mailer: Sylpheed 2.7.1 (GTK+ 2.20.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Aleksandr Rybalko , freebsd-mips@freebsd.org Subject: Re: [RFC] Re: TP link MR3220 status, boot from flash via u-boot question X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2011 09:42:08 -0000 On Sat, 9 Apr 2011 14:29:31 +0200 Milan Obuch wrote: >> On Fri, 8 Apr 2011 11:31:32 +0300, Aleksandr Rybalko >> wrote: >> >> > On Fri, 8 Apr 2011 09:57:12 +0200 >> > Milan Obuch wrote: >> > >> > >> On Fri, 1 Apr 2011 00:57:33 +0300, Aleksandr Rybalko >> > >> wrote: >> >> [ snip ] >> >> > >> > Draft for wiki page 'Run from NOR flash with U-Boot' >> > >> > >> > >> >> > >> In my case, to be exact, there is SPI flash, actually... >> > >> > SPI is a interface, but flash type also NOR, IIRC >> > >> >> Well, maybe, but I found no mention about that in datasheet from Eon >> (cFeon) for EN25F32... but this is not that important. >> >> > >> > Keywords: U-Boot, embedded >> > >> > >> > >> > 1. Ask U-Boot: "what do you support to boot?" >> > >> > >> > >> > Normally, U-Boot use special image for kernel/ramfs packing. But >> > >> > we need to know which compression support U-Boot that fleshed to >> > >> > our target board. >> > >> > >> > >> >> > >> This one is easy - I can use gzip packed kernel only. If I try >> > >> other compressing method, u-boot complains with 'bad gzip data' >> > >> message so this one is clear in this case, I think. >> > >> > Did you try all lzma typed (oldlzma, lzma and xz)? >> > >> > Because I made 4M system with kernel compressed with LZMA(oldlzma) >> > and fs is iso.ulzma In gzipped kernel case we have kernel partition >> > 200-600 Kb bigger. Then it hard to make usable FS. >> > >> >> For lzma, u-boot told 'bad gzip data, must reset'. No joy. I have no >> idea on old lzma method, will try xz, but I have little hope it will be >> any better. >> oldlzma is a lzma tool 4.17 You can use my copy (Makefile reorganized to simple BSD Makefile) http://my.ddteam.net/files/oldlzma.tar.gz >> [ snip ] >> >> > >> > 2. Create image >> > >> > 2.1. More canonical way, we have mkimage, gzip or bz2 and >> > >> > compiled kernel, maybe kernel.bin also. >> > >> > >> > >> > >> > >> > gzip --best --force vmlinux.bin >> > >> > >> > >> > >> > >> > for ELF kernel: >> > >> > >> > >> > mkimage -A mips -O linux -T kernel \ >> > >> > -C gzip \ >> > >> > -a ${LOAD_ADDRESS} \ >> > >> > -e ${START_ADDRESS} \ >> > >> > -n 'FreeBSD Kernel Image' \ >> > >> > -d kernel \ >> > >> > kernel.uboot >> > >> > >> > >> > LOAD_ADDRESS - in most cases this is RAM base address >> > >> > START_ADDRESS = LOAD_ADDRESS + ELF_HEADER_SIZE (0x1000 for ELF >> > >> > image) >> > >> > >> > >> > for kernel.bin: >> > >> > >> > >> > LOAD_ADDRESS = RAM_BASE_ADDRESS + 0x1000 >> > >> > START_ADDRESS = RAM_BASE_ADDRESS + 0x1000 >> > >> > >> > >> > Don't forget to check/change KERNLOADADDR of kernel config file. >> > >> > KERNLOADADDR must be equal to START_ADDRESS. >> > >> > >> > >> >> > >> I tried it various way, no success yet. When I load kernel via >> > >> TFTP to address set in kernel config (0x80050000 in my case) I can >> > >> issue a go command to 'start' address, usually 0x80050100, but >> > >> sometimes it is 0x80050120 - I am checking for this after kernel >> > >> is built - and kernel boots correctly and works. >> > >> > 0x80050120 - something weird (maybe 0x20 U-Boot or TPlink header size) >> >> This has nothing to do with u-boot or tplink, yet. It comes from running >> command 'nm kernel | grep _start'. For some reason sometimes there is >> somewhat bigger ELF header, no idea why. weird again, don't understand why it changed sometime :) >> >> > 0x80050100 - START_ADDRESS in case we use elf >> > >> > to save some space make >> > objcopy -S -O binary kernel kernel.bin >> > then run mkimage with load and start address 0x80050100 >> > >> >> Will try with -O binary, actually I am using it now without this option. Don't forget to use objcopy of mips toolchain (somewhere in /usr/obj/mips.mipsel) >> >> > >> As already mentioned, there is a mktplinkfw utility, which combines >> > >> kernel and root fs (or uses kernel with embedded root fs), >> > >> prepends a required header and pads generated image to full size >> > >> of flash minus 128 kB for u-boot itself. I am able to flash such >> > >> image into flash, but bootm tells only about success uncompressing >> > >> kernel, starting kernel and that's all. >> > >> > I not work with mktplinkfw yet, so I can't hint you about that. >> > >> > >> >> > >> ## Booting image at 9f020000 ... >> > >> Uncompressing Kernel Image ... OK >> > >> >> > >> Starting kernel ... >> > >> >> > >> Nothing more, powerdown necessary to start again. >> > >> >> > >> > 2.2. Longest way, but have smallest footprint, used only if >> > >> > U-Boot support LZMA. >> > >> > >> > >> > Problem 1: Current version of mkimage from ports, don't support >> > >> > LZMA. So we need new: >> > >> > http://my.ddteam.net/files/u-boot.new.tar.gz >> > >> > >> > >> > Problem 2: Devices I know support only old LZMA. >> > >> > I use LZMA 4.17. >> > >> > >> > >> > Then mkimage, like in 2.2., but -C lzma. >> > >> > >> > >> > 3. Now we have kernel U-Boot image, so transfer it to device and >> > >> > try with `bootm' command. >> > >> > >> > >> > 4. If all fine, write image to flash kernel partition. >> > >> > >> > >> > >> > >> > Hope this help :) >> > >> > >> > >> >> > >> [ snip ] >> > >> >> > >> Not much yet, unfortunatelly... >> > >> >> > >> On a side note, there is one thing to be addressed. As my device >> > >> has only 4 MB flash, I still need to shrink the image I would like >> > >> to use there. I could put there working kernel, when flash boot >> > >> issue is solved, but root fs not yet, together they do not fit. I >> > >> still need to save as much as 600 kB of space... Do you have any >> > >> tips to share? In some older mails here I saw you managed to do it >> > >> for other device... >> > >> > 1. compile with NOSHARED=no >> > 2. delete .h, .a, .o and many other docs and unused binary's (I think >> > that step you know :) ) 3. mkulzma+geom_uncompress instead >> > mkuzip+geom_uzip >> > >> >> There are following files at http://my.ddteam.net page: >> >> 2011-01-19_add_contrib_xz-embedded.patch >> 2011-01-19_geom_ulzma_and_mkulzma.patch >> 2011-01-21_geom_ulzma_and_uzip.diff >> 2011-01-23_geom_uncompress.diff >> 2011-01-23_geom_uncompress.patch >> 2011-01-24_mkulzma.patch >> >> Which one should I use? There is no mkulzma in base now... >> >> Regards, >> Milan Use please: mkulzma utility - http://my.ddteam.net/files/2011-01-24_mkulzma.patch geom_uncompress(uzip/ulzma) - http://my.ddteam.net/files/2011-01-23_geom_uncompress.patch xz-embedded decompressor - http://my.ddteam.net/files/2011-01-19_add_contrib_xz-embedded.patch /me should write a wiki page for it, but need to found time :) WBW -- Alexandr Rybalko aka Alex RAY From owner-freebsd-mips@FreeBSD.ORG Tue Apr 12 08:00:54 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3684D106564A; Tue, 12 Apr 2011 08:00:54 +0000 (UTC) (envelope-from freebsd-mips@dino.sk) Received: from loki.netlab.sk (ns3.netlab.sk [84.245.65.11]) by mx1.freebsd.org (Postfix) with ESMTP id D44078FC0C; Tue, 12 Apr 2011 08:00:53 +0000 (UTC) Received: from atom.dino.sk (fw1.dino.sk [84.245.95.252]) (AUTH: LOGIN milan, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by loki.netlab.sk with ESMTPSA; Tue, 12 Apr 2011 10:00:27 +0200 id 00033C15.4DA4069B.000170F6 Date: Tue, 12 Apr 2011 10:00:41 +0200 From: Milan Obuch To: Aleksandr Rybalko Message-ID: <20110412100041.00cfe100@atom.dino.sk> In-Reply-To: <20110411124159.8b93df20.ray@dlink.ua> References: <20110331101554.68171eed@atom.dino.sk> <20110331142640.07f2101b@atom.dino.sk> <20110401005733.3598e82c.ray@ddteam.net> <20110408095712.1fc36066@atom.dino.sk> <20110408113132.3c1df0a8.ray@dlink.ua> <20110409142931.3d1884a9@atom.dino.sk> <20110411124159.8b93df20.ray@dlink.ua> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; amd64-portbld-freebsd8.2) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEX+/v7++v6YOTrq8PCcuIX989UvOSj++v0BNCbpAAAAB3RJTUUHsQwfFzs7RBhzUQAAAhJJREFUOI1dU8GOqzAMNKIoV1bvwD1i0ysqrHplIdBrVSX7ATSbd03VVvn9tQNtQy0hjAdn7LED4AAcPtWm9RV+MPSfxhBLx9ajd6X/ngB6/mTwnRSZua7i7Ca+0ctZKo4Qmz+JY13X6I3nFZBxIYW1PbgfQ5RP8g0XlltEWGf3cV03joYpRnFbvYDKbXjZlXyyhEZA4lI+cN3NaVXE4VKjSwTExO10eTEkkJVqIAD5z0nUBQJluQDRSQjcrBiHAJxZlAH5CUMBMC7OcJ4LMQNnxhZ1HYPscMc6J4UlWRMNwzOpCcAHKSICd1EDn83abdREIbXsHkD1OinP1aCUCOEVRaa1lMcvywUWdYgk13JQUpYNKmvXQ8Kw5ML9YI5h8SakctBc7E/IYuLhYd/zZIk+1gM1vNweQBvHE0j+oYah3sMqAytQYlZk6+ANaaawJdu3OFzYGMZ3iGpa3qMlq9ZH0VZTgrCtw/ngdYkEIIpSbP1bWQAdFdX9vocBdkH2qVjVmuMu3gI5rjs814EUdrCZgWlPaxZZ3RiLFUtr+ud0PXwp2dnQSNXgePt6AZpBj6UMJ7VQkzN4utVeaSW1Dhn/kblGrKeMvNGnzwX4zuEDarYz1KdPtR60Gul0Gued+515SJXhCsl+Tx/3kY/UDvicPll9mfu50t3tvQ/thZpJYgeuwdSKNJ6tCD98MCgoxLDaPxbwqqwPWaWiAAAAAElFTkSuQmCC X-Face: ak5rwz4-aUa>hPFZlcg,bXxn.(TN}e9DGFrKU\.i_'B[&5=pAd9o"j)5VSUYW:BRQG#^42Ev$Il|; Ztn=,C X-Operating-System: FreeBSD/amd64 8.2-STABLE Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Aleksandr Rybalko , freebsd-mips@freebsd.org Subject: Re: [RFC] Re: TP link MR3220 status, boot from flash via u-boot question X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2011 08:00:54 -0000 On Mon, 11 Apr 2011 12:41:59 +0300, Aleksandr Rybalko wrote: > On Sat, 9 Apr 2011 14:29:31 +0200 > Milan Obuch wrote: > > >> On Fri, 8 Apr 2011 11:31:32 +0300, Aleksandr Rybalko > >> wrote: > >> > >> > On Fri, 8 Apr 2011 09:57:12 +0200 > >> > Milan Obuch wrote: > >> > [ snip ] > >> For lzma, u-boot told 'bad gzip data, must reset'. No joy. I have > >> no idea on old lzma method, will try xz, but I have little hope it > >> will be any better. > >> > > oldlzma is a lzma tool 4.17 > You can use my copy (Makefile reorganized to simple BSD Makefile) > http://my.ddteam.net/files/oldlzma.tar.gz > I will try, but not too hard :) (see below) [ snip ] > >> Will try with -O binary, actually I am using it now without this > >> option. > Don't forget to use objcopy of mips toolchain (somewhere > in /usr/obj/mips.mipsel) > Yes, naturally - all tools are cross build ones... [ snip ] > >> > >> On a side note, there is one thing to be addressed. As my > >> > >> device has only 4 MB flash, I still need to shrink the image > >> > >> I would like to use there. I could put there working kernel, > >> > >> when flash boot issue is solved, but root fs not yet, > >> > >> together they do not fit. I still need to save as much as 600 > >> > >> kB of space... Do you have any tips to share? In some older > >> > >> mails here I saw you managed to do it for other device... > >> > > >> > 1. compile with NOSHARED=no > >> > 2. delete .h, .a, .o and many other docs and unused binary's (I > >> > think that step you know :) ) 3. mkulzma+geom_uncompress instead > >> > mkuzip+geom_uzip > >> > > >> > >> There are following files at http://my.ddteam.net page: > >> > >> 2011-01-19_add_contrib_xz-embedded.patch > >> 2011-01-19_geom_ulzma_and_mkulzma.patch > >> 2011-01-21_geom_ulzma_and_uzip.diff > >> 2011-01-23_geom_uncompress.diff > >> 2011-01-23_geom_uncompress.patch > >> 2011-01-24_mkulzma.patch > >> > >> Which one should I use? There is no mkulzma in base now... > >> > >> Regards, > >> Milan > > Use please: > mkulzma utility - http://my.ddteam.net/files/2011-01-24_mkulzma.patch > geom_uncompress(uzip/ulzma) - > http://my.ddteam.net/files/2011-01-23_geom_uncompress.patch > xz-embedded decompressor - > http://my.ddteam.net/files/2011-01-19_add_contrib_xz-embedded.patch > Looks like my guess was right. It works and I am able to create combined kernel + root fs fitting in 4 MB flash, kernel is gzipped as u-boot seems support only that and rootfs lzma-compressed. Trouble is u-boot does not like my images, so I need to investigate that, which does not seems to be easy now... Has anybody some experience in this area? There is GPL compliance tarball from TP-link with some u-boot directory in it, but is it possible to build it somehow under FreeBSD? All in this tarball seems to be 'just Linux'... Regards, Milan From owner-freebsd-mips@FreeBSD.ORG Tue Apr 12 08:56:16 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7439A1065673; Tue, 12 Apr 2011 08:56:16 +0000 (UTC) (envelope-from ray@dlink.ua) Received: from dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id EC4408FC17; Tue, 12 Apr 2011 08:56:15 +0000 (UTC) Received: from gw-lan1.kiev.dlink.ua ([192.168.10.10] helo=terran.dlink.ua) by dlink.ua with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Q9ZOO-0006y5-Qq; Tue, 12 Apr 2011 11:56:13 +0300 Date: Tue, 12 Apr 2011 11:56:07 +0300 From: Aleksandr Rybalko To: Milan Obuch Message-Id: <20110412115607.aa420363.ray@dlink.ua> In-Reply-To: <20110412100041.00cfe100@atom.dino.sk> References: <20110331101554.68171eed@atom.dino.sk> <20110331142640.07f2101b@atom.dino.sk> <20110401005733.3598e82c.ray@ddteam.net> <20110408095712.1fc36066@atom.dino.sk> <20110408113132.3c1df0a8.ray@dlink.ua> <20110409142931.3d1884a9@atom.dino.sk> <20110411124159.8b93df20.ray@dlink.ua> <20110412100041.00cfe100@atom.dino.sk> Organization: D-Link X-Mailer: Sylpheed 2.7.1 (GTK+ 2.20.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Aleksandr Rybalko , freebsd-mips@freebsd.org Subject: Re: [RFC] Re: TP link MR3220 status, boot from flash via u-boot question X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2011 08:56:16 -0000 On Tue, 12 Apr 2011 10:00:41 +0200 Milan Obuch wrote: >> On Mon, 11 Apr 2011 12:41:59 +0300, Aleksandr Rybalko wrote: >> >> > On Sat, 9 Apr 2011 14:29:31 +0200 >> > Milan Obuch wrote: >> > >> > >> On Fri, 8 Apr 2011 11:31:32 +0300, Aleksandr Rybalko >> > >> wrote: >> > >> >> > >> > On Fri, 8 Apr 2011 09:57:12 +0200 >> > >> > Milan Obuch wrote: >> > >> > >> >> [ snip ] >> >> > >> For lzma, u-boot told 'bad gzip data, must reset'. No joy. I have >> > >> no idea on old lzma method, will try xz, but I have little hope it >> > >> will be any better. >> > >> >> > >> > oldlzma is a lzma tool 4.17 >> > You can use my copy (Makefile reorganized to simple BSD Makefile) >> > http://my.ddteam.net/files/oldlzma.tar.gz >> > >> >> I will try, but not too hard :) (see below) >> >> [ snip ] >> >> > >> Will try with -O binary, actually I am using it now without this >> > >> option. >> > Don't forget to use objcopy of mips toolchain (somewhere >> > in /usr/obj/mips.mipsel) >> > >> >> Yes, naturally - all tools are cross build ones... >> >> [ snip ] >> >> > >> > >> On a side note, there is one thing to be addressed. As my >> > >> > >> device has only 4 MB flash, I still need to shrink the image >> > >> > >> I would like to use there. I could put there working kernel, >> > >> > >> when flash boot issue is solved, but root fs not yet, >> > >> > >> together they do not fit. I still need to save as much as 600 >> > >> > >> kB of space... Do you have any tips to share? In some older >> > >> > >> mails here I saw you managed to do it for other device... >> > >> > >> > >> > 1. compile with NOSHARED=no >> > >> > 2. delete .h, .a, .o and many other docs and unused binary's (I >> > >> > think that step you know :) ) 3. mkulzma+geom_uncompress instead >> > >> > mkuzip+geom_uzip >> > >> > >> > >> >> > >> There are following files at http://my.ddteam.net page: >> > >> >> > >> 2011-01-19_add_contrib_xz-embedded.patch >> > >> 2011-01-19_geom_ulzma_and_mkulzma.patch >> > >> 2011-01-21_geom_ulzma_and_uzip.diff >> > >> 2011-01-23_geom_uncompress.diff >> > >> 2011-01-23_geom_uncompress.patch >> > >> 2011-01-24_mkulzma.patch >> > >> >> > >> Which one should I use? There is no mkulzma in base now... >> > >> >> > >> Regards, >> > >> Milan >> > >> > Use please: >> > mkulzma utility - http://my.ddteam.net/files/2011-01-24_mkulzma.patch >> > geom_uncompress(uzip/ulzma) - >> > http://my.ddteam.net/files/2011-01-23_geom_uncompress.patch >> > xz-embedded decompressor - >> > http://my.ddteam.net/files/2011-01-19_add_contrib_xz-embedded.patch >> > >> >> Looks like my guess was right. It works and I am able to create >> combined kernel + root fs fitting in 4 MB flash, kernel is gzipped as >> u-boot seems support only that and rootfs lzma-compressed. >> >> Trouble is u-boot does not like my images, so I need to investigate >> that, which does not seems to be easy now... Has anybody some >> experience in this area? There is GPL compliance tarball from TP-link >> with some u-boot directory in it, but is it possible to build it >> somehow under FreeBSD? All in this tarball seems to be 'just Linux'... cd OpenWRT/trunk/tools/firmware-utils/src/ cc -o mktplinkfw md5.c mktplinkfw.c >> >> Regards, >> Milan -- Alexandr Rybalko aka Alex RAY From owner-freebsd-mips@FreeBSD.ORG Tue Apr 12 21:54:24 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5D2B106564A for ; Tue, 12 Apr 2011 21:54:24 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (cl-414.sto-01.se.sixxs.net [IPv6:2001:16d8:ff00:19d::2]) by mx1.freebsd.org (Postfix) with ESMTP id 62BBD8FC14 for ; Tue, 12 Apr 2011 21:54:24 +0000 (UTC) Received: from orion.SpringDaemons.com (207.47.0.2.static.nextweb.net [207.47.0.2]) by mx0.deglitch.com (Postfix) with ESMTPA id 27EE48FC2E; Wed, 13 Apr 2011 01:54:21 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id DAEDD5C35; Tue, 12 Apr 2011 14:53:54 -0700 (PDT) Date: Tue, 12 Apr 2011 14:53:54 -0700 From: Stanislav Sedov To: Milan Obuch Message-Id: <20110412145354.f58808ac.stas@FreeBSD.org> In-Reply-To: <20110412100041.00cfe100@atom.dino.sk> References: <20110331101554.68171eed@atom.dino.sk> <20110331142640.07f2101b@atom.dino.sk> <20110401005733.3598e82c.ray@ddteam.net> <20110408095712.1fc36066@atom.dino.sk> <20110408113132.3c1df0a8.ray@dlink.ua> <20110409142931.3d1884a9@atom.dino.sk> <20110411124159.8b93df20.ray@dlink.ua> <20110412100041.00cfe100@atom.dino.sk> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Aleksandr Rybalko , freebsd-mips@freebsd.org Subject: Re: [RFC] Re: TP link MR3220 status, boot from flash via u-boot question X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2011 21:54:24 -0000 On Tue, 12 Apr 2011 10:00:41 +0200 Milan Obuch mentioned: > > Trouble is u-boot does not like my images, so I need to investigate > that, which does not seems to be easy now... Has anybody some > experience in this area? There is GPL compliance tarball from TP-link > with some u-boot directory in it, but is it possible to build it > somehow under FreeBSD? All in this tarball seems to be 'just Linux'... > u-boot is used to build fine under FreeBSD with devel/cross-gcc -- Stanislav Sedov ST4096-RIPE () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments From owner-freebsd-mips@FreeBSD.ORG Thu Apr 14 18:03:10 2011 Return-Path: Delivered-To: mips@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCAE71065670 for ; Thu, 14 Apr 2011 18:03:10 +0000 (UTC) (envelope-from aduane@juniper.net) Received: from exprod7og119.obsmtp.com (exprod7og119.obsmtp.com [64.18.2.16]) by mx1.freebsd.org (Postfix) with ESMTP id 460F38FC1E for ; Thu, 14 Apr 2011 18:03:10 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob119.postini.com ([64.18.6.12]) with SMTP ID DSNKTac23SPXaIWvzt74pbFyr8rR9ooVrRiA@postini.com; Thu, 14 Apr 2011 11:03:10 PDT Received: from p-emfe01-wf.jnpr.net (172.28.145.24) by P-EMHUB02-HQ.jnpr.net (172.24.192.36) with Microsoft SMTP Server (TLS) id 8.2.254.0; Thu, 14 Apr 2011 10:59:13 -0700 Received: from EMBX01-WF.jnpr.net ([fe80::1914:3299:33d9:e43b]) by p-emfe01-wf.jnpr.net ([fe80::d0d1:653d:5b91:a123%11]) with mapi; Thu, 14 Apr 2011 14:01:09 -0400 From: Andrew Duane To: "mips@freebsd.org" Date: Thu, 14 Apr 2011 14:01:07 -0400 Thread-Topic: Trouble with dynamic executables Thread-Index: Acv6ze3+ZQjfoYPNTDahW+vBxs/4/g== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: Subject: Trouble with dynamic executables X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2011 18:03:10 -0000 I've pretty much completed my board bringup of an OCTEON based board, but a= m still battling one *major* issue. Dynamically linked executables do not w= ork at all. Any time I try to run one, I get "Exec format error" (ENOEXEC).= Sample output from file is: Statically linked /bin/cat: bin/cat: ELF 64-bit MSB executable, MIPS, MIPS64 rel2 version 1 (FreeB= SD), for FreeBSD 9.0 (900035), statically linked, FreeBSD-style, not stripp= ed Dynamically linked /usr/bin/size: usr/bin/size: ELF 64-bit MSB executable, MIPS, MIPS64 rel2 version 1 (FreeB= SD), for FreeBSD 9.0 (900035), dynamically linked (uses shared libs), FreeB= SD-style, not stripped For now, I've sort of worked around this by editing close to 1000 Makefiles= and making almost everything static. There must be a reason for this thoug= h. I've done a fresh update and rebuilt everything including the toolchain.= Is there something missing from my system? The loader itself? Libraries? A= n ldscript file? -- Andrew Duane Juniper Networks 978-589-0551 10 Technology Park Dr aduane@juniper.net Westford, MA 01886-3418 =20 From owner-freebsd-mips@FreeBSD.ORG Thu Apr 14 19:11:18 2011 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A16DF106566C for ; Thu, 14 Apr 2011 19:11:18 +0000 (UTC) (envelope-from bhanuprakashbodireddy@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 73B378FC15 for ; Thu, 14 Apr 2011 19:11:18 +0000 (UTC) Received: by pvg11 with SMTP id 11so946820pvg.13 for ; Thu, 14 Apr 2011 12:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=MQOrbCCyQ6Jtbj/paxqvh1zoYsiOfB0AAsDhxmLZ65I=; b=UiRkqlZhWJphMPjyx1HNNz4JZRpqE7162xi+EWzOe2wSH6xQeldLa7YNfDgjpNOrOa 5JBrGfGTcUEOnQr6+violaAwmv1VWGQLzCD12lGObddplJogvjZbyMyWzbTMF08N4f+z MsbEOgOpLbnzx5gqyFVdQH+n3oSpiXnSXXpnA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Fz6cFevEOiQAZNah9hX0gMVVEpxtgyBZiv6oz4jod6UB6tGzZ7HQSutkth0wDkN6Te q08pfr8eL7Q+1f9h/0d8FlGCqr40u86r09tuvZ+TnO3yukp9ESSTdKUI7bawD7UcVtSa qysJKc24nKyZtFPPwq9Vvb+e0iOPGQsEMaUvw= MIME-Version: 1.0 Received: by 10.142.249.34 with SMTP id w34mr326798wfh.301.1302808277605; Thu, 14 Apr 2011 12:11:17 -0700 (PDT) Received: by 10.142.215.11 with HTTP; Thu, 14 Apr 2011 12:11:17 -0700 (PDT) In-Reply-To: References: Date: Thu, 14 Apr 2011 12:11:17 -0700 Message-ID: From: bhanuprakash bodireddy To: Andrew Duane Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "mips@freebsd.org" Subject: Re: Trouble with dynamic executables X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2011 19:11:18 -0000 I had a similar issue the other day when i did a fresh build world. I tried it to reproduce the issue you reported and its pretty much there in the trunk. But the last buildworld has no such issues and am still using the same old fs image to boot on to the octeon boards. I believe, some recent fixes should have caused this. Thanks, Bhanu Prakash. On Thu, Apr 14, 2011 at 11:01 AM, Andrew Duane wrote: > I've pretty much completed my board bringup of an OCTEON based board, but > am still battling one *major* issue. Dynamically linked executables do not > work at all. Any time I try to run one, I get "Exec format error" (ENOEXEC). > Sample output from file is: > > Statically linked /bin/cat: > > bin/cat: ELF 64-bit MSB executable, MIPS, MIPS64 rel2 version 1 > (FreeBSD), for FreeBSD 9.0 (900035), statically linked, FreeBSD-style, not > stripped > > Dynamically linked /usr/bin/size: > > usr/bin/size: ELF 64-bit MSB executable, MIPS, MIPS64 rel2 version 1 > (FreeBSD), for FreeBSD 9.0 (900035), dynamically linked (uses shared libs), > FreeBSD-style, not stripped > > For now, I've sort of worked around this by editing close to 1000 Makefiles > and making almost everything static. There must be a reason for this though. > I've done a fresh update and rebuilt everything including the toolchain. Is > there something missing from my system? The loader itself? Libraries? An > ldscript file? > > -- > > Andrew Duane Juniper Networks > 978-589-0551 10 Technology Park Dr > aduane@juniper.net Westford, MA 01886-3418 > > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" > From owner-freebsd-mips@FreeBSD.ORG Thu Apr 14 19:18:40 2011 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6837A106566B for ; Thu, 14 Apr 2011 19:18:40 +0000 (UTC) (envelope-from aduane@juniper.net) Received: from exprod7og120.obsmtp.com (exprod7og120.obsmtp.com [64.18.2.18]) by mx1.freebsd.org (Postfix) with ESMTP id 93B518FC16 for ; Thu, 14 Apr 2011 19:18:39 +0000 (UTC) Received: from P-EMHUB03-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob120.postini.com ([64.18.6.12]) with SMTP ID DSNKTadIjozCqCLw5AmU4XIYZ2mzuONZ3nQg@postini.com; Thu, 14 Apr 2011 12:18:40 PDT Received: from p-emfe02-wf.jnpr.net (172.28.145.25) by P-EMHUB03-HQ.jnpr.net (172.24.192.37) with Microsoft SMTP Server (TLS) id 8.2.254.0; Thu, 14 Apr 2011 12:15:27 -0700 Received: from EMBX01-WF.jnpr.net ([fe80::1914:3299:33d9:e43b]) by p-emfe02-wf.jnpr.net ([fe80::c126:c633:d2dc:8090%11]) with mapi; Thu, 14 Apr 2011 15:17:24 -0400 From: Andrew Duane To: bhanuprakash bodireddy Date: Thu, 14 Apr 2011 15:17:23 -0400 Thread-Topic: Trouble with dynamic executables Thread-Index: Acv6170Ywwx7iLTwQuyRMcNL1ZtJagAABBQg Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "mips@freebsd.org" Subject: RE: Trouble with dynamic executables X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2011 19:18:40 -0000 I've figured out what the problem is. The elf header of a sample dynamic ex= ecutable shows: =20 Elf file type is EXEC (Executable file) Entry point 0x1200028f0 There are 7 program headers, starting at offset 64 =20 Program Headers: Type Offset VirtAddr PhysAddr F= ileSiz MemSiz Flags Align PHDR 0x0000000000000040 0x0000000120000040 0x0000000120000040 0= x0000000000000188 0x0000000000000188 R E 8 INTERP 0x0000000000012788 0x0000000120012788 0x0000000120012788 0= x0000000000000015 0x0000000000000015 R 1 [Requesting program interpreter: /libexec/ld-elf.so.1] LOAD 0x0000000000000000 0x0000000120000000 0x0000000120000000 0= x00000000000127bc 0x00000000000127bc R E 10000 LOAD 0x0000000000013000 0x0000000120023000 0x0000000120023000 0= x00000000000017d8 0x0000000000003c28 RW 10000 DYNAMIC 0x0000000000000808 0x0000000120000808 0x0000000120000808 0= x00000000000001e0 0x00000000000001e0 RWE 8 NOTE 0x00000000000127a4 0x00000001200127a4 0x00000001200127a4 0= x0000000000000018 0x0000000000000018 R 4 NULL 0x0000000000000000 0x0000000000000000 0x0000000000000000 0= x0000000000000000 0x0000000000000000 8 Note section 1 the INTERP header: the offset is 0x12788. There's a check in= the ELF64 image activator to see if the offset is outside the first page a= nd returns ENOEXEC. The exec path reads in the first page first, and tries = to figure out what to do with the rest. So if the interpreter name isn't in= the first page, it can't decode it. This is a toolchain issue, or some setup issue. =20 /Andrew =20 =20 ________________________________ From: bhanuprakash bodireddy [mailto:bhanuprakashbodireddy@gmail.com]=20 Sent: Thursday, April 14, 2011 3:11 PM To: Andrew Duane Cc: mips@freebsd.org Subject: Re: Trouble with dynamic executables I had a similar issue the other day when i did a fresh build world. I tried= it to reproduce the issue you reported and its pretty much there in the tr= unk. But the last buildworld has no such issues and am still using the same old = fs image to boot on to the octeon boards.=20 I believe, some recent fixes should have caused this.=20 Thanks, Bhanu Prakash. On Thu, Apr 14, 2011 at 11:01 AM, Andrew Duane wrote: I've pretty much completed my board bringup of an OCTEON based board, but = am still battling one *major* issue. Dynamically linked executables do not = work at all. Any time I try to run one, I get "Exec format error" (ENOEXEC)= . Sample output from file is: =09 Statically linked /bin/cat: =09 bin/cat: ELF 64-bit MSB executable, MIPS, MIPS64 rel2 version 1 (Free= BSD), for FreeBSD 9.0 (900035), statically linked, FreeBSD-style, not strip= ped =09 Dynamically linked /usr/bin/size: =09 usr/bin/size: ELF 64-bit MSB executable, MIPS, MIPS64 rel2 version 1 (Free= BSD), for FreeBSD 9.0 (900035), dynamically linked (uses shared libs), Free= BSD-style, not stripped =09 For now, I've sort of worked around this by editing close to 1000 Makefile= s and making almost everything static. There must be a reason for this thou= gh. I've done a fresh update and rebuilt everything including the toolchain= . Is there something missing from my system? The loader itself? Libraries? = An ldscript file? =09 -- =09 Andrew Duane Juniper Networks 978-589-0551 10 Technology Park Dr aduane@juniper.net Westford, MA 01886-3418 =09 _______________________________________________ freebsd-mips@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-mips To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" =09 From owner-freebsd-mips@FreeBSD.ORG Fri Apr 15 06:47:11 2011 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84291106566C for ; Fri, 15 Apr 2011 06:47:11 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id D29148FC12 for ; Fri, 15 Apr 2011 06:47:10 +0000 (UTC) Received: by wwk4 with SMTP id 4so6768847wwk.1 for ; Thu, 14 Apr 2011 23:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=rVvW/ZjpilnvQSc2B9vpkl0hnUlQ2UF5RfI1m591YgU=; b=g6WtXkO1DFjn06GSkIL8IM9jBhdljw5CD00pdr9OQzkvqQS3Zr6pMOwoazpXBIUas0 L61qZmwSeGEvV87Th7zTBDA93/A3/5VWdCYQMzfZ5ZxhDOAm+4tIUbu5AVSoy4tvFFBB LH5YrTHFN0bapWaUpIy/byyNlwWmR+65+u8xQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=kb/qjTXFYOcvBlp36ko7k+zv+Pikdk1qjYGn7o88hqfYO++u9Pp50vVqpx9MXSqpC9 yUoN6+HjcmcZW1ZS8kOoJ3GArO5vNS95E1aenmPDMM7gfM98jdLzCa5dWqKaDQuFRixq X5/pvV1dg6Tp9hRw0ZM3ttGERCKq1KjB/z3do= MIME-Version: 1.0 Received: by 10.216.239.71 with SMTP id b49mr1518932wer.107.1302848240112; Thu, 14 Apr 2011 23:17:20 -0700 (PDT) Received: by 10.216.166.206 with HTTP; Thu, 14 Apr 2011 23:17:20 -0700 (PDT) In-Reply-To: References: Date: Fri, 15 Apr 2011 11:47:20 +0530 Message-ID: From: "Jayachandran C." To: Andrew Duane Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "mips@freebsd.org" Subject: Re: Trouble with dynamic executables X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2011 06:47:11 -0000 On Fri, Apr 15, 2011 at 12:47 AM, Andrew Duane wrote: > I've figured out what the problem is. The elf header of a sample dynamic = executable shows: > > Elf file type is EXEC (Executable file) > Entry point 0x1200028f0 > There are 7 program headers, starting at offset 64 > > Program Headers: > =A0Type =A0 =A0 =A0 =A0 =A0 Offset =A0 =A0 =A0 =A0 =A0 =A0 VirtAddr =A0 = =A0 =A0 =A0 =A0 PhysAddr =A0 =A0 =A0 =A0 =A0 FileSiz =A0 =A0 =A0 =A0 =A0 = =A0MemSiz =A0 =A0 =A0 =A0 =A0 =A0 =A0Flags =A0Align > =A0PHDR =A0 =A0 =A0 =A0 =A0 0x0000000000000040 0x0000000120000040 0x00000= 00120000040 0x0000000000000188 0x0000000000000188 =A0R E =A0 =A08 > =A0INTERP =A0 =A0 =A0 =A0 0x0000000000012788 0x0000000120012788 0x0000000= 120012788 0x0000000000000015 0x0000000000000015 =A0R =A0 =A0 =A01 > =A0 =A0 =A0[Requesting program interpreter: /libexec/ld-elf.so.1] > =A0LOAD =A0 =A0 =A0 =A0 =A0 0x0000000000000000 0x0000000120000000 0x00000= 00120000000 0x00000000000127bc 0x00000000000127bc =A0R E =A0 =A010000 > =A0LOAD =A0 =A0 =A0 =A0 =A0 0x0000000000013000 0x0000000120023000 0x00000= 00120023000 0x00000000000017d8 0x0000000000003c28 =A0RW =A0 =A0 10000 > =A0DYNAMIC =A0 =A0 =A0 =A00x0000000000000808 0x0000000120000808 0x0000000= 120000808 0x00000000000001e0 0x00000000000001e0 =A0RWE =A0 =A08 > =A0NOTE =A0 =A0 =A0 =A0 =A0 0x00000000000127a4 0x00000001200127a4 0x00000= 001200127a4 0x0000000000000018 0x0000000000000018 =A0R =A0 =A0 =A04 > =A0NULL =A0 =A0 =A0 =A0 =A0 0x0000000000000000 0x0000000000000000 0x00000= 00000000000 0x0000000000000000 0x0000000000000000 =A0 =A0 =A0 =A0 8 > > Note section 1 the INTERP header: the offset is 0x12788. There's a check = in the ELF64 image activator to see if the offset is outside the first page= and returns ENOEXEC. The exec path reads in the first page first, and trie= s to figure out what to do with the rest. So if the interpreter name isn't = in the first page, it can't decode it. > > This is a toolchain issue, or some setup issue. This may be a mip64r2 issue. I use the mips64 config and 32 and 64 bit dynamic executables have been working for a long time. For reference, here is my setup: Environment for buildworld: export TARGET=3Dmips export TARGET_ARCH=3Dmips64eb export TARGET_CPUTYPE=3Dmips64 Makeoptions in conf file (from XLP64) makeoptions KERNLOADADDR=3D0xffffffff80100000 makeoptions ARCH_FLAGS=3D"-march=3Dmips64 -mabi=3D64" options ISA_MIPS64 And on the XLR engineering board: xlrboard# uname -a FreeBSD xlrboard.netlogicmicro.com 9.0-CURRENT FreeBSD 9.0-CURRENT #2 r220649M: Fri Apr 15 11:27:57 IST 2011 jc@daemon.razamicroelectronics.com:/var/obj/jc/freebsd-obj-64/mips.mips64eb= /work/jayachandranc/freebsd-devel-clean/sys/XLRJC64 mips xlrboard# ldd /bin/ls /bin/ls: libutil.so.9 =3D> /lib/libutil.so.9 (0x16024d000) libncurses.so.8 =3D> /lib/libncurses.so.8 (0x16035f000) libc.so.7 =3D> /lib/libc.so.7 (0x1604b3000) xlrboard# readelf -a /bin/ls ELF Header: Magic: 7f 45 4c 46 02 02 01 09 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, big endian Version: 1 (current) OS/ABI: UNIX - FreeBSD ABI Version: 0 Type: EXEC (Executable file) Machine: MIPS R3000 Version: 0x1 Entry point address: 0x120001dd0 Start of program headers: 64 (bytes into file) Start of section headers: 34808 (bytes into file) Flags: 0x60000007, noreorder, pic, cpic, mips= 64 Size of this header: 64 (bytes) Size of program headers: 56 (bytes) Number of program headers: 6 Size of section headers: 64 (bytes) Number of section headers: 29 Section header string table index: 28 Section Headers: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align [ 0] NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 [ 1] .interp PROGBITS 0000000120000190 00000190 0000000000000015 0000000000000000 A 0 0 1 [ 2] .note.ABI-tag NOTE 00000001200001a8 000001a8 0000000000000018 0000000000000000 A 0 0 4 [ 3] .MIPS.options MIPS_OPTIONS 00000001200001c0 000001c0 0000000000000168 0000000000000001 Ao 0 0 8 [ 4] .dynamic DYNAMIC 0000000120000328 00000328 0000000000000200 0000000000000010 A 7 0 8 [ 5] .hash HASH 0000000120000528 00000528 0000000000000450 0000000000000004 A 6 0 8 [ 6] .dynsym DYNSYM 0000000120000978 00000978 .... The .interp offset is reasonable here... JC. From owner-freebsd-mips@FreeBSD.ORG Fri Apr 15 06:49:28 2011 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD9D6106566B for ; Fri, 15 Apr 2011 06:49:28 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 5A6C98FC08 for ; Fri, 15 Apr 2011 06:49:28 +0000 (UTC) Received: by wwc33 with SMTP id 33so2738271wwc.31 for ; Thu, 14 Apr 2011 23:49:27 -0700 (PDT) Received: by 10.227.197.210 with SMTP id el18mr1705100wbb.39.1302850167335; Thu, 14 Apr 2011 23:49:27 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.227.39.162 with HTTP; Thu, 14 Apr 2011 23:49:07 -0700 (PDT) In-Reply-To: References: From: Juli Mallett Date: Thu, 14 Apr 2011 23:49:07 -0700 X-Google-Sender-Auth: tWYIslNFpCNt1q84Tu1zje6bblo Message-ID: To: "Jayachandran C." Content-Type: text/plain; charset=ISO-8859-1 Cc: "mips@freebsd.org" Subject: Re: Trouble with dynamic executables X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2011 06:49:28 -0000 On Thu, Apr 14, 2011 at 23:17, Jayachandran C. wrote: > This may be a mip64r2 issue. It isn't, or at least wasn't recently. I use the 'octeon' cputype which is mips64r2. From owner-freebsd-mips@FreeBSD.ORG Fri Apr 15 12:41:04 2011 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49955106567A for ; Fri, 15 Apr 2011 12:41:04 +0000 (UTC) (envelope-from aduane@juniper.net) Received: from exprod7og125.obsmtp.com (exprod7og125.obsmtp.com [64.18.2.28]) by mx1.freebsd.org (Postfix) with ESMTP id A4AB08FC1C for ; Fri, 15 Apr 2011 12:41:01 +0000 (UTC) Received: from P-EMHUB01-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob125.postini.com ([64.18.6.12]) with SMTP ID DSNKTag83HPfKKpBdvDc55Y25DAkt0gqBINz@postini.com; Fri, 15 Apr 2011 05:41:03 PDT Received: from p-emfe01-wf.jnpr.net (172.28.145.24) by P-EMHUB01-HQ.jnpr.net (172.24.192.35) with Microsoft SMTP Server (TLS) id 8.2.254.0; Fri, 15 Apr 2011 05:25:21 -0700 Received: from EMBX01-WF.jnpr.net ([fe80::1914:3299:33d9:e43b]) by p-emfe01-wf.jnpr.net ([fe80::d0d1:653d:5b91:a123%11]) with mapi; Fri, 15 Apr 2011 08:27:18 -0400 From: Andrew Duane To: bhanuprakash bodireddy Date: Fri, 15 Apr 2011 08:26:01 -0400 Thread-Topic: Trouble with dynamic executables Thread-Index: Acv6170Ywwx7iLTwQuyRMcNL1ZtJagAkIr0O Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "mips@freebsd.org" Subject: RE: Trouble with dynamic executables X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2011 12:41:04 -0000 I'm assuming it's a change to "ld", but it could be one of the directive sc= ripts. I spent yesterday combing changes to the tree, and looking for any f= iles that could have caused this. I came up empty, but then I'm not really = sure what I'm looking for. Is there a toolchain person who might know? Ther= e's a good person here at Juniper, but he's on California time.... -- Andrew Duane Juniper Networks 978-589-0551 10 Technology Park Dr aduane@juniper.net Westford, MA 01886-3418 ________________________________________ From: bhanuprakash bodireddy [bhanuprakashbodireddy@gmail.com] Sent: Thursday, April 14, 2011 3:11 PM To: Andrew Duane Cc: mips@freebsd.org Subject: Re: Trouble with dynamic executables I had a similar issue the other day when i did a fresh build world. I tried= it to reproduce the issue you reported and its pretty much there in the tr= unk. But the last buildworld has no such issues and am still using the same old = fs image to boot on to the octeon boards. I believe, some recent fixes should have caused this. Thanks, Bhanu Prakash. On Thu, Apr 14, 2011 at 11:01 AM, Andrew Duane > wrote: I've pretty much completed my board bringup of an OCTEON based board, but a= m still battling one *major* issue. Dynamically linked executables do not w= ork at all. Any time I try to run one, I get "Exec format error" (ENOEXEC).= Sample output from file is: Statically linked /bin/cat: bin/cat: ELF 64-bit MSB executable, MIPS, MIPS64 rel2 version 1 (FreeB= SD), for FreeBSD 9.0 (900035), statically linked, FreeBSD-style, not stripp= ed Dynamically linked /usr/bin/size: usr/bin/size: ELF 64-bit MSB executable, MIPS, MIPS64 rel2 version 1 (FreeB= SD), for FreeBSD 9.0 (900035), dynamically linked (uses shared libs), FreeB= SD-style, not stripped For now, I've sort of worked around this by editing close to 1000 Makefiles= and making almost everything static. There must be a reason for this thoug= h. I've done a fresh update and rebuilt everything including the toolchain.= Is there something missing from my system? The loader itself? Libraries? A= n ldscript file? -- Andrew Duane Juniper Networks 978-589-0551 10 Technology Park Dr aduane@juniper.net Westford, MA 01886-341= 8 _______________________________________________ freebsd-mips@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-mips To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" From owner-freebsd-mips@FreeBSD.ORG Fri Apr 15 16:43:32 2011 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3B791065674 for ; Fri, 15 Apr 2011 16:43:32 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 78BDA8FC1C for ; Fri, 15 Apr 2011 16:43:32 +0000 (UTC) Received: by qwc9 with SMTP id 9so1835506qwc.13 for ; Fri, 15 Apr 2011 09:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Gz6wPyu4iTywGWg/q7sthTm5ImKuGo62Fp6RpYp5L5s=; b=q79EYH8LsOvIVeUSiiddEhpBI2Uo9lnA+vu01qh/ZGbjJ3f34mEUoBGA8ruiFUUbHa m1lb8jt/9Ag4n+ajYKneYZ3mhZ/ySLsDdifGH98RPtJXjcxZ0dtqa+SpNC3buqHNVJIe GOuS3N8yAfa/NxahnAGokRDsdRZXj1qCEEBWU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=IXbC03jA3pBvcvCfKQXSRHL7azfdDvsKt/P7lJCz2+Yq5b/b48BYLv0KhYeViWJtDm C+AykDcxdlnXpw+x7JDqzGLv2TsIdf9QT40C8HpS7p2d3pCRyT/+pa9HqLVuibdE9IPs AxCi/cfbaNcnqP0/GZc4JqEQxiKMxkrH0Pj0I= MIME-Version: 1.0 Received: by 10.229.100.229 with SMTP id z37mr825570qcn.133.1302883939047; Fri, 15 Apr 2011 09:12:19 -0700 (PDT) Sender: artemb@gmail.com Received: by 10.229.221.193 with HTTP; Fri, 15 Apr 2011 09:12:19 -0700 (PDT) In-Reply-To: References: Date: Fri, 15 Apr 2011 09:12:19 -0700 X-Google-Sender-Auth: QM6_5nLdiOvbcANlmzLlhIrKRnE Message-ID: From: Artem Belevich To: Andrew Duane Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "mips@freebsd.org" Subject: Re: Trouble with dynamic executables X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2011 16:43:32 -0000 On Fri, Apr 15, 2011 at 5:26 AM, Andrew Duane wrote: > I'm assuming it's a change to "ld", but it could be one of the directive = scripts. I spent yesterday combing changes to the tree, and looking for any= files that could have caused this. I came up empty, but then I'm not reall= y sure what I'm looking for. Is there a toolchain person who might know? Th= ere's a good person here at Juniper, but he's on California time.... Pass --verbose to linker and see what's in the linker script it uses. I suspect the issue may be somewhere there. You can then tweak the linker script, put .interp in the right place and pass the new script to linker with -T. That should get you by until proper toolchain fix is available. --Artem > > -- > Andrew Duane =A0 =A0 =A0 =A0 =A0 =A0 Juniper Networks > 978-589-0551 =A0 =A0 =A0 =A0 =A0 =A0 =A010 Technology Park Dr > aduane@juniper.net =A0 =A0 =A0Westford, MA =A001886-3418 > > ________________________________________ > From: bhanuprakash bodireddy [bhanuprakashbodireddy@gmail.com] > Sent: Thursday, April 14, 2011 3:11 PM > To: Andrew Duane > Cc: mips@freebsd.org > Subject: Re: Trouble with dynamic executables > > I had a similar issue the other day when i did a fresh build world. I tri= ed it to reproduce the issue you reported and its pretty much there in the = trunk. > But the last buildworld has no such issues and am still using the same ol= d fs image to boot on to the octeon boards. > > I believe, some recent fixes should have caused this. > > Thanks, > Bhanu Prakash. > > > On Thu, Apr 14, 2011 at 11:01 AM, Andrew Duane > wrote: > I've pretty much completed my board bringup of an OCTEON based board, but= am still battling one *major* issue. Dynamically linked executables do not= work at all. Any time I try to run one, I get "Exec format error" (ENOEXEC= ). Sample output from file is: > > Statically linked /bin/cat: > > bin/cat: =A0 =A0 =A0ELF 64-bit MSB executable, MIPS, MIPS64 rel2 version = 1 (FreeBSD), for FreeBSD 9.0 (900035), statically linked, FreeBSD-style, no= t stripped > > Dynamically linked /usr/bin/size: > > usr/bin/size: ELF 64-bit MSB executable, MIPS, MIPS64 rel2 version 1 (Fre= eBSD), for FreeBSD 9.0 (900035), dynamically linked (uses shared libs), Fre= eBSD-style, not stripped > > For now, I've sort of worked around this by editing close to 1000 Makefil= es and making almost everything static. There must be a reason for this tho= ugh. I've done a fresh update and rebuilt everything including the toolchai= n. Is there something missing from my system? The loader itself? Libraries?= An ldscript file? > > -- > > Andrew Duane =A0 =A0 =A0 =A0 =A0 =A0 Juniper Networks > 978-589-0551 =A0 =A0 =A0 =A0 =A0 =A0 10 Technology Park= Dr > aduane@juniper.net =A0 =A0 =A0 Westford, MA = =A001886-3418 > > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" > > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" >