> It's "hardly believable" because it is of course not true. If by
> "the same problem" you mean the issue of adding annotations to a large
> number of functions separately, that's not a *problem* but merely an
> *annoyance*.
Hello John and all others who didn't neglect the thread this time.
Annoying ? Yes
Logical ? No
Let me specify it more clearly.
You wouldn't argue that compiler's job is producing a code,
while linker's job is binding the objects into a binary,
producing a multisegment application if necessary. Let each
one do its own job with the minimum possible interference !
By analyzing the current multisegment design, I can't get rid
of a feeling that everything there is upside down. You specify
sections at compilation stage, while logically it should be
done not before linking ! The linker provides a very flexible
engine for placing either the whole file, or only text section,
or only specified functions into a segment. Can we use for Palm
applications ? Yes, but not as far as multigen is concerned.
Using multigen makes all nice ld design useless!
Why should we pay so much ? Some people like multigen, this is
their preference, some people don't, and looks like I am not
the only one: even those who (like Dave Carrigan) found a
work arround will probably prefer a standard technique without
any patch.
Is there a way to satisfy the second party ?
A simple solution (a bit better than what I suggested yesterday):
You use __attribute__ ((longcall)) + alias:
void Foo(UInt32 par);
void StubFoo(UInt32 par) alias("Foo") __attribute((longcall);
This decalres a function Foo and its long call alias StubFoo,
used whenever the 'real' Foo is far away. When StubFoo is used
for calling, you generate a long call for Foo, that's it!
Since the section address is unavailable during compilation,
you create a place holder for section address that will be resolved
at the linker stage.
>From the user's prospective it looks really straightforward:
if you get "relocation truncated to fit" message, you create
a long call alias, and use it where it was a problem.
----------------------------------
Not a simple (but still possible) solution is making this
completely automated. You only require that each segment
should have a sufficient gap. You build a stub module
at the end of each segment and place there stubs for
long calls within current segment.
----------------------------------
Cheers,
Michael
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/