diff options
author | Stephen Casner <casner@acm.org> | 2020-04-14 14:41:27 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-04-14 14:41:27 +0100 |
commit | fa1477dc34e6ce19b90ff0171074c295133730a3 (patch) | |
tree | 165b1472d16c8efe22cacada145a841f5247ac28 /ld/ld.texi | |
parent | 194d088fb1fa6c3c341994ca247d172c3f08c2da (diff) | |
download | gdb-fa1477dc34e6ce19b90ff0171074c295133730a3.zip gdb-fa1477dc34e6ce19b90ff0171074c295133730a3.tar.gz gdb-fa1477dc34e6ce19b90ff0171074c295133730a3.tar.bz2 |
Fixes for the magic number used in PDP11 AOUT binaries.
PR ld/25677
include * aout/aout64.h (N_DATADDR): Add IMAGIC case.
bfd * pdp11.c: Add implementation of --imagic option.
(adjust_o_magic): Fix objcopy --extract-symbol test.
* libaout.h (enum aout_magic): Add i_magic.
ld * emulparams/pdp11.sh (SCRIPT_NAME): Change to pdp11.
(EXTRA_EM_FILE): New, add emulation file pdp11.
* scripttempl/pdp11.sc: New, derived from aout.sc without
irrelevant input sections.
* emultempl/pdp11.em (_add_options, _handle_option)
(_list_options): New. Add options -z, --imagic for pdp11-aout.
(_before_parse): Make --omagic be default instead of --nmagic.
(_get_script): Modify special-case linker script for --imagic.
* lexsup.c (parse_args): Explictly set config.text_read_only for -n.
* ld.texi (Options): Add documentation of PDP11-specific options.
(Options): Fix unrelated typo to --no-compact-branches.
* gen-doc.texi: @set PDP11.
* testsuite/ld-pdp11/pdp11.exp: New, start pdp11 testing.
* testsuite/ld-pdp11/sections.s: New, source for options tests.
* testsuite/ld-pdp11/imagic.d: New, test --imagic format.
* testsuite/ld-pdp11/imagicz.d: New, test -z (imagic) format.
* testsuite/ld-pdp11/nmagic.d: New, test --nmagic format.
* testsuite/ld-pdp11/omagic.d: New, test --omagic format.
Diffstat (limited to 'ld/ld.texi')
-rw-r--r-- | ld/ld.texi | 70 |
1 files changed, 69 insertions, 1 deletions
@@ -31,6 +31,7 @@ @set MSP430 @set NDS32 @set NIOSII +@set PDP11 @set POWERPC @set POWERPC64 @set Renesas @@ -3260,7 +3261,7 @@ an error. @kindex --compact-branches @item --compact-branches @kindex --no-compact-branches -@item --compact-branches +@itemx --no-compact-branches These options control the generation of compact instructions by the linker in the PLT entries for MIPS R6. @@ -3269,6 +3270,73 @@ in the PLT entries for MIPS R6. @c man end @end ifset + +@ifset PDP11 +@subsection Options specific to PDP11 targets + +@c man begin OPTIONS + +For the pdp11-aout target, three variants of the output format can be +produced as selected by the following options. The default variant +for pdp11-aout is the @samp{--omagic} option, whereas for other +targets @samp{--nmagic} is the default. The @samp{--imagic} option is +defined only for the pdp11-aout target, while the others are described +here as they apply to the pdp11-aout target. + +@table @gcctabopt + +@kindex -N +@item -N +@kindex --omagic +@itemx --omagic + +Mark the output as @code{OMAGIC} (0407) in the @file{a.out} header to +indicate that the text segment is not to be write-protected and +shared. Since the text and data sections are both readable and +writable, the data section is allocated immediately contiguous after +the text segment. This is the oldest format for PDP11 executable +programs and is the default for @command{ld} on PDP11 Unix systems +from the beginning through 2.11BSD. + +@kindex -n +@item -n +@kindex --nmagic +@itemx --nmagic + +Mark the output as @code{NMAGIC} (0410) in the @file{a.out} header to +indicate that when the output file is executed, the text portion will +be read-only and shareable among all processes executing the same +file. This involves moving the data areas up to the first possible 8K +byte page boundary following the end of the text. This option creates +a @emph{pure executable} format. + +@kindex -z +@item -z +@kindex --imagic +@itemx --imagic + +Mark the output as @code{IMAGIC} (0411) in the @file{a.out} header to +indicate that when the output file is executed, the program text and +data areas will be loaded into separate address spaces using the split +instruction and data space feature of the memory management unit in +larger models of the PDP11. This doubles the address space available +to the program. The text segment is again pure, write-protected, and +shareable. The only difference in the output format between this +option and the others, besides the magic number, is that both the text +and data sections start at location 0. The @samp{-z} option selected +this format in 2.11BSD. This option creates a @emph{separate +executable} format. + +@kindex --no-omagic +@item --no-omagic + +Equivalent to @samp{--nmagic} for pdp11-aout. + +@end table + +@c man end +@end ifset + @ifset UsesEnvVars @node Environment @section Environment Variables |