diff mbox

Request for openhackware.git mirror

Message ID 5314CD15.5030404@ilande.co.uk
State New
Headers show

Commit Message

Mark Cave-Ayland March 3, 2014, 6:42 p.m. UTC
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.

Comments

Andreas Färber March 12, 2014, 2:40 p.m. UTC | #1
Am 03.03.2014 19:42, schrieb Mark Cave-Ayland:
> 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.

Mark, can you sign off .text part of the patch please for me to pick up?

Andreas

> 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.
Andreas Färber March 12, 2014, 5:23 p.m. UTC | #2
Am 12.03.2014 15:40, schrieb Andreas Färber:
> Am 03.03.2014 19:42, schrieb Mark Cave-Ayland:
>> 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.
> 
> Mark, can you sign off .text part of the patch please for me to pick up?

Never mind, pushed a minor variation with a Reported-by. Next time
please think of it.

Andreas
Mark Cave-Ayland March 12, 2014, 11:29 p.m. UTC | #3
On 12/03/14 17:23, Andreas Färber wrote:

>>> So if I then apply the same trick to the .text section (patch attached)
>>> then I get a successful link and an output image.
>>
>> Mark, can you sign off .text part of the patch please for me to pick up?
>
> Never mind, pushed a minor variation with a Reported-by. Next time
> please think of it.

Oh sorry, I didn't realise you were waiting for a SOB from me. I figured 
that the change was so trivial it could just be picked up in the next 
version of the patchset.


ATB,

Mark.
diff mbox

Patch

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