This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Objloader question
- From: "Retallack, Mark \(Siemens\)" <mark dot retallack at siemens dot com>
- To: <ecos-discuss at ecos dot sourceware dot org>
- Date: Fri, 26 Aug 2005 10:13:07 +0100
- Subject: [ECOS] Objloader question
Sorry if this is a repeat mail, problems with the mail server.
Hello, I have just been looking at the new objloader (a very useful and
cool package), and I have run into a problem.
I have written a very simple test app to see how it works, all the app
does is export the open_library and a myapp function. When the myapp
function is loaded and called, it should just call the diag_printf
function. However the diag_printf function is stored in flash (starts
at 0x40000000) and the myapp function is stored in ram (starts at
0x00000000).
In the myapp.o file, the diag_printf function is defined as a
R_PPC_REL24 relocatable entry, I am running a PowerPC system which
means that it is not possible to perform a branch over the 16MB
boundary. To get this to work I need a method of making the R_PPC_REL24
perform a jump instead.
I have looked into the following options:
Option 1: Use gcc with the -mlongcall option.
I have looked at the gcc manual and I believe this should work, however
my version of gcc (3.2.1) does not support the -mlongcall option and I
would prefer not to have to use a different gcc toolchain.
Option 2: Add a branch island
This would be a ram located "trampoline" than would perform a jump to
the diag_printf in flash when is is called from the myapp function. This
looks like the best long term solution, but I still need to come up with
a way of doing it.
Does anyone have any other ideas? I did think that the MMU could be used
somehow?
Thanks in advance.
Mark Retallack
Embedded Software Engineer
Siemens Traffic Controls
Sopers Lane, Poole, Dorset. BH17 7ER. UK.
Tel: 01202 782189
Fax: 01202 782545
www.siemenstraffic.com
Committed to quality traffic solutions and service excellence
Todays Quote:
I can't decide which WRONG TURN to make first!!
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss