[prev in list] [next in list] [prev in thread] [next in thread] 

List:       binutils
Subject:    Re: Help text for ld magic number options
From:       Stephen Casner <casner () acm ! org>
Date:       2020-02-24 21:26:32
Message-ID: alpine.OSX.2.21.9999.2002241245020.34795 () auge ! attlocal ! net
[Download RAW message or body]

On Mon, 24 Feb 2020, Andreas Schwab wrote:

> On Feb 22 2020, Stephen Casner wrote:
>
> > I propose that the help text be changed as follows:
> >
> >   -n, --nmagic     Make text readonly, page align data, no demand paging
> >   -N, --omagic     Do not make text readonly, do not page align data
> >   --no-omagic      Make text readonly, page align data, do demand paging
> >
> > Is that acceptable?  This would have implications for the ld
> > documentation as well.
>
> I think there is some confusion about what "alignment" means in this
> context.  Here is what the manpage says:
>
> 	       OMAGIC  The text	and data segments immediately follow the
> 		       header and are contiguous.  The kernel loads both text
> 		       and data	segments into writable memory.
>
> 	       NMAGIC  As with OMAGIC, text and	data segments immediately fol-
> 		       low the header and are contiguous.  However, the	kernel
> 		       loads the text into read-only memory and	loads the data
> 		       into writable memory at the next	page boundary after
> 		       the text.
>
> 	       ZMAGIC  The kernel loads	individual pages on demand from	the
> 		       binary.	The header, text segment and data segment are
> 		       all padded by the link editor to	a multiple of the page
> 		       size.  Pages that the kernel loads from the text	seg-
> 		       ment are	read-only, while pages from the	data segment
> 		       are writable.
>
> The alignment appears to refer to the padding added by the link editor
> in the ZMAGIC format.

Thanks for that clarification.  I think "padding" would be the more
operative word than "alignment" here, noting that the latter word does
not appear in the cited paragraphs.

How about:

   -n, --nmagic     Text in readonly pages, not padded for demand paging
   -N, --omagic     Do not make text readonly, do not page align data
   --no-omagic      Make text readonly, align and pad for demand paging

In both my original proposal and this one, the --no-omagic description
is inaccurate for the pdp11-aout format because padding to page
boundaries is never done, but there isn't a way to omit the common
options for some emulations.

                                                        -- Steve
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic