[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To use multiple code resources in an existing application, you need to do the following:
obj-res
, change it to use
build-prc
directly on your bfd executable. For example,
from an original
myapp.prc: code0000.myapp.grc … build-prc … *.myapp.grc … code0000.myapp.grc: myapp m68k-palmos-obj-res myapp |
remove references to .grc files, and delete the obj-res rule altogether:
myapp.prc: myapp … build-prc … myapp … |
#define EDIT_SECTION __attribute__ ((section ("editfns"))) void EditFormHandler (…) EDIT_SECTION; void DrawEditForm () EDIT_SECTION; |
(This also demonstrates using a macro to ease moving several functions at once.)
Make very sure that the relevant annotated declaration is visible when you define such a function, and especially everywhere you call it. If there is a call to a non-default sectioned function from which the annotated declaration is not visible, the call will be generated as a call to the default code section. When such a call is executed, it jumps to effectively a random location in the wrong code section and almost certainly crashes. (Warning options which can detect these mistakes at compile time are noted in the discussion of required visibilities in Function attributes.)
Note that COFF only stores eight character of a section name: if your section names are any longer than this, they will be truncated, leading to trouble.
multiple code { "editfns" } |
Or, if you're not already using a definition file, write one including such a clause and use it in your build-prc command:
myapp.prc: myapp.def myapp … build-prc … myapp.def myapp … |
myapp-sections.o: myapp-sections.s m68k-palmos-gcc -c myapp-sections.s myapp-sections.s myapp-sections.ld: myapp.def m68k-palmos-multigen myapp.def |
OBJS = …list of object files… myapp-sections.o myapp: $(OBJS) myapp-sections.ld m68k-palmos-gcc -o myapp $(OBJS) myapp-sections.ld |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by root on October, 25 2005 using texi2html 1.76.