From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 10 14:59:31 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58EB01065674 for ; Tue, 10 Jul 2012 14:59:31 +0000 (UTC) (envelope-from eric@shadowsun.net) Received: from mail.atlantawebhost.com (dns1.atlantawebhost.com [66.223.40.39]) by mx1.freebsd.org (Postfix) with ESMTP id E8DF38FC19 for ; Tue, 10 Jul 2012 14:59:30 +0000 (UTC) Received: (qmail 1122 invoked from network); 10 Jul 2012 10:59:30 -0400 Received: from c-71-192-38-198.hsd1.ma.comcast.net (HELO ?192.168.1.9?) (71.192.38.198) by mail.atlantawebhost.com with SMTP; 10 Jul 2012 10:59:30 -0400 Message-ID: <4FFC0B23.1010404@shadowsun.net> Date: Tue, 10 Jul 2012 10:59:47 +0000 From: Eric McCorkle User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120704 Thunderbird/13.0.1 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Clang, EFI and bad offsets X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 14:59:31 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In the process of the EFI on intel work, I ran across a strange issue. The procedure for creating loader.efi goes something like this: 1) compile to ELF object files 2) generate an ELF executable with -Bsymbolic and a custom linker script that puts everything starting at 0x1000, and also appends some kind of data to the end of symbols (you can find this in sys/boot/i386/efi) 3) use objcopy to convert to PE format (BFD is ia32-efi-app) However, using clang for any of this seems to result in bad jump offsets being generated, which will cause the resulting program to fail. I haven't done a thorough investigation of the issues yet, but I wanted to bring it up to see if anyone has seen something similar, or has any insights. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJP/AsiAAoJENSCzbQ+koZ72N8QAL8zA/0MaHXkLpwTlNiEOZ5m a+73QS2O/uVw/Tsfge/yEcrJdXjGT0YmfmvTEKQPVSmMiZRf8KbG4FQYBKgWTHlO I/Thkw2JRj0iJOlhgp7VyOFpcLHyEdWDsst1D4Y5332j9dEa+JkIqtVTjwefSBbY OcoRkQ9Zznu3vF98BKmn1JTxdKASPMrELs5HMQ3GZop6/FMV8+SBdTFst/gvO1Wg Loe6S2IDMkcaXGYNSBrdqjkJY06wg2oSivlb44/DsSRzQSfKTkSBZ2i3r+LIUv13 cu0XFejjLd2mSPUkSgPGMwTu+PuScGY8Xe8kskJPl+F9NFzxeEdCUbYbpv8HoTJG 3xCXSun5CbkPwfSIfprUS59mAN7sBqWIOzeI5HDeboZv0WL1+7PfUJB27nAINg/D 3MocooMAZHrqsCADlsdgKrodvGp0ccG0vwrfsajho+/69JhNzRbOgllGp2Meqwfy npVBToxVrs7LtcYXkBsyshN3I9GBIjjtR+Ryn5KLCG7xJTvLP0XuYrn4XcNNXjBI ewMRCgUgdlhoS1vPItnmDkYPiIrb5SgowJSZ6Nzd/es7pTdLzRKYXkWzlTNwqY3z TtJLhzebrjfHDArvL2kHvIempyGda+ED4k4W0Ubr8Owzd1WJhRGEhgwVAeJ0hFnO CJOy14wJK32mVr2KFEjG =y2ee -----END PGP SIGNATURE-----