Comments requested for proposed for ld scripting language extension

Catherine Moore clm@codesourcery.com
Thu Apr 28 16:48:00 GMT 2011


I've been working on a binutils port to the Freescale VLE part, more 
specifically, on interlinking.  For those not familiar with the 
requirements, interlinking is a bit different than for other ports such 
as ARM and MIPS.  There are no special call instructions or mode 
switches.  BookE and VLE instructions can be intermixed as long as they 
reside in separate ELF sections.  The VLE instruction sections are 
marked with a PowerPC-specific section header (SHF_PPC_VLE).

Because we have so many "specially named" sections .gnu.linkonce, .text, 
.init, and friends, I want to avoid a scheme that relies on a naming 
convention to differentiate between VLE sections and BookE sections. 
What I would like to do is add an extension to the scripting language. 
Something like this:

MEMORY
{
   ram (rwx) : ORIGIN = 0x100000, LENGTH = 144M
}

SECTIONS
{
   .text : WITHOUT_FLAGS (SHF_PPC_VLE)
   {
     *(.text .text.* .gnu.linkonce.t.*)
   } >ram
   .text_vle : WITH_FLAGS (SHF_PPC_VLE)
   {
     *(.text .text.* .gnu.linkonce.t.*)
   } >ram
}

map_input_to_output_sections would then walk the input sections for 
those sections with an optional "FLAG" marker.  A callback would be 
introduced that would examine the ELF header flags for the input 
sections and gather only those that met the criteria.

I realize that this is an ELF-centric proposal.  Although it could be 
extended to include other object formats, I haven't given that aspect 
alot of thought.

Before I spend time on development, I'd like to solicit comments ahead 
of time.  How do the maintainers and others feel about this plan?

Thanks,
Catherine



More information about the Binutils mailing list