public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Specifying Segment Attributes
@ 2005-08-29 19:25 Prasad Venkata Boddupalli
  2005-08-30  0:51 ` Daniel Jacobowitz
  2005-08-30  9:47 ` Nick Clifton
  0 siblings, 2 replies; 3+ messages in thread
From: Prasad Venkata Boddupalli @ 2005-08-29 19:25 UTC (permalink / raw)
  To: binutils

Hello,

I am writing a loader for a multi-threaded processor in which multiple
instances of an application run on different threads. Multiple
instances, besides their data segments mapped to a different physical
location also have a shared memory. The loader needs to recognize this
shared segment in the elf-executable. From the elf specification and the
linker script command language, I realized that one of the ways of
specifying the segment attribute as 'shared' is to use the 'PHDRS' command
and specify the attribute as part of the 'flags' of that segment.

Is there any other way as the use of PHDRS command will force one to
describe all segments ?

thanks,
Prasad.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Specifying Segment Attributes
  2005-08-29 19:25 Specifying Segment Attributes Prasad Venkata Boddupalli
@ 2005-08-30  0:51 ` Daniel Jacobowitz
  2005-08-30  9:47 ` Nick Clifton
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2005-08-30  0:51 UTC (permalink / raw)
  To: Prasad Venkata Boddupalli; +Cc: binutils

On Mon, Aug 29, 2005 at 12:25:22PM -0700, Prasad Venkata Boddupalli wrote:
> Hello,
> 
> I am writing a loader for a multi-threaded processor in which multiple
> instances of an application run on different threads. Multiple
> instances, besides their data segments mapped to a different physical
> location also have a shared memory. The loader needs to recognize this
> shared segment in the elf-executable. From the elf specification and the
> linker script command language, I realized that one of the ways of
> specifying the segment attribute as 'shared' is to use the 'PHDRS' command
> and specify the attribute as part of the 'flags' of that segment.
> 
> Is there any other way as the use of PHDRS command will force one to
> describe all segments ?

Not without changing the linker.

From something I sent to Ian last week, off list, so increment the
"third":

> This is the third time in the last couple of weeks that I've felt we                                  
> needed a mechanism to add an additional program header explicitly:                                    
> give it a name, add one to the number estimated by SIZEOF_HEADERS,                                    
> allow sections to be assigned to it... do you think it could be                                       
> feasibly implemented?  I haven't looked at the magic behind                                           
> SIZEOF_HEADERS.                                                                                       
>                                                                                                       
> But making folks define PHDRS manually when they really just want to                                  
> extend it is a real nuisance.                                                                         

Ian made some other suggestions, that I'll let him share if he wants
to, but I'm still attached to mine :-)

-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Specifying Segment Attributes
  2005-08-29 19:25 Specifying Segment Attributes Prasad Venkata Boddupalli
  2005-08-30  0:51 ` Daniel Jacobowitz
@ 2005-08-30  9:47 ` Nick Clifton
  1 sibling, 0 replies; 3+ messages in thread
From: Nick Clifton @ 2005-08-30  9:47 UTC (permalink / raw)
  To: Prasad Venkata Boddupalli; +Cc: binutils

Hi Prasad,

> location also have a shared memory. The loader needs to recognize this
> shared segment in the elf-executable. From the elf specification and the
> linker script command language, I realized that one of the ways of
> specifying the segment attribute as 'shared' is to use the 'PHDRS' command
> and specify the attribute as part of the 'flags' of that segment.
> 
> Is there any other way as the use of PHDRS command will force one to
> describe all segments ?

How about using memory regions ?  If you decide that the shared memory 
will always start at a specific, high address you could create a MEMORY 
region to describe this, and then assign any sections in the input files 
that need to go into shared memory to this region.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-08-30  9:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-29 19:25 Specifying Segment Attributes Prasad Venkata Boddupalli
2005-08-30  0:51 ` Daniel Jacobowitz
2005-08-30  9:47 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).