/* BFD back-end for PDP-11 a.out binaries.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
/* BFD backend for PDP-11, running 2.11BSD in particular.
/* The header is not included in the text segment. */
#define N_HEADER_IN_TEXT(x) 0
-/* There are no shared libraries. */
-#define N_SHARED_LIB(x) 0
-
/* There is no flags field. */
#define N_FLAGS(exec) 0
#define N_SET_FLAGS(exec, flags) do { } while (0)
-#define N_BADMAG(x) (((x).a_info != OMAGIC) \
- && ((x).a_info != NMAGIC) \
- && ((x).a_info != A_MAGIC3) \
- && ((x).a_info != A_MAGIC4) \
- && ((x).a_info != A_MAGIC5) \
- && ((x).a_info != A_MAGIC6))
+#define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \
+ && N_MAGIC(x) != NMAGIC \
+ && N_MAGIC(x) != ZMAGIC)
+#include "sysdep.h"
#include "bfd.h"
#define external_exec pdp11_external_exec
#define WRITE_HEADERS(abfd, execp) pdp11_aout_write_headers (abfd, execp)
-#include "sysdep.h"
#include "libbfd.h"
#include "libaout.h"
abfd->flags |= D_PAGED | WP_TEXT;
adata (abfd).magic = z_magic;
}
- else if (N_MAGIC (*execp) == QMAGIC)
- {
- abfd->flags |= D_PAGED | WP_TEXT;
- adata (abfd).magic = z_magic;
- adata (abfd).subformat = q_magic_format;
- }
else if (N_MAGIC (*execp) == NMAGIC)
{
abfd->flags |= WP_TEXT;
adata (abfd).magic = n_magic;
}
- else if (N_MAGIC (*execp) == OMAGIC
- || N_MAGIC (*execp) == BMAGIC)
+ else if (N_MAGIC (*execp) == OMAGIC)
adata (abfd).magic = o_magic;
else
{
execp->a_text = obj_textsec(abfd)->size;
if (ztih && (!abdp || (abdp && !abdp->exec_header_not_counted)))
execp->a_text += adata(abfd).exec_bytes_size;
- if (obj_aout_subformat (abfd) == q_magic_format)
- N_SET_MAGIC (*execp, QMAGIC);
- else
- N_SET_MAGIC (*execp, ZMAGIC);
+ N_SET_MAGIC (*execp, ZMAGIC);
/* Spec says data section should be rounded up to page boundary. */
obj_datasec(abfd)->size
NAME (aout, make_empty_symbol) (bfd *abfd)
{
bfd_size_type amt = sizeof (aout_symbol_type);
- aout_symbol_type *new = bfd_zalloc (abfd, amt);
+ aout_symbol_type *new_symbol_type = bfd_zalloc (abfd, amt);
- if (!new)
+ if (!new_symbol_type)
return NULL;
- new->symbol.the_bfd = abfd;
+ new_symbol_type->symbol.the_bfd = abfd;
- return &new->symbol;
+ return &new_symbol_type->symbol;
}
/* Translate a set of internal symbols into external symbols. */
bfd_boolean copy)
{
bfd_boolean hash;
- bfd_size_type index;
+ bfd_size_type str_index;
/* An index of 0 always means the empty string. */
if (str == 0 || *str == '\0')
if ((abfd->flags & BFD_TRADITIONAL_FORMAT) != 0)
hash = FALSE;
- index = _bfd_stringtab_add (tab, str, hash, copy);
+ str_index = _bfd_stringtab_add (tab, str, hash, copy);
- if (index != (bfd_size_type) -1)
+ if (str_index != (bfd_size_type) -1)
/* Add BYTES_IN_LONG to the return value to account for the
space taken up by the string table size. */
- index += BYTES_IN_LONG;
+ str_index += BYTES_IN_LONG;
- return index;
+ return str_index;
}
/* Write out a strtab. ABFD is already at the right location in the