public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Compiling relocatable code and DATA for PPC
@ 2004-03-24 14:47 Kate Alhola
  2004-03-24 15:22 ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: Kate Alhola @ 2004-03-24 14:47 UTC (permalink / raw)
  To: u-boot

I have been trying to find out right options to configure gcc to produce
data and code
relocatable code for mpc5xx. The -fpic -meabi -msdata=eabi -G10000
does code as relocatable but data is still absolute. -fpic is incompatible
with -msdata=eabi so they can't be used at same time.

based on gcc documentations -msdata=eabi -G10000 should
put data so long that it is smaller than valu give in -G option
to relative to r2 or r3 but i have not suceeded to do it.

I have been using gcc for producing absolute code for PPC many, many years
but now i have need to load dynamically code for non mmu PPC (mpc555).
All examples that i have found uses static addresses. Also using
google i have not found any answers.

I have tried many forums to find answer but i am still trying to find
it. Also i am happy to get pointers to forums/places where i can continue
my search.


Kate

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] Compiling relocatable code and DATA for PPC
  2004-03-24 14:47 [U-Boot-Users] Compiling relocatable code and DATA for PPC Kate Alhola
@ 2004-03-24 15:22 ` Wolfgang Denk
  2004-03-25  9:13   ` Kate Alhola
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2004-03-24 15:22 UTC (permalink / raw)
  To: u-boot

In message <40619F6F.40605@iti.fi> you wrote:
> I have been trying to find out right options to configure gcc to produce
> data and code

If this is for U-Boot, why don't you just the pre-configured options?
They work fine.

> relocatable code for mpc5xx. The -fpic -meabi -msdata=eabi -G10000
> does code as relocatable but data is still absolute. -fpic is incompatible

This sounds as if you do not understand what  relocatable  means.  Of
course relocatable code may use absolute addressing. "relocatable" is
different from "position independent".

> I have been using gcc for producing absolute code for PPC many, many years
> but now i have need to load dynamically code for non mmu PPC (mpc555).

What is your environment? U-Boot?

> All examples that i have found uses static addresses. Also using
> google i have not found any answers.

You will either have to use PIC (which is not what U-Boot  does),  or
use  a  static link address (which is what U-Boot does for standalone
applications), or  use  relocatable  code  that  you  can  (manually)
relocate  to  a  target  address of your choice (which is what U-Boot
does for the U-Boot code itself).


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
To be is to program.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] Compiling relocatable code and DATA for PPC
  2004-03-24 15:22 ` Wolfgang Denk
@ 2004-03-25  9:13   ` Kate Alhola
  0 siblings, 0 replies; 3+ messages in thread
From: Kate Alhola @ 2004-03-25  9:13 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:

>>All examples that i have found uses static addresses. Also using
>>google i have not found any answers.
>>    
>>
>
>You will either have to use PIC (which is not what U-Boot  does),  or
>use  a  static link address (which is what U-Boot does for standalone
>applications), or  use  relocatable  code  that  you  can  (manually)
>relocate  to  a  target  address of your choice (which is what U-Boot
>does for the U-Boot code itself).
>  
>
The thing that i like to use is PIC and PID ( position independent data 
and code ).
U-boot allows to load my code in any address and i really don't like to 
manually
relocate it. I like to have ready compiled code parts in mass media ( 
flash ) and
i like to to allow load them to any free address.

There is this same problem allways if you use non-mmu processor like MPC555
and you like to load more than just one fixed program into memory.
You should remember that the applications loaded with u-boot are not
allways just "stand-alone" apps or Linux. Based on my knowledge there is
not even Linux for mpc555. I our case i like to load my open source rtos
kernel ( Katix ) and then applications for it.

Becouse u-boot runs in many non-mmu processors i was just thinking
that some u-boot user has had same problem and find already answer.

I have searched all around internet to find answer but not yet find one. 
-fpic should
make program code position independent and -msdata=eabi -G20000
should put all static data smaller than 20000 bytes to relative to 
r2(const data)
or r13 . For some reason gcc says that -msdata=eabi and -fpic
are incompatible and even -msdata=eabi does not make data references
as register relative.


Kate

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-03-25  9:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-24 14:47 [U-Boot-Users] Compiling relocatable code and DATA for PPC Kate Alhola
2004-03-24 15:22 ` Wolfgang Denk
2004-03-25  9:13   ` Kate Alhola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox