qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: "Andreas Färber" <andreas.faerber@web.de>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Stefan Hajnoczi" <stefanha@gmail.com>,
	"Alexander Graf" <agraf@suse.de>,
	qemu-devel <qemu-devel@nongnu.org>,
	qemu-ppc <qemu-ppc@nongnu.org>,
	"Anthony Liguori" <anthony@codemonkey.ws>,
	"Hervé Poussineau" <hpoussin@reactos.org>
Subject: Re: [Qemu-devel] Request for openhackware.git mirror
Date: Mon, 03 Mar 2014 18:42:29 +0000	[thread overview]
Message-ID: <5314CD15.5030404@ilande.co.uk> (raw)
In-Reply-To: <5314CA7F.5040303@web.de>

[-- Attachment #1: Type: text/plain, Size: 1743 bytes --]

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<rene@exactcode.de>
>
> --- 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.

[-- Attachment #2: ohw-fix-ld.patch --]
[-- Type: text/x-diff, Size: 946 bytes --]

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 = .;

  reply	other threads:[~2014-03-03 18:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-02 20:41 [Qemu-devel] Request for openhackware.git mirror Andreas Färber
2014-03-03 12:16 ` Stefan Hajnoczi
2014-03-03 18:08 ` Mark Cave-Ayland
2014-03-03 18:31   ` Andreas Färber
2014-03-03 18:42     ` Mark Cave-Ayland [this message]
2014-03-12 14:40       ` Andreas Färber
2014-03-12 17:23         ` Andreas Färber
2014-03-12 23:29           ` Mark Cave-Ayland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5314CD15.5030404@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=agraf@suse.de \
    --cc=andreas.faerber@web.de \
    --cc=anthony@codemonkey.ws \
    --cc=hpoussin@reactos.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).