public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Help text for ld magic number options
@ 2020-02-22 20:35 Stephen Casner
  2020-02-24  0:04 ` Fangrui Song
  2020-02-24  9:10 ` Andreas Schwab
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Casner @ 2020-02-22 20:35 UTC (permalink / raw)
  To: binutils

Thanks, Alan, for addressing bug 25569 more thoroughly than I would be
able to do.

To all, next I have three proposed changes related to the magic number
options for ld on which I solicit your feedback.  First a simple one.

The output of ld --help includes the following:

  -n, --nmagic     Do not page align data
  -N, --omagic     Do not page align data, do not make text readonly
  --no-omagic      Page align data, make text readonly

The help text for --nmagic is not accurate for the pdp11-aout target
and I believe not for others as well.  That option results in setting
config.text_read_only = TRUE, and in order to make the text read-only
the data must be aligned to a separate page on the PDP11 and I presume
for most if not all other computers as well.

The references to page alignment really correspond to the setting of
config.magic_demand_paged which, when TRUE, selects the ZMAGIC (0413)
format in aoutx.h.  That format does require the data to be page
aligned, but more significantly it indicates to the runtime system to
do demand paging.  The pdp11-aout code in bfd/pdp11.c does not
implement the ZMAGIC format (even though there is some stub code for
it included when copying from aoutx.h) since demand paging isn't
practical on the PDP11 and wasn't implemented for it over the full
timespan from Unix v6 through 2.11 BSD.  Thus, for pdp11-aout the
options --no-omagic and --nmagic produce the same result.

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.

                                                        -- Steve

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

end of thread, other threads:[~2020-02-24 21:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-22 20:35 Help text for ld magic number options Stephen Casner
2020-02-24  0:04 ` Fangrui Song
2020-02-24  1:12   ` Stephen Casner
2020-02-24  9:10 ` Andreas Schwab
2020-02-24 21:26   ` Stephen Casner

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).