From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24032 invoked by alias); 28 Apr 2009 15:46:14 -0000 Received: (qmail 24023 invoked by uid 22791); 28 Apr 2009 15:46:13 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,SARE_HELO_EQ_DSL_3,SPF_PASS X-Spam-Check-By: sourceware.org Received: from forwards7.yandex.ru (HELO forwards7.yandex.ru) (77.88.61.48) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Apr 2009 15:45:59 +0000 Received: from smtp20.yandex.ru (smtp20.yandex.ru [77.88.61.36]) by forwards7.yandex.ru (Yandex) with ESMTP id 648E4151AEF for ; Tue, 28 Apr 2009 19:45:55 +0400 (MSD) Received: from dsl-67-55-23-131.acanac.net ([67.55.23.131]:12018 "EHLO [192.168.0.102]" smtp-auth: "i-love-spam" TLS-CIPHER: "DHE-RSA-AES256-SHA keybits 256/256 version TLSv1/SSLv3" TLS-PEER-CN1: ) by mail.yandex.ru with ESMTP id S10240048AbZD1Pps (ORCPT ); Tue, 28 Apr 2009 19:45:48 +0400 X-Yandex-TimeMark: 1240933548 X-Yandex-Spam: 1 X-Yandex-Front: smtp20 X-BornDate: 1096664400 X-Yandex-Karma: 0 X-Yandex-KarmaStatus: 0 X-MsgDayCount: 1 X-Comment: RFC 2476 MSA function at smtp20.yandex.ru logged sender identity as: i-love-spam Message-ID: <49F724A9.6000203@yandex.ru> Date: Tue, 28 Apr 2009 15:46:00 -0000 From: pps User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: binutils@sourceware.org Subject: Re: ARM-ELF -> PE-COFF with objcopy References: <49F57EBA.2020003@yandex.ru> <49F5C24C.9010408@redhat.com> <49F5DC9A.9060501@yandex.ru> <325031240867251@webmail84.yandex.ru> <378981240903482@webmail133.yandex.ru> <49F7146C.6000600@gmail.com> In-Reply-To: <49F7146C.6000600@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00405.txt.bz2 Dave Korn wrote: > Ian Lance Taylor wrote: > >> I don't really understand what you are trying to do or why you are using >> ELF at all. Why not just compile your code into PE format in the first >> place? It's all simple, I wrote an optimized version of a voice codec (amr-nb) for arm. In our project performance of the codec is *very* important, because on a simple mobile we need to decode and encode realtime multiple speech streams simultaneously (project requirement). We obtained a commercial product from one of the companies and they charge for it around 15-25K for optimized version for arm-wince. I have lots of experience working with voice codecs and I was given a task to try to optimize it even more. So far, I already beat the comercial version by around 20% while my implementation is more conformant to the specs (bit exact). With MS compiler I'm quite limited in ARM instructionset, it even rejects some of the asm functions and it doesn't support inline assembler in wince. While inspecting produced assembly listing I see some room for improvement. So, I decided to try some other compilers and see if the results are worse or better. I didn't even try gcc-ce yet, because I don't think it would be able to beat ms compiler in optimizations; the RVCT from arm.com seems to be a good choice in my case - it's ARM only compiler and optimized for arm architecture. I also was curious myself which one of them would generate better code. The only problem is that it generates ELF binaries and in wince I need pe-coff. I wrote my code in a way that it doesn't have any dependencies, it's a bunch of static const tables with data and a few functions. It doesn't allocate/free any memory dynamically also. So, I was thinking that all I need is to somehow extract the binary code and try to run it :) I also tried to produce assembly listing with RVCT, but ms assembler for arm rejects some of the instructions. Maybe I should try gnu assembler from cegcc for that? >> The only realistic way that you can create a PE DLL is to compile code >> with a PE compiler. Otherwise you aren't going to get the right code >> sequences and relocations. It is theoretically possible to pursue other >> paths but they are all going to be complex and difficult. > > What about this whole ELF->PE post-linking stuff that symbian arm-eabi > targets apparently do? Could that be adapted for wince? > Maybe that was on older devices, but right now I checked binaries produced for symbian and they are elf, not PE (I check it by opening in notepad to see ELF at the beginning :)) What surprises me is this: gcc is able to take lots of lots c++ files, preprocess them, compile etc... then link produced object files. It understands all the formats, so, why not to take produced object code from an ELF object and link it... producing a PE-coff executable??