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 /include | |
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 'include')
-rw-r--r-- | include/ChangeLog | 5 | ||||
-rw-r--r-- | include/aout/aout64.h | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 7964db2..97409d9 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2020-04-14 Stephen Casner <casner@acm.org> + + PR ld/25677 + * aout/aout64.h (N_DATADDR): Add IMAGIC case. + 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com> * coff/go32exe.h: Remove file. diff --git a/include/aout/aout64.h b/include/aout/aout64.h index 87f145a..f52ae41 100644 --- a/include/aout/aout64.h +++ b/include/aout/aout64.h @@ -56,6 +56,7 @@ struct external_exec #else #define OMAGIC 0407 /* Object file or impure executable. */ #define NMAGIC 0410 /* Code indicating pure executable. */ +#define IMAGIC 0411 /* Separate instruction & data spaces for PDP-11. */ #define ZMAGIC 0413 /* Code indicating demand-paged executable. */ #define BMAGIC 0415 /* Used by a b.out object. */ @@ -211,7 +212,9 @@ struct external_exec up to a N_SEGSIZE boundary for pure or pageable files. */ #ifndef N_DATADDR #define N_DATADDR(x) \ - (N_MAGIC (x) == OMAGIC \ + (N_MAGIC (x) == IMAGIC \ + ? (bfd_vma) 0 \ + : N_MAGIC (x) == OMAGIC \ ? (N_TXTADDR (x) + N_TXTSIZE (x)) \ : (N_SEGSIZE (x) + ((N_TXTADDR (x) + N_TXTSIZE (x) - 1) \ & ~ (bfd_vma) (N_SEGSIZE (x) - 1)))) |