This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help text for ld magic number options


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.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]