[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: hppa unexec and static variable initialization



Greetings, and thank you for your reply!

I traced this down to the old "static function pointer" issue on ia64
and hppa.  There was an instance of a pointer I had neglected to
protect.  Basically, as gcl images are output via unexec, like emacs,
pointer initializations have to remain vaild across multiple
executions.  There is some convention on these two platforms which
stores globally accessible function symbols and entry addresses in a
dynamic area of the executable, i.e. one which moves around from run
to run.  ld.so doesn't know how to relocate my function pointers, so I
have to define static function wrappers and point the pointers there.

Take care,

"Carlos O'Donell" <carlos@systemhalted.org> writes:

> On Mon, Apr 12, 2010 at 2:39 PM, Camm Maguire <camm@maguirefamily.org> wrote:
>> Greetings!
>>
>> In some code reading
>>
>> void* (*gcl_gmp_allocfun)(size_t) = alloc_relblock;
>>
>> void *
>> alloc_relblock(size_t n) {
>>
>> ...
>>
>> }
>>
>> Why is the static initialization failing?
>
> Could you please provide a full test case e.g. code, commands used in
> link, and versions of the tools?
>
> Cheers,
> Carlos.
>
>
>
>

-- 
Camm Maguire			     		    camm@maguirefamily.org
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah


Reply to: