Subject: Re: ia64 unwind section: Loader implementation
To: Allen Briggs <briggs@netbsd.org>
From: Cherry George Mathew <cherry@sdf.lonestar.org>
List: port-ia64
Date: 12/31/2005 16:43:47
On Fri, 2005-12-30 at 09:38 -0500, Allen Briggs wrote:

> Aside from that, this seems like the best option to me, but can it
> be abstracted a little bit into an md callback?  Either to allow
> machine-specific selection of extra sections to load (I think this
> is my preference without digging into the code) or to just call a
> machine-specific routine to load what it needs?
> 

On IA64, I found it best to implement it via a simple macro which
returns boolean about whether the 
segment needs to be loaded. The macro would be passed the whole Phdr
structure which would enable 
the md hook to do post processing ( reloc type thingies ? ) if
required. 

For IA64 unwind sections, a simple one liner did the trick: 

#define MD_LOADSEG(phdr) (phdr.p_type == PT_IA_64_UNWIND ? TRUE : FALSE)

I've filed a PR: kern/32423
http://netbsd.org/cgi-bin/query-pr-single.pl?number=32423

Thanks,

Cherry