9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] executable memory map
@ 2007-07-02 19:55 Steve Simon
  2007-07-03 18:05 ` ron minnich
  2007-07-08 20:43 ` Russ Cox
  0 siblings, 2 replies; 3+ messages in thread
From: Steve Simon @ 2007-07-02 19:55 UTC (permalink / raw)
  To: 9fans

Just to check I understand 386 executables on plan9.

.text is linked to the address 4096 + size of the a.out header (32 bytes) => 4096 + 32.
.data starts at the begining of the next 4096byte page after the .text.
.bss follows the data with no gap.

On exec the a.out file is read in its entirity to virtual address
4096 and the remainder of the file falls into place.

The parts I am unsure of are:

	1/ Is there any padding (to a 32 bit boundry or more) between .data and .bss?

	2/ Does the a.out file contain padding to ensure .data starts on a 4k boundry
	or does the kernel's loader move .data (using memcpy() or MMU mapping)?

Thanks.

-Steve


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

* Re: [9fans] executable memory map
  2007-07-02 19:55 [9fans] executable memory map Steve Simon
@ 2007-07-03 18:05 ` ron minnich
  2007-07-08 20:43 ` Russ Cox
  1 sibling, 0 replies; 3+ messages in thread
From: ron minnich @ 2007-07-03 18:05 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 7/2/07, Steve Simon <steve@quintile.net> wrote:

>         2/ Does the a.out file contain padding to ensure .data starts on a 4k boundry
>         or does the kernel's loader move .data (using memcpy() or MMU mapping)?

loader for a.out has to align the .data segment via move -- it is not
aligned in the file.

ron


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

* Re: [9fans] executable memory map
  2007-07-02 19:55 [9fans] executable memory map Steve Simon
  2007-07-03 18:05 ` ron minnich
@ 2007-07-08 20:43 ` Russ Cox
  1 sibling, 0 replies; 3+ messages in thread
From: Russ Cox @ 2007-07-08 20:43 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

>         1/ Is there any padding (to a 32 bit boundry or more) between .data and .bss?

no.


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

end of thread, other threads:[~2007-07-08 20:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-02 19:55 [9fans] executable memory map Steve Simon
2007-07-03 18:05 ` ron minnich
2007-07-08 20:43 ` Russ Cox

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 NNTP newsgroup(s).