This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
RE: Objloader question
- From: "Anthony Tonizzo" <atonizzo at lycos dot com>
- To: mark dot retallack at siemens dot com
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Fri, 26 Aug 2005 07:25:55 -0800
- Subject: [ECOS] RE: Objloader question
Mark:
> 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.
Not strictly correct, although it is might still not to solve your
problem...
The branch instructions in the PowerPC ISA reserve 24 bits for the address
(bits 6 through 29, hence the 24 in R_PPC_REL24) and the 2 least significant
bits are taken for different uses (LK and AA bits). And so the real
addressability of the R_PPC_REL24 is actually 26 bits, or, in bytes,
+/-32MB. I apologize, but the comment I put in the PPC relocator file
of the OBJLOADER package is wrong, but I found out too late.
Will correct soon.
As far as your problem is concerned, I think the "branch island"
would not be too difficult to implement. In assembler, you can define
the "jump table":
start_of_table:
diag_printf_vector diag_printf
sprintf_vector sprintf
...
...
...
and then something like this:
FAR_JUMP:
lwi r4,start_of_table
lwi r3,vector(r4)
mtlr r3
blr
where r3 can be passed as a parameter (remember to restore registers,
blah, blah)
I might have forgotten something, but in principle it should work,
and the objloader would only have to resolve the FAR_JUMP call.
A word of caution about the OBJLOADER package...
To my knowledge only one intrepid soul (Andrew Lunn) has done any tinkering
with it, and thus it might be too crude to use in sensitive application until
it gets more mileage. Knowing first hand how paranoid you transportation
engineers are about safe software, you might want to be very careful before
you rely too heavily on it.
Regards
Tony
--
_______________________________________________
Search for businesses by name, location, or phone number. -Lycos Yellow Pages
http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss