From patchwork Mon Mar 3 18:42:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 325973 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 173152C00D2 for ; Tue, 4 Mar 2014 05:45:01 +1100 (EST) Received: from localhost ([::1]:41290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKXrG-0002QE-Vr for incoming@patchwork.ozlabs.org; Mon, 03 Mar 2014 13:44:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKXqs-0002ML-RR for qemu-devel@nongnu.org; Mon, 03 Mar 2014 13:44:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKXqm-0000cg-MM for qemu-devel@nongnu.org; Mon, 03 Mar 2014 13:44:34 -0500 Received: from s16892447.onlinehome-server.info ([82.165.15.123]:52519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKXqm-0000cL-F4; Mon, 03 Mar 2014 13:44:28 -0500 Received: from [149.241.46.152] (helo=[192.168.1.76]) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1WKXqh-0002Pc-Eq; Mon, 03 Mar 2014 18:44:24 +0000 Message-ID: <5314CD15.5030404@ilande.co.uk> Date: Mon, 03 Mar 2014 18:42:29 +0000 From: Mark Cave-Ayland User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: =?ISO-8859-15?Q?Andreas_F=E4rber?= References: <53139760.3040106@web.de> <5314C532.90304@ilande.co.uk> <5314CA7F.5040303@web.de> In-Reply-To: <5314CA7F.5040303@web.de> X-SA-Exim-Connect-IP: 149.241.46.152 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Cc: Peter Maydell , Stefan Hajnoczi , Alexander Graf , qemu-devel , qemu-ppc , Anthony Liguori , =?ISO-8859-15?Q?Herv=E9_Pouss?= =?ISO-8859-15?Q?ineau?= Subject: Re: [Qemu-devel] Request for openhackware.git mirror X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 03/03/14 18:31, Andreas Färber wrote: >> Am I missing something from the build in order for the final link to >> complete correctly? > > Hm, repository looks okay, and I didn't run into this yet. Possibly you > are using different binutils? > > Presumably you did try make clean CROSS_COMPILE=... :) > > I chose not to apply one hunk from Rene Rebe since not needed here. > Maybe the above .rodata.str1.4 would end up in .rodata this way? > > Make it link at al. > > - Rene Rebe > > --- OpenHackWare-release-0.4/src/main.ld 2005-03-31 > 09:23:33.000000000 +0200 > +++ OpenHackWare-release-0.4-hacked/src/main.ld 2008-05-06 > 11:23:29.000000000 +0200 > @@ -49,7 +49,7 @@ > _sdata_end = . ; > . = ALIGN(4) ; > _ro_start = . ; > - .rodata : { *(.rodata) }> bios > + .rodata : { *(.rodata*) }> bios > _ro_end = . ; > . = ALIGN(4) ; > _RTAS_start = .; > > Cheers, > Andreas Hi Andreas, That patch definitely helps as it reduces the error to just: powerpc-elf-ld: .objs/main.out section .text.startup will not fit in region start powerpc-elf-ld: section .text [0000000005800400 -> 0000000005812e23] overlaps section .text.startup [0000000005800054 -> 00000000058006d7] powerpc-elf-ld: region start overflowed by 728 bytes So if I then apply the same trick to the .text section (patch attached) then I get a successful link and an output image. The output image does execute under QEMU, although for all of the CD images I have it reports "ERROR: Found no boot partition!". Do you have pointers to any ISOs that can boot from the resulting image? FWIW my cross-compile setup is based upon binutils 2.19. ATB, Mark. diff --git a/Makefile b/Makefile index c0213b2..c4bf5ea 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ #DEBUG=1 -CROSS_COMPILE?=powerpc-linux- +CROSS_COMPILE?=powerpc-elf- CC:= $(CROSS_COMPILE)gcc -m32 LD:= $(CROSS_COMPILE)ld -m elf32ppc OBJCOPY:= $(CROSS_COMPILE)objcopy diff --git a/src/main.ld b/src/main.ld index f689f72..7a4f9aa 100644 --- a/src/main.ld +++ b/src/main.ld @@ -30,7 +30,7 @@ SECTIONS { .start : { *(.start) } > start . = ALIGN(4) ; - .text : { *(.text) } > bios + .text : { *(.text*) } > bios . = ALIGN(4) ; .OpenFirmware : { *(.OpenFirmware) } > bios . = ALIGN(4) ; @@ -49,7 +49,7 @@ SECTIONS _sdata_end = . ; . = ALIGN(4) ; _ro_start = . ; - .rodata : { *(.rodata) } > bios + .rodata : { *(.rodata*) } > bios _ro_end = . ; . = ALIGN(4) ; _RTAS_start = .;