Remove netware support

include/
	* nlm/ChangeLog-9315: Delete.
	* nlm/alpha-ext.h: Delete.
	* nlm/common.h: Delete.
	* nlm/external.h: Delete.
	* nlm/i386-ext.h: Delete.
	* nlm/internal.h: Delete.
	* nlm/ppc-ext.h: Delete.
	* nlm/sparc32-ext.h: Delete.
bfd/
	* Makefile.am: Remove netware support.
	* bfd-in.h: Likewise.
	* bfd.c: Likewise.
	* config.bfd: Likewise.
	* configure.ac: Likewise.
	* doc/bfdint.texi: Likewise.
	* ecoff.c: Likewise.
	* targets.c: Likewise.
	* libnlm.h: Delete.
	* nlm-target.h: Delete.
	* nlm.c: Delete.
	* nlm32-alpha.c: Delete.
	* nlm32-i386.c: Delete.
	* nlm32-ppc.c: Delete.
	* nlm32-sparc.c: Delete.
	* nlm32.c: Delete.
	* nlm64.c: Delete.
	* nlmcode.h: Delete.
	* nlmswap.h: Delete.
	* Makefile.in: Regenerate.
	* bfd-in2.h: Regenerate.
	* configure: Regenerate.
	* po/SRC-POTFILES.in: Regenerate.
binutils/
	* .gitignore: Remove netware support.
	* Makefile.am: Likewise.
	* configure.ac: Likewise.
	* doc/Makefile.am: Likewise.
	* doc/binutils.texi: Likewise.
	* testsuite/binutils-all/nm.exp: Likewise.
	* nlmconv.c: Delete.
	* nlmconv.h: Delete.
	* nlmheader.y: Delete.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.
gas/
	* Makefile.am: Remove netware support.
	* config/tc-i386.c: Likewise.
	* configure.tgt: Likewise.
	* config/te-netware.h: Delete.
	* Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.
gprof/
	* corefile.c: Remove netware support.
ld/
	* Makefile.am: Remove netware support.
	* configure.tgt: Likewise.
	* testsuite/ld-powerpc/powerpc.exp: Likewise.
	* emulparams/i386nw.sh: Delete.
	* emulparams/ppcnw.sh: Delete.
	* scripttempl/nw.sc: Delete.
	* Makefile.in: Regenerate.
	* po/BLD-POTFILES.in: Regenerate.
This commit is contained in:
Alan Modra 2018-04-16 15:11:22 +09:30
parent fceadf0951
commit b4b594e304
65 changed files with 135 additions and 10547 deletions

View File

@ -1,3 +1,29 @@
2018-04-16 Alan Modra <amodra@gmail.com>
* Makefile.am: Remove netware support.
* bfd-in.h: Likewise.
* bfd.c: Likewise.
* config.bfd: Likewise.
* configure.ac: Likewise.
* doc/bfdint.texi: Likewise.
* ecoff.c: Likewise.
* targets.c: Likewise.
* libnlm.h: Delete.
* nlm-target.h: Delete.
* nlm.c: Delete.
* nlm32-alpha.c: Delete.
* nlm32-i386.c: Delete.
* nlm32-ppc.c: Delete.
* nlm32-sparc.c: Delete.
* nlm32.c: Delete.
* nlm64.c: Delete.
* nlmcode.h: Delete.
* nlmswap.h: Delete.
* Makefile.in: Regenerate.
* bfd-in2.h: Regenerate.
* configure: Regenerate.
* po/SRC-POTFILES.in: Regenerate.
2018-04-16 Alan Modra <amodra@gmail.com>
* archures.c: Remove tahoe support.

View File

@ -411,11 +411,6 @@ BFD32_BACKENDS = \
mach-o-arm.lo \
mipsbsd.lo \
newsos3.lo \
nlm.lo \
nlm32-i386.lo \
nlm32-ppc.lo \
nlm32-sparc.lo \
nlm32.lo \
ns32knetbsd.lo \
oasys.lo \
pc532-mach.lo \
@ -602,11 +597,6 @@ BFD32_BACKENDS_CFILES = \
mach-o-arm.c \
mipsbsd.c \
newsos3.c \
nlm.c \
nlm32-i386.c \
nlm32-ppc.c \
nlm32-sparc.c \
nlm32.c \
ns32knetbsd.c \
oasys.c \
pc532-mach.c \
@ -690,8 +680,6 @@ BFD64_BACKENDS = \
mach-o-aarch64.lo \
mach-o-x86-64.lo \
mmo.lo \
nlm32-alpha.lo \
nlm64.lo \
pe-x86_64.lo \
pei-ia64.lo \
pei-x86_64.lo \
@ -731,8 +719,6 @@ BFD64_BACKENDS_CFILES = \
mach-o-aarch64.c \
mach-o-x86-64.c \
mmo.c \
nlm32-alpha.c \
nlm64.c \
pe-x86_64.c \
pei-ia64.c \
pei-x86_64.c \
@ -804,8 +790,8 @@ SOURCE_HFILES = \
elf64-hppa.h elfcode.h elfcore.h \
freebsd.h genlink.h go32stub.h \
libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h \
libnlm.h liboasys.h libpei.h libxcoff.h mach-o.h \
netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h \
liboasys.h libpei.h libxcoff.h mach-o.h \
netbsd.h ns32k.h \
pef.h pef-traceback.h peicode.h som.h version.h \
vms.h xsym.h

View File

@ -745,11 +745,6 @@ BFD32_BACKENDS = \
mach-o-arm.lo \
mipsbsd.lo \
newsos3.lo \
nlm.lo \
nlm32-i386.lo \
nlm32-ppc.lo \
nlm32-sparc.lo \
nlm32.lo \
ns32knetbsd.lo \
oasys.lo \
pc532-mach.lo \
@ -936,11 +931,6 @@ BFD32_BACKENDS_CFILES = \
mach-o-arm.c \
mipsbsd.c \
newsos3.c \
nlm.c \
nlm32-i386.c \
nlm32-ppc.c \
nlm32-sparc.c \
nlm32.c \
ns32knetbsd.c \
oasys.c \
pc532-mach.c \
@ -1025,8 +1015,6 @@ BFD64_BACKENDS = \
mach-o-aarch64.lo \
mach-o-x86-64.lo \
mmo.lo \
nlm32-alpha.lo \
nlm64.lo \
pe-x86_64.lo \
pei-ia64.lo \
pei-x86_64.lo \
@ -1066,8 +1054,6 @@ BFD64_BACKENDS_CFILES = \
mach-o-aarch64.c \
mach-o-x86-64.c \
mmo.c \
nlm32-alpha.c \
nlm64.c \
pe-x86_64.c \
pei-ia64.c \
pei-x86_64.c \
@ -1139,8 +1125,8 @@ SOURCE_HFILES = \
elf64-hppa.h elfcode.h elfcore.h \
freebsd.h genlink.h go32stub.h \
libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h \
libnlm.h liboasys.h libpei.h libxcoff.h mach-o.h \
netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h \
liboasys.h libpei.h libxcoff.h mach-o.h \
netbsd.h ns32k.h \
pef.h pef-traceback.h peicode.h som.h version.h \
vms.h xsym.h
@ -1594,13 +1580,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmo.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netbsd-core.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newsos3.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlm32-alpha.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlm32-i386.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlm32-ppc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlm32-sparc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlm32.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlm64.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ns32knetbsd.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oasys.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opncls.Plo@am__quote@

View File

@ -608,8 +608,6 @@ extern bfd_boolean _bfd_handle_already_linked
/* Externally visible ECOFF routines. */
extern bfd_vma bfd_ecoff_get_gp_value
(bfd * abfd);
extern bfd_boolean bfd_ecoff_set_gp_value
(bfd *abfd, bfd_vma gp_value);
extern bfd_boolean bfd_ecoff_set_regmasks

View File

@ -615,8 +615,6 @@ extern bfd_boolean _bfd_handle_already_linked
/* Externally visible ECOFF routines. */
extern bfd_vma bfd_ecoff_get_gp_value
(bfd * abfd);
extern bfd_boolean bfd_ecoff_set_gp_value
(bfd *abfd, bfd_vma gp_value);
extern bfd_boolean bfd_ecoff_set_regmasks
@ -7015,7 +7013,6 @@ struct bfd
struct ihex_data_struct *ihex_data;
struct tekhex_data_struct *tekhex_data;
struct elf_obj_tdata *elf_obj_data;
struct nlm_obj_tdata *nlm_obj_data;
struct mmo_data_struct *mmo_data;
struct sun_core_struct *sun_core_data;
struct sco5_core_struct *sco5_core_data;
@ -7325,7 +7322,6 @@ enum bfd_flavour
bfd_target_xcoff_flavour,
bfd_target_elf_flavour,
bfd_target_ieee_flavour,
bfd_target_nlm_flavour,
bfd_target_oasys_flavour,
bfd_target_tekhex_flavour,
bfd_target_srec_flavour,

View File

@ -317,7 +317,6 @@ CODE_FRAGMENT
. struct ihex_data_struct *ihex_data;
. struct tekhex_data_struct *tekhex_data;
. struct elf_obj_tdata *elf_obj_data;
. struct nlm_obj_tdata *nlm_obj_data;
. struct mmo_data_struct *mmo_data;
. struct sun_core_struct *sun_core_data;
. struct sco5_core_struct *sco5_core_data;

View File

@ -57,7 +57,6 @@ case $targ in
mips*-*-irix5* | mips*-*-irix6*)
# Not obsolete
;;
*-*-netware* | \
arm-epoc-pe* | \
arm*-*-aout | \
arm*-*-coff | \
@ -75,7 +74,6 @@ case $targ in
i[3-7]86-*-freebsd[12] | \
i[3-7]86-*-netbsdaout* | i[3-7]86-*-netbsd* | \
i[3-7]86-*-openbsd[0-2].* | i[3-7]86-*-openbsd3.[0-3] | \
i[3-7]86-*-netware* | \
i[3-7]86-*-linux*aout* | \
i[3-7]86-*-mach* | i[3-7]86-*-osf1mk* | \
i[3-7]86-*-os9k | \
@ -106,7 +104,6 @@ case $targ in
sparc-*-linux*aout* | \
sparc-*-netbsdaout* | \
sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1] | \
sparc-*-netware* | \
sparc64-*-aout* | \
sparc*-*-coff* | \
vax-*-bsd* | vax-*-ultrix* | \
@ -130,6 +127,7 @@ esac
case $targ in
*-adobe-* | \
*-go32-rtems* | \
*-*-netware* | \
*-*-rtemsaout* | \
*-*-rtemscoff* | \
a29k-* | \
@ -294,11 +292,6 @@ case "${targ}" in
targ_selvecs=alpha_ecoff_le_vec
want64=true
;;
alpha*-*-netware*)
targ_defvec=alpha_ecoff_le_vec
targ_selvecs=alpha_nlm32_vec
want64=true
;;
alpha*-*-linux*ecoff*)
targ_defvec=alpha_ecoff_le_vec
targ_selvecs=alpha_elf64_vec
@ -732,10 +725,6 @@ case "${targ}" in
targ_defvec=i386_elf32_vec
targ_selvecs="iamcu_elf32_vec i386_aout_nbsd_vec"
;;
i[3-7]86-*-netware*)
targ_defvec=i386_elf32_vec
targ_selvecs="iamcu_elf32_vec i386_nlm32_vec i386_coff_vec i386_aout_vec"
;;
i[3-7]86-*-linux*aout*)
targ_defvec=i386_aout_linux_vec
targ_selvecs="i386_elf32_vec iamcu_elf32_vec"
@ -1384,10 +1373,6 @@ case "${targ}" in
targ_selvecs="rs6000_xcoff_vec"
targ_cflags=-DSMALL_ARCHIVE
;;
powerpc-*-netware*)
targ_defvec=powerpc_elf32_vec
targ_selvecs="powerpc_nlm32_vec rs6000_xcoff_vec"
;;
powerpc-*-nto*)
targ_defvec=powerpc_elf32_vec
targ_selvecs="rs6000_xcoff_vec powerpc_elf32_le_vec powerpc_boot_vec"
@ -1665,10 +1650,6 @@ case "${targ}" in
targ_defvec=sparc_elf32_vxworks_vec
targ_selvecs="sparc_elf32_vec sparc_aout_sunos_be_vec"
;;
sparc-*-netware*)
targ_defvec=sparc_elf32_vec
targ_selvecs="sparc_nlm32_vec sparc_aout_sunos_be_vec"
;;
#ifdef BFD64
sparc64-*-aout*)
targ_defvec=sparc_aout_sunos_be_vec

4
bfd/configure vendored
View File

@ -14337,7 +14337,6 @@ do
alpha_ecoff_le_vec) tb="$tb coff-alpha.lo ecoff.lo $ecoff"; target_size=64 ;;
alpha_elf64_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
alpha_elf64_fbsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
alpha_nlm32_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;;
alpha_vms_vec) tb="$tb vms-alpha.lo vms-misc.lo vms-lib.lo"; target_size=64 ;;
alpha_vms_lib_txt_vec) tb="$tb vms-lib.lo vms-misc.lo" ;;
am33_elf32_linux_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
@ -14424,7 +14423,6 @@ do
i386_elf32_vxworks_vec) tb="$tb elf32-i386.lo elfxx-x86.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
i386_mach_o_vec) tb="$tb mach-o-i386.lo" ;;
i386_msdos_vec) tb="$tb i386msdos.lo" ;;
i386_nlm32_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
i386_pe_vec) tb="$tb pe-i386.lo peigen.lo $coff" ;;
i386_pei_vec) tb="$tb pei-i386.lo peigen.lo $coff" ;;
iamcu_elf32_vec) tb="$tb elf32-i386.lo elfxx-x86.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
@ -14539,7 +14537,6 @@ do
powerpc_elf64_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
powerpc_elf64_le_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
powerpc_elf64_fbsd_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
powerpc_nlm32_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo $coff" ;;
powerpc_pe_le_vec) tb="$tb pe-ppc.lo peigen.lo $coff" ;;
powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo $coff" ;;
@ -14601,7 +14598,6 @@ do
sparc_elf64_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
sparc_elf64_fbsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
sparc_elf64_sol2_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
sparc_nlm32_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
spu_elf32_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;;
sym_vec) tb="$tb xsym.lo" ;;
tic30_aout_vec) tb="$tb aout-tic30.lo" ;;

View File

@ -414,7 +414,6 @@ do
alpha_ecoff_le_vec) tb="$tb coff-alpha.lo ecoff.lo $ecoff"; target_size=64 ;;
alpha_elf64_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
alpha_elf64_fbsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
alpha_nlm32_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;;
alpha_vms_vec) tb="$tb vms-alpha.lo vms-misc.lo vms-lib.lo"; target_size=64 ;;
alpha_vms_lib_txt_vec) tb="$tb vms-lib.lo vms-misc.lo" ;;
am33_elf32_linux_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
@ -501,7 +500,6 @@ do
i386_elf32_vxworks_vec) tb="$tb elf32-i386.lo elfxx-x86.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
i386_mach_o_vec) tb="$tb mach-o-i386.lo" ;;
i386_msdos_vec) tb="$tb i386msdos.lo" ;;
i386_nlm32_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
i386_pe_vec) tb="$tb pe-i386.lo peigen.lo $coff" ;;
i386_pei_vec) tb="$tb pei-i386.lo peigen.lo $coff" ;;
iamcu_elf32_vec) tb="$tb elf32-i386.lo elfxx-x86.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
@ -616,7 +614,6 @@ do
powerpc_elf64_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
powerpc_elf64_le_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
powerpc_elf64_fbsd_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
powerpc_nlm32_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo $coff" ;;
powerpc_pe_le_vec) tb="$tb pe-ppc.lo peigen.lo $coff" ;;
powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo $coff" ;;
@ -678,7 +675,6 @@ do
sparc_elf64_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
sparc_elf64_fbsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
sparc_elf64_sol2_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
sparc_nlm32_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
spu_elf32_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;;
sym_vec) tb="$tb xsym.lo" ;;
tic30_aout_vec) tb="$tb aout-tic30.lo" ;;

View File

@ -338,8 +338,6 @@ ECOFF.
ELF.
@item bfd_target_ieee_flavour
IEEE-695.
@item bfd_target_nlm_flavour
NLM.
@item bfd_target_oasys_flavour
OASYS.
@item bfd_target_tekhex_flavour
@ -1116,23 +1114,6 @@ various macros, and includes @file{aout-target.h}.
Like @file{freebsd.h}, except that there are several files which include
it.
@item nlm-target.h
@cindex @file{nlm-target.h}
Defines the target vector for a standard NLM target.
@item nlmcode.h
@cindex @file{nlmcode.h}
Like @file{elfcode.h}, but for NLM targets. This is only included by
@file{nlm32.c} and @file{nlm64.c}, both of which define the macro
@samp{ARCH_SIZE} to an appropriate value. There are no 64 bit NLM
targets anyhow, so this is sort of useless.
@item nlmswap.h
@cindex @file{nlmswap.h}
Like @file{coffswap.h}, but for NLM targets. This is included by each
NLM target, but I think it winds up compiling to the exact same code for
every target, and as such is fairly useless.
@item peicode.h
@cindex @file{peicode.h}
Provides swapping routines and other hooks for PE targets.
@ -1826,11 +1807,6 @@ information. Normally produced by a linker.
Load Memory Address. This is the address at which a section will be
loaded. Compare with VMA, below.
@item NLM
NetWare Loadable Module. Used to describe the format of an object which
be loaded into NetWare, which is some kind of PC based network server
program.
@item object file
A binary file including machine instructions, symbols, and relocation
information. Normally produced by an assembler.

View File

@ -2218,22 +2218,6 @@ _bfd_ecoff_set_section_contents (bfd *abfd,
return TRUE;
}
/* Get the GP value for an ECOFF file. This is a hook used by
nlmconv. */
bfd_vma
bfd_ecoff_get_gp_value (bfd *abfd)
{
if (bfd_get_flavour (abfd) != bfd_target_ecoff_flavour
|| bfd_get_format (abfd) != bfd_object)
{
bfd_set_error (bfd_error_invalid_operation);
return 0;
}
return ecoff_data (abfd)->gp;
}
/* Set the GP value for an ECOFF file. This is a hook used by the
assembler. */

View File

@ -1,222 +0,0 @@
/* BFD back-end data structures for NLM (NetWare Loadable Modules) files.
Copyright (C) 1993-2018 Free Software Foundation, Inc.
Written by Cygnus Support.
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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
#ifndef _LIBNLM_H_
#define _LIBNLM_H_ 1
#ifdef ARCH_SIZE
# define NLM_ARCH_SIZE ARCH_SIZE
#endif
#include "nlm/common.h"
#include "nlm/internal.h"
#include "nlm/external.h"
/* A reloc for an imported NLM symbol. Normal relocs are associated
with sections, and include a symbol. These relocs are associated
with (undefined) symbols, and include a section. */
struct nlm_relent
{
/* Section of reloc. */
asection *section;
/* Reloc info (sym_ptr_ptr field set only when canonicalized). */
arelent reloc;
};
/* Information we keep for an NLM symbol. */
typedef struct
{
/* BFD symbol. */
asymbol symbol;
/* Number of reloc entries for imported symbol. */
bfd_size_type rcnt;
/* Array of reloc information for imported symbol. */
struct nlm_relent *relocs;
} nlmNAME(symbol_type);
extern bfd_boolean nlm_mkobject (bfd *);
extern bfd_boolean nlm_set_arch_mach (bfd *, enum bfd_architecture, unsigned long);
extern void nlmNAME (get_symbol_info) (bfd *, asymbol *, symbol_info *);
extern long nlmNAME (get_symtab_upper_bound)(bfd *);
extern long nlmNAME (canonicalize_symtab) (bfd *, asymbol **);
extern asymbol * nlmNAME (make_empty_symbol) (bfd *);
extern void nlmNAME (print_symbol) (bfd *, void *, asymbol *, bfd_print_symbol_type);
extern long nlmNAME (get_reloc_upper_bound) (bfd *, asection *);
extern long nlmNAME (canonicalize_reloc) (bfd *, asection *, arelent **, asymbol **);
extern const bfd_target * nlmNAME (object_p) (bfd *);
extern bfd_boolean nlmNAME (set_arch_mach) (bfd *, enum bfd_architecture, unsigned long);
extern bfd_boolean nlmNAME (set_section_contents) (bfd *, asection *, const void *, file_ptr, bfd_size_type);
extern bfd_boolean nlmNAME (write_object_contents) (bfd *);
/* Some private data is stashed away for future use using the tdata pointer
in the bfd structure. */
struct nlm_obj_tdata
{
/* Actual data, but ref like ptr */
Nlm_Internal_Fixed_Header nlm_fixed_hdr[1];
Nlm_Internal_Variable_Header nlm_variable_hdr[1];
Nlm_Internal_Version_Header nlm_version_hdr[1];
Nlm_Internal_Copyright_Header nlm_copyright_hdr[1];
Nlm_Internal_Extended_Header nlm_extended_hdr[1];
Nlm_Internal_Custom_Header nlm_custom_hdr[1];
Nlm_Internal_Cygnus_Ext_Header nlm_cygnus_ext_hdr[1];
/* BFD NLM symbols. */
nlmNAME (symbol_type) * nlm_symbols;
/* Lowest text and data VMA values. */
bfd_vma nlm_text_low;
bfd_vma nlm_data_low;
/* Caches for data read from object file. */
arelent * nlm_reloc_fixups;
asection ** nlm_reloc_fixup_secs;
/* Backend specific information. This should probably be a pointer,
but that would require yet another entry point to initialize the
structure. */
union
{
struct /* Alpha backend information. */
{
bfd_vma gp; /* GP value. */
bfd_vma lita_address; /* .lita section address. */
bfd_size_type lita_size; /* .lita section size. */
}
alpha_backend_data;
}
backend_data;
};
#define nlm_tdata(bfd) ((bfd) -> tdata.nlm_obj_data)
#define nlm_fixed_header(bfd) (nlm_tdata (bfd) -> nlm_fixed_hdr)
#define nlm_variable_header(bfd) (nlm_tdata (bfd) -> nlm_variable_hdr)
#define nlm_version_header(bfd) (nlm_tdata (bfd) -> nlm_version_hdr)
#define nlm_copyright_header(bfd) (nlm_tdata (bfd) -> nlm_copyright_hdr)
#define nlm_extended_header(bfd) (nlm_tdata (bfd) -> nlm_extended_hdr)
#define nlm_custom_header(bfd) (nlm_tdata (bfd) -> nlm_custom_hdr)
#define nlm_cygnus_ext_header(bfd) (nlm_tdata (bfd) -> nlm_cygnus_ext_hdr)
#define nlm_get_symbols(bfd) (nlm_tdata (bfd) -> nlm_symbols)
#define nlm_set_symbols(bfd, p) (nlm_tdata (bfd) -> nlm_symbols = (p))
#define nlm_set_text_low(bfd, i) (nlm_tdata (bfd) -> nlm_text_low = (i))
#define nlm_get_text_low(bfd) (nlm_tdata (bfd) -> nlm_text_low)
#define nlm_set_data_low(bfd, i) (nlm_tdata (bfd) -> nlm_data_low = (i))
#define nlm_get_data_low(bfd) (nlm_tdata (bfd) -> nlm_data_low)
#define nlm_relocation_fixups(bfd) (nlm_tdata (bfd) -> nlm_reloc_fixups)
#define nlm_relocation_fixup_secs(bfd) (nlm_tdata (bfd) -> nlm_reloc_fixup_secs)
#define nlm_alpha_backend_data(bfd) (&nlm_tdata (bfd) -> backend_data.alpha_backend_data)
/* This is used when writing out the external relocs. */
struct reloc_and_sec
{
arelent *rel;
asection *sec;
};
/* We store some function pointer in the backend structure. This lets
different NLM targets share most of the same code, while providing
slightly different code where necessary. */
struct nlm_backend_data
{
/* Signature for this backend. */
char signature[NLM_SIGNATURE_SIZE];
/* Size of the fixed header. */
bfd_size_type fixed_header_size;
/* Size of optional prefix for this backend. Some backend may
require this to be a function, but so far a constant is OK. This
is for a prefix which precedes the standard NLM fixed header. */
bfd_size_type optional_prefix_size;
/* Architecture. */
enum bfd_architecture arch;
/* Machine. */
unsigned int mach;
/* Some NLM formats do not use the uninitialized data section, so
all uninitialized data must be put into the regular data section
instead. */
bfd_boolean no_uninitialized_data;
/* Some NLM formats have a prefix on the file. If this function is
not NULL, it will be called by nlm_object_p. It should return
TRUE if this file could match this format, and it should leave
the BFD such that a bfd_bread will pick up the fixed header. */
bfd_boolean (*nlm_backend_object_p) (bfd *);
/* Write out the prefix. This function may be NULL. This must
write out the same number of bytes as is in the field
optional_prefix_size. */
bfd_boolean (*nlm_write_prefix) (bfd *);
/* Read a relocation fixup from abfd. The reloc information is
machine specific. The second argument is the symbol if this is
an import, or NULL if this is a reloc fixup. This function
should set the third argument to the section which the reloc
belongs in, and the fourth argument to the reloc itself; it does
not need to fill in the sym_ptr_ptr field for a reloc against an
import symbol. */
bfd_boolean (*nlm_read_reloc) (bfd *, nlmNAME (symbol_type) *, asection **, arelent *);
/* To make objcopy to an i386 NLM work, the i386 backend needs a
chance to work over the relocs. This is a bit icky. */
bfd_boolean (*nlm_mangle_relocs) (bfd *, asection *, const void *, bfd_vma, bfd_size_type);
/* Read an import record from abfd. It would be nice if this
were in a machine-dependent format, but it doesn't seem to be. */
bfd_boolean (*nlm_read_import) (bfd *, nlmNAME (symbol_type) *);
/* Write an import record to abfd. */
bfd_boolean (*nlm_write_import) (bfd *, asection *, arelent *);
/* Set the section for a public symbol. This may be NULL, in which
case a default method will be used. */
bfd_boolean (*nlm_set_public_section) (bfd *, nlmNAME (symbol_type) *);
/* Get the offset to write out for a public symbol. This may be
NULL, in which case a default method will be used. */
bfd_vma (*nlm_get_public_offset) (bfd *, asymbol *);
/* Swap the fixed header in and out */
void (*nlm_swap_fhdr_in) (bfd *, void *, Nlm_Internal_Fixed_Header *);
void (*nlm_swap_fhdr_out) (bfd *, struct nlm_internal_fixed_header *, void *);
/* Write out an external reference. */
bfd_boolean (*nlm_write_external) (bfd *, bfd_size_type, asymbol *, struct reloc_and_sec *);
bfd_boolean (*nlm_write_export) (bfd *, asymbol *, bfd_vma);
};
#define nlm_backend(bfd) ((struct nlm_backend_data *)((bfd) -> xvec -> backend_data))
#define nlm_signature(bfd) (nlm_backend (bfd) -> signature)
#define nlm_fixed_header_size(bfd) (nlm_backend (bfd) -> fixed_header_size)
#define nlm_optional_prefix_size(bfd) (nlm_backend (bfd) -> optional_prefix_size)
#define nlm_architecture(bfd) (nlm_backend (bfd) -> arch)
#define nlm_machine(bfd) (nlm_backend (bfd) -> mach)
#define nlm_no_uninitialized_data(bfd) (nlm_backend (bfd) -> no_uninitialized_data)
#define nlm_backend_object_p_func(bfd) (nlm_backend (bfd) -> nlm_backend_object_p)
#define nlm_write_prefix_func(bfd) (nlm_backend (bfd) -> nlm_write_prefix)
#define nlm_read_reloc_func(bfd) (nlm_backend (bfd) -> nlm_read_reloc)
#define nlm_mangle_relocs_func(bfd) (nlm_backend (bfd) -> nlm_mangle_relocs)
#define nlm_read_import_func(bfd) (nlm_backend (bfd) -> nlm_read_import)
#define nlm_write_import_func(bfd) (nlm_backend (bfd) -> nlm_write_import)
#define nlm_set_public_section_func(bfd) (nlm_backend (bfd) -> nlm_set_public_section)
#define nlm_get_public_offset_func(bfd) (nlm_backend (bfd) -> nlm_get_public_offset)
#define nlm_swap_fixed_header_in_func(bfd) (nlm_backend (bfd) -> nlm_swap_fhdr_in)
#define nlm_swap_fixed_header_out_func(bfd)(nlm_backend (bfd) -> nlm_swap_fhdr_out)
#define nlm_write_external_func(bfd) (nlm_backend (bfd) -> nlm_write_external)
#define nlm_write_export_func(bfd) (nlm_backend (bfd) -> nlm_write_export)
/* The NLM code, data, and uninitialized sections have no names defined
in the NLM, but bfd wants to give them names, so use the traditional
UNIX names. */
#define NLM_CODE_NAME ".text"
#define NLM_INITIALIZED_DATA_NAME ".data"
#define NLM_UNINITIALIZED_DATA_NAME ".bss"
#endif /* _LIBNLM_H_ */

View File

@ -1,265 +0,0 @@
/* Target definitions for 32/64-bit NLM (NetWare Loadable Module)
Copyright (C) 1993-2018 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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
#define nlm_core_file_p _bfd_dummy_target
#define nlm_get_symtab_upper_bound nlmNAME (get_symtab_upper_bound)
#define nlm_canonicalize_symtab nlmNAME (canonicalize_symtab)
#define nlm_make_empty_symbol nlmNAME (make_empty_symbol)
#define nlm_print_symbol nlmNAME (print_symbol)
#define nlm_get_symbol_info nlmNAME (get_symbol_info)
#define nlm_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
#define nlm_bfd_is_local_label_name bfd_generic_is_local_label_name
#define nlm_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
#define nlm_get_lineno _bfd_nosymbols_get_lineno
#define nlm_find_nearest_line _bfd_nosymbols_find_nearest_line
#define nlm_find_line _bfd_nosymbols_find_line
#define nlm_find_inliner_info _bfd_nosymbols_find_inliner_info
#define nlm_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define nlm_read_minisymbols _bfd_generic_read_minisymbols
#define nlm_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
#define nlm_get_reloc_upper_bound nlmNAME (get_reloc_upper_bound)
#define nlm_canonicalize_reloc nlmNAME (canonicalize_reloc)
#define nlm_set_reloc _bfd_generic_set_reloc
#define nlm_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
#define nlm_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
#define nlm_set_section_contents nlmNAME (set_section_contents)
#define nlm_sizeof_headers _bfd_nolink_sizeof_headers
#define nlm_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
#define nlm_bfd_relax_section bfd_generic_relax_section
#define nlm_bfd_gc_sections bfd_generic_gc_sections
#define nlm_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define nlm_bfd_merge_sections bfd_generic_merge_sections
#define nlm_bfd_is_group_section bfd_generic_is_group_section
#define nlm_bfd_discard_group bfd_generic_discard_group
#define nlm_section_already_linked _bfd_generic_section_already_linked
#define nlm_bfd_define_common_symbol bfd_generic_define_common_symbol
#define nlm_bfd_define_start_stop bfd_generic_define_start_stop
#define nlm_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define nlm_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define nlm_bfd_link_just_syms _bfd_generic_link_just_syms
#define nlm_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
#define nlm_bfd_final_link _bfd_generic_final_link
#define nlm_bfd_link_split_section _bfd_generic_link_split_section
#define nlm_bfd_link_check_relocs _bfd_generic_link_check_relocs
/* This structure contains everything that BFD knows about a target.
It includes things like its byte order, name, what routines to call
to do various operations, etc. Every BFD points to a target structure
with its "xvec" member.
There are two such structures here: one for big-endian machines and
one for little-endian machines. */
/* Forward declaration for use when initialising alternative_target field. */
#ifdef TARGET_LITTLE_SYM
extern const bfd_target TARGET_LITTLE_SYM;
#endif
#ifdef TARGET_BIG_SYM
const bfd_target TARGET_BIG_SYM =
{
/* Name: identify kind of target. */
TARGET_BIG_NAME,
/* Flavour: general indication about file. */
bfd_target_nlm_flavour,
/* Byteorder: data is big endian. */
BFD_ENDIAN_BIG,
/* Header_byteorder: header is also big endian. */
BFD_ENDIAN_BIG,
/* Object_flags: mask of all file flags. */
(HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS
| WP_TEXT),
/* Section_flags: mask of all section flags. */
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY
| SEC_CODE | SEC_DATA),
/* Leading_symbol_char: is the first char of a user symbol
predictable, and if so what is it. */
0,
/* AR_pad_char: pad character for filenames within an archive header
FIXME: this really has nothing to do with NLM, this is a characteristic
of the archiver and/or os and should be independently tunable. */
'/',
/* AR_max_namelen: maximum number of characters in an archive header
FIXME: this really has nothing to do with NLM, this is a characteristic
of the archiver and should be independently tunable. This value is
a WAG (wild a** guess). */
15,
0, /* match priority. */
/* Routines to byte-swap various sized integers from the data sections. */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16,
/* Routines to byte-swap various sized integers from the file headers. */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16,
/* bfd_check_format: check the format of a file being read. */
{ _bfd_dummy_target, /* Unknown format. */
nlmNAME (object_p), /* Assembler/linker output (object file). */
bfd_generic_archive_p, /* An archive. */
nlm_core_file_p /* A core file. */
},
/* bfd_set_format: set the format of a file being written. */
{ _bfd_bool_bfd_false_error,
nlm_mkobject,
_bfd_generic_mkarchive,
_bfd_bool_bfd_false_error
},
/* bfd_write_contents: write cached information into a file being written. */
{ _bfd_bool_bfd_false_error,
nlmNAME (write_object_contents),
_bfd_write_archive_contents,
_bfd_bool_bfd_false_error
},
/* Initialize a jump table with the standard macro.
All names start with "nlm". */
BFD_JUMP_TABLE_GENERIC (_bfd_generic),
BFD_JUMP_TABLE_COPY (_bfd_generic),
BFD_JUMP_TABLE_CORE (_bfd_nocore),
BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
BFD_JUMP_TABLE_SYMBOLS (nlm),
BFD_JUMP_TABLE_RELOCS (nlm),
BFD_JUMP_TABLE_WRITE (nlm),
BFD_JUMP_TABLE_LINK (nlm),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
/* Alternative endian target. */
#ifdef TARGET_LITTLE_SYM
& TARGET_LITTLE_SYM,
#else
NULL,
#endif
/* Backend_data. */
(void *) TARGET_BACKEND_DATA
};
#endif
#ifdef TARGET_LITTLE_SYM
const bfd_target TARGET_LITTLE_SYM =
{
/* Name: identify kind of target. */
TARGET_LITTLE_NAME,
/* Flavour: general indication about file. */
bfd_target_nlm_flavour,
/* Byteorder: data is little endian. */
BFD_ENDIAN_LITTLE,
/* Header_byteorder: header is also little endian. */
BFD_ENDIAN_LITTLE,
/* Object_flags: mask of all file flags. */
(HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS
| WP_TEXT),
/* Section_flags: mask of all section flags. */
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY
| SEC_DATA),
/* Leading_symbol_char: is the first char of a user symbol
predictable, and if so what is it. */
0,
/* AR_pad_char: pad character for filenames within an archive header
FIXME: this really has nothing to do with NLM, this is a characteristic
of the archiver and/or os and should be independently tunable. */
'/',
/* AR_max_namelen: maximum number of characters in an archive header
FIXME: this really has nothing to do with NLM, this is a characteristic
of the archiver and should be independently tunable. This value is
a WAG (wild a** guess). */
15,
0, /* match priority. */
/* Routines to byte-swap various sized integers from the data sections. */
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16,
/* Routines to byte-swap various sized integers from the file headers. */
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16,
/* bfd_check_format: check the format of a file being read. */
{ _bfd_dummy_target, /* Unknown format. */
nlmNAME(object_p), /* Assembler/linker output (object file). */
bfd_generic_archive_p, /* An archive. */
nlm_core_file_p /* A core file. */
},
/* bfd_set_format: set the format of a file being written. */
{ _bfd_bool_bfd_false_error,
nlm_mkobject,
_bfd_generic_mkarchive,
_bfd_bool_bfd_false_error
},
/* bfd_write_contents: write cached information into a file being written. */
{ _bfd_bool_bfd_false_error,
nlmNAME(write_object_contents),
_bfd_write_archive_contents,
_bfd_bool_bfd_false_error
},
/* Initialize a jump table with the standard macro.
All names start with "nlm". */
BFD_JUMP_TABLE_GENERIC (_bfd_generic),
BFD_JUMP_TABLE_COPY (_bfd_generic),
BFD_JUMP_TABLE_CORE (_bfd_nocore),
BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
BFD_JUMP_TABLE_SYMBOLS (nlm),
BFD_JUMP_TABLE_RELOCS (nlm),
BFD_JUMP_TABLE_WRITE (nlm),
BFD_JUMP_TABLE_LINK (nlm),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
/* Alternative endian target. */
#ifdef TARGET_BIG_SYM
& TARGET_BIG_SYM,
#else
NULL,
#endif
/* Backend_data. */
(void *) TARGET_BACKEND_DATA
};
#endif

View File

@ -1,55 +0,0 @@
/* NLM (NetWare Loadable Module) executable support for BFD.
Copyright (C) 1993-2018 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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "libnlm.h"
/* Make an NLM object. We just need to allocate the backend
information. */
bfd_boolean
nlm_mkobject (bfd * abfd)
{
bfd_size_type amt = sizeof (struct nlm_obj_tdata);
nlm_tdata (abfd) = bfd_zalloc (abfd, amt);
if (nlm_tdata (abfd) == NULL)
return FALSE;
if (nlm_architecture (abfd) != bfd_arch_unknown)
bfd_default_set_arch_mach (abfd, nlm_architecture (abfd),
nlm_machine (abfd));
/* Since everything is done at close time, do we need any initialization ? */
return TRUE;
}
/* Set the architecture and machine for an NLM object. */
bfd_boolean
nlm_set_arch_mach (bfd * abfd,
enum bfd_architecture arch,
unsigned long machine)
{
bfd_default_set_arch_mach (abfd, arch, machine);
return arch == nlm_architecture (abfd);
}

View File

@ -1,859 +0,0 @@
/* Support for 32-bit Alpha NLM (NetWare Loadable Module)
Copyright (C) 1993-2018 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
/* This file describes the 32 bit Alpha NLM format. You might think
that an Alpha chip would use a 64 bit format, but, for some reason,
it doesn't. */
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#define ARCH_SIZE 32
#include "nlm/alpha-ext.h"
#define Nlm_External_Fixed_Header Nlm32_alpha_External_Fixed_Header
#include "libnlm.h"
/* Alpha NLM's have a prefix header before the standard NLM. This
function reads it in, verifies the version, and seeks the bfd to
the location before the regular NLM header. */
static bfd_boolean
nlm_alpha_backend_object_p (bfd *abfd)
{
struct nlm32_alpha_external_prefix_header s;
file_ptr size;
if (bfd_bread (&s, (bfd_size_type) sizeof s, abfd) != sizeof s)
return FALSE;
if (H_GET_32 (abfd, s.magic) != NLM32_ALPHA_MAGIC)
return FALSE;
/* FIXME: Should we check the format number? */
/* Skip to the end of the header. */
size = H_GET_32 (abfd, s.size);
if (bfd_seek (abfd, size, SEEK_SET) != 0)
return FALSE;
return TRUE;
}
/* Write out the prefix. */
static bfd_boolean
nlm_alpha_write_prefix (bfd *abfd)
{
struct nlm32_alpha_external_prefix_header s;
memset (&s, 0, sizeof s);
H_PUT_32 (abfd, NLM32_ALPHA_MAGIC, s.magic);
H_PUT_32 (abfd, 2, s.format);
H_PUT_32 (abfd, sizeof s, s.size);
if (bfd_bwrite (&s, (bfd_size_type) sizeof s, abfd) != sizeof s)
return FALSE;
return TRUE;
}
#define ONES(n) (((bfd_vma) 1 << ((n) - 1) << 1) - 1)
/* How to process the various reloc types. */
static reloc_howto_type nlm32_alpha_howto_table[] =
{
/* Reloc type 0 is ignored by itself. However, it appears after a
GPDISP reloc to identify the location where the low order 16 bits
of the gp register are loaded. */
HOWTO (ALPHA_R_IGNORE, /* Type. */
0, /* Rightshift. */
0, /* Size (0 = byte, 1 = short, 2 = long). */
8, /* Bitsize. */
FALSE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_dont, /* Complain_on_overflow. */
0, /* Special_function. */
"IGNORE", /* Name. */
FALSE, /* Partial_inplace. */
0, /* Source mask. */
0, /* Dest mask. */
FALSE), /* PCrel_offset. */
/* A 32 bit reference to a symbol. */
HOWTO (ALPHA_R_REFLONG, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
32, /* Bitsize. */
FALSE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"REFLONG", /* Name. */
TRUE, /* Partial_inplace. */
0xffffffff, /* Source mask. */
0xffffffff, /* Dest mask. */
FALSE), /* PCrel_offset. */
/* A 64 bit reference to a symbol. */
HOWTO (ALPHA_R_REFQUAD, /* Type. */
0, /* Rightshift. */
4, /* Size (0 = byte, 1 = short, 2 = long). */
64, /* Bitsize. */
FALSE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"REFQUAD", /* Name. */
TRUE, /* Partial_inplace. */
ONES (64), /* Source mask. */
ONES (64), /* Dest mask. */
FALSE), /* PCrel_offset. */
/* A 32 bit GP relative offset. This is just like REFLONG except
that when the value is used the value of the gp register will be
added in. */
HOWTO (ALPHA_R_GPREL32, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
32, /* Bitsize. */
FALSE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"GPREL32", /* Name. */
TRUE, /* Partial_inplace. */
0xffffffff, /* Source mask. */
0xffffffff, /* Dest mask. */
FALSE), /* PCrel_offset. */
/* Used for an instruction that refers to memory off the GP
register. The offset is 16 bits of the 32 bit instruction. This
reloc always seems to be against the .lita section. */
HOWTO (ALPHA_R_LITERAL, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
16, /* Bitsize. */
FALSE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
0, /* Special_function. */
"LITERAL", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
FALSE), /* PCrel_offset. */
/* This reloc only appears immediately following a LITERAL reloc.
It identifies a use of the literal. It seems that the linker can
use this to eliminate a portion of the .lita section. The symbol
index is special: 1 means the literal address is in the base
register of a memory format instruction; 2 means the literal
address is in the byte offset register of a byte-manipulation
instruction; 3 means the literal address is in the target
register of a jsr instruction. This does not actually do any
relocation. */
HOWTO (ALPHA_R_LITUSE, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
32, /* Bitsize. */
FALSE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_dont, /* Complain_on_overflow. */
0, /* Special_function. */
"LITUSE", /* Name. */
FALSE, /* Partial_inplace. */
0, /* Source mask. */
0, /* Dest mask. */
FALSE), /* PCrel_offset. */
/* Load the gp register. This is always used for a ldah instruction
which loads the upper 16 bits of the gp register. The next reloc
will be an IGNORE reloc which identifies the location of the lda
instruction which loads the lower 16 bits. The symbol index of
the GPDISP instruction appears to actually be the number of bytes
between the ldah and lda instructions. This gives two different
ways to determine where the lda instruction is; I don't know why
both are used. The value to use for the relocation is the
difference between the GP value and the current location; the
load will always be done against a register holding the current
address. */
HOWTO (ALPHA_R_GPDISP, /* Type. */
16, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
16, /* Bitsize. */
TRUE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_dont, /* Complain_on_overflow. */
0, /* Special_function. */
"GPDISP", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
TRUE), /* PCrel_offset. */
/* A 21 bit branch. The native assembler generates these for
branches within the text segment, and also fills in the PC
relative offset in the instruction. It seems to me that this
reloc, unlike the others, is not partial_inplace. */
HOWTO (ALPHA_R_BRADDR, /* Type. */
2, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
21, /* Bitsize. */
TRUE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
0, /* Special_function. */
"BRADDR", /* Name. */
FALSE, /* Partial_inplace. */
0, /* Source mask. */
0x1fffff, /* Dest mask. */
FALSE), /* PCrel_offset. */
/* A hint for a jump to a register. */
HOWTO (ALPHA_R_HINT, /* Type. */
2, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
14, /* Bitsize. */
FALSE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_dont, /* Complain_on_overflow. */
0, /* Special_function. */
"HINT", /* Name. */
TRUE, /* Partial_inplace. */
0x3fff, /* Source mask. */
0x3fff, /* Dest mask. */
FALSE), /* PCrel_offset. */
/* 16 bit PC relative offset. */
HOWTO (ALPHA_R_SREL16, /* Type. */
0, /* Rightshift. */
1, /* Size (0 = byte, 1 = short, 2 = long). */
16, /* Bitsize. */
TRUE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
0, /* Special_function. */
"SREL16", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
FALSE), /* PCrel_offset. */
/* 32 bit PC relative offset. */
HOWTO (ALPHA_R_SREL32, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
32, /* Bitsize. */
TRUE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
0, /* Special_function. */
"SREL32", /* Name. */
TRUE, /* Partial_inplace. */
0xffffffff, /* Source mask. */
0xffffffff, /* Dest mask. */
FALSE), /* PCrel_offset. */
/* A 64 bit PC relative offset. */
HOWTO (ALPHA_R_SREL64, /* Type. */
0, /* Rightshift. */
4, /* Size (0 = byte, 1 = short, 2 = long). */
64, /* Bitsize. */
TRUE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
0, /* Special_function. */
"SREL64", /* Name. */
TRUE, /* Partial_inplace. */
ONES (64), /* Source mask. */
ONES (64), /* Dest mask. */
FALSE), /* PCrel_offset. */
/* Push a value on the reloc evaluation stack. */
HOWTO (ALPHA_R_OP_PUSH, /* Type. */
0, /* Rightshift. */
0, /* Size (0 = byte, 1 = short, 2 = long). */
0, /* Bitsize. */
FALSE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_dont, /* Complain_on_overflow. */
0, /* Special_function. */
"OP_PUSH", /* Name. */
FALSE, /* Partial_inplace. */
0, /* Source mask. */
0, /* Dest mask. */
FALSE), /* PCrel_offset. */
/* Store the value from the stack at the given address. Store it in
a bitfield of size r_size starting at bit position r_offset. */
HOWTO (ALPHA_R_OP_STORE, /* Type. */
0, /* Rightshift. */
4, /* Size (0 = byte, 1 = short, 2 = long). */
64, /* Bitsize. */
FALSE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_dont, /* Complain_on_overflow. */
0, /* Special_function. */
"OP_STORE", /* Name. */
FALSE, /* Partial_inplace. */
0, /* Source mask. */
ONES (64), /* Dest mask. */
FALSE), /* PCrel_offset. */
/* Subtract the reloc address from the value on the top of the
relocation stack. */
HOWTO (ALPHA_R_OP_PSUB, /* Type. */
0, /* Rightshift. */
0, /* Size (0 = byte, 1 = short, 2 = long). */
0, /* Bitsize. */
FALSE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_dont, /* Complain_on_overflow. */
0, /* Special_function. */
"OP_PSUB", /* Name. */
FALSE, /* Partial_inplace. */
0, /* Source mask. */
0, /* Dest mask. */
FALSE), /* PCrel_offset. */
/* Shift the value on the top of the relocation stack right by the
given value. */
HOWTO (ALPHA_R_OP_PRSHIFT, /* Type. */
0, /* Rightshift. */
0, /* Size (0 = byte, 1 = short, 2 = long). */
0, /* Bitsize. */
FALSE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_dont, /* Complain_on_overflow. */
0, /* Special_function. */
"OP_PRSHIFT", /* Name. */
FALSE, /* Partial_inplace. */
0, /* Source mask. */
0, /* Dest mask. */
FALSE), /* PCrel_offset. */
/* Adjust the GP value for a new range in the object file. */
HOWTO (ALPHA_R_GPVALUE, /* Type. */
0, /* Rightshift. */
0, /* Size (0 = byte, 1 = short, 2 = long). */
0, /* Bitsize. */
FALSE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_dont, /* Complain_on_overflow. */
0, /* Special_function. */
"GPVALUE", /* Name. */
FALSE, /* Partial_inplace. */
0, /* Source mask. */
0, /* Dest mask. */
FALSE) /* PCrel_offset. */
};
static reloc_howto_type nlm32_alpha_nw_howto =
HOWTO (ALPHA_R_NW_RELOC, /* Type. */
0, /* Rightshift. */
0, /* Size (0 = byte, 1 = short, 2 = long). */
0, /* Bitsize. */
FALSE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_dont, /* Complain_on_overflow. */
0, /* Special_function. */
"NW_RELOC", /* Name. */
FALSE, /* Partial_inplace. */
0, /* Source mask. */
0, /* Dest mask. */
FALSE); /* PCrel_offset. */
/* Read an Alpha NLM reloc. This routine keeps some static data which
it uses when handling local relocs. This only works correctly
because all the local relocs are read at once. */
static bfd_boolean
nlm_alpha_read_reloc (bfd *abfd,
nlmNAME (symbol_type) *sym,
asection **secp,
arelent *rel)
{
static bfd_vma gp_value;
static bfd_vma lita_address;
struct nlm32_alpha_external_reloc ext;
bfd_vma r_vaddr;
long r_symndx;
int r_type, r_extern, r_offset, r_size;
asection *code_sec, *data_sec;
/* Read the reloc from the file. */
if (bfd_bread (&ext, (bfd_size_type) sizeof ext, abfd) != sizeof ext)
return FALSE;
/* Swap in the reloc information. */
r_vaddr = H_GET_64 (abfd, ext.r_vaddr);
r_symndx = H_GET_32 (abfd, ext.r_symndx);
BFD_ASSERT (bfd_little_endian (abfd));
r_type = ((ext.r_bits[0] & RELOC_BITS0_TYPE_LITTLE)
>> RELOC_BITS0_TYPE_SH_LITTLE);
r_extern = (ext.r_bits[1] & RELOC_BITS1_EXTERN_LITTLE) != 0;
r_offset = ((ext.r_bits[1] & RELOC_BITS1_OFFSET_LITTLE)
>> RELOC_BITS1_OFFSET_SH_LITTLE);
/* Ignore the reserved bits. */
r_size = ((ext.r_bits[3] & RELOC_BITS3_SIZE_LITTLE)
>> RELOC_BITS3_SIZE_SH_LITTLE);
/* Fill in the BFD arelent structure. */
code_sec = bfd_get_section_by_name (abfd, NLM_CODE_NAME);
data_sec = bfd_get_section_by_name (abfd, NLM_INITIALIZED_DATA_NAME);
if (r_extern)
{
/* External relocations are only used for imports. */
BFD_ASSERT (sym != NULL);
/* We don't need to set sym_ptr_ptr for this case. It is set in
nlm_canonicalize_reloc. */
rel->sym_ptr_ptr = NULL;
rel->addend = 0;
}
else
{
/* Internal relocations are only used for local relocation
fixups. If they are not NW_RELOC or GPDISP or IGNORE, they
must be against .text or .data. */
BFD_ASSERT (r_type == ALPHA_R_NW_RELOC || sym == NULL);
if (r_type == ALPHA_R_NW_RELOC
|| r_type == ALPHA_R_GPDISP
|| r_type == ALPHA_R_IGNORE)
{
rel->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
rel->addend = 0;
}
else if (r_symndx == ALPHA_RELOC_SECTION_TEXT)
{
rel->sym_ptr_ptr = code_sec->symbol_ptr_ptr;
BFD_ASSERT (bfd_get_section_vma (abfd, code_sec) == 0);
rel->addend = 0;
}
else if (r_symndx == ALPHA_RELOC_SECTION_DATA)
{
rel->sym_ptr_ptr = data_sec->symbol_ptr_ptr;
rel->addend = - bfd_get_section_vma (abfd, data_sec);
}
else
{
BFD_ASSERT (0);
rel->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
rel->addend = 0;
}
}
/* We use the address to determine whether the reloc is in the .text
or .data section. R_NW_RELOC relocs don't really have a section,
so we put them in .text. */
if (r_type == ALPHA_R_NW_RELOC
|| r_vaddr < code_sec->size)
{
*secp = code_sec;
rel->address = r_vaddr;
}
else
{
*secp = data_sec;
rel->address = r_vaddr - code_sec->size;
}
/* We must adjust the addend based on the type. */
BFD_ASSERT ((r_type >= 0 && r_type <= ALPHA_R_GPVALUE)
|| r_type == ALPHA_R_NW_RELOC);
switch (r_type)
{
case ALPHA_R_BRADDR:
case ALPHA_R_SREL16:
case ALPHA_R_SREL32:
case ALPHA_R_SREL64:
/* The PC relative relocs do not seem to use the section VMA as
a negative addend. */
rel->addend = 0;
break;
case ALPHA_R_GPREL32:
/* Copy the gp value for this object file into the addend, to
ensure that we are not confused by the linker. */
if (! r_extern)
rel->addend += gp_value;
break;
case ALPHA_R_LITERAL:
BFD_ASSERT (! r_extern);
rel->addend += lita_address;
break;
case ALPHA_R_LITUSE:
case ALPHA_R_GPDISP:
/* The LITUSE and GPDISP relocs do not use a symbol, or an
addend, but they do use a special code. Put this code in the
addend field. */
rel->addend = r_symndx;
rel->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
break;
case ALPHA_R_OP_STORE:
/* The STORE reloc needs the size and offset fields. We store
them in the addend. */
BFD_ASSERT (r_offset < 256 && r_size < 256);
rel->addend = (r_offset << 8) + r_size;
break;
case ALPHA_R_OP_PUSH:
case ALPHA_R_OP_PSUB:
case ALPHA_R_OP_PRSHIFT:
/* The PUSH, PSUB and PRSHIFT relocs do not actually use an
address. I believe that the address supplied is really an
addend. */
rel->addend = r_vaddr;
break;
case ALPHA_R_GPVALUE:
/* Record the new gp value. */
gp_value += r_symndx;
rel->addend = gp_value;
break;
case ALPHA_R_IGNORE:
/* If the type is ALPHA_R_IGNORE, make sure this is a reference
to the absolute section so that the reloc is ignored. For
some reason the address of this reloc type is not adjusted by
the section vma. We record the gp value for this object file
here, for convenience when doing the GPDISP relocation. */
rel->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
rel->address = r_vaddr;
rel->addend = gp_value;
break;
case ALPHA_R_NW_RELOC:
/* If this is SETGP, we set the addend to 0. Otherwise we set
the addend to the size of the .lita section (this is
r_symndx) plus 1. We have already set the address of the
reloc to r_vaddr. */
if (r_size == ALPHA_R_NW_RELOC_SETGP)
{
gp_value = r_vaddr;
rel->addend = 0;
}
else if (r_size == ALPHA_R_NW_RELOC_LITA)
{
lita_address = r_vaddr;
rel->addend = r_symndx + 1;
}
else
BFD_ASSERT (0);
rel->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
break;
default:
break;
}
if (r_type == ALPHA_R_NW_RELOC)
rel->howto = &nlm32_alpha_nw_howto;
else
rel->howto = &nlm32_alpha_howto_table[r_type];
return TRUE;
}
/* Mangle Alpha NLM relocs for output. */
static bfd_boolean
nlm_alpha_mangle_relocs (bfd *abfd ATTRIBUTE_UNUSED,
asection *sec ATTRIBUTE_UNUSED,
const void * data ATTRIBUTE_UNUSED,
bfd_vma offset ATTRIBUTE_UNUSED,
bfd_size_type count ATTRIBUTE_UNUSED)
{
return TRUE;
}
/* Read an ALPHA NLM import record. */
static bfd_boolean
nlm_alpha_read_import (bfd *abfd, nlmNAME (symbol_type) * sym)
{
struct nlm_relent *nlm_relocs; /* Relocation records for symbol. */
bfd_size_type rcount; /* Number of relocs. */
bfd_byte temp[NLM_TARGET_LONG_SIZE]; /* Temporary 32-bit value. */
unsigned char symlength; /* Length of symbol name. */
char *name;
bfd_size_type amt;
if (bfd_bread (& symlength, (bfd_size_type) sizeof (symlength), abfd)
!= sizeof (symlength))
return FALSE;
sym -> symbol.the_bfd = abfd;
name = bfd_alloc (abfd, (bfd_size_type) symlength + 1);
if (name == NULL)
return FALSE;
if (bfd_bread (name, (bfd_size_type) symlength, abfd) != symlength)
return FALSE;
name[symlength] = '\0';
sym -> symbol.name = name;
sym -> symbol.flags = 0;
sym -> symbol.value = 0;
sym -> symbol.section = bfd_und_section_ptr;
if (bfd_bread (temp, (bfd_size_type) sizeof (temp), abfd)
!= sizeof (temp))
return FALSE;
rcount = H_GET_32 (abfd, temp);
amt = rcount * sizeof (struct nlm_relent);
nlm_relocs = bfd_alloc (abfd, amt);
if (!nlm_relocs)
return FALSE;
sym -> relocs = nlm_relocs;
sym -> rcnt = 0;
while (sym -> rcnt < rcount)
{
asection *section;
if (! nlm_alpha_read_reloc (abfd, sym, &section, &nlm_relocs -> reloc))
return FALSE;
nlm_relocs -> section = section;
nlm_relocs++;
sym -> rcnt++;
}
return TRUE;
}
/* Write an Alpha NLM reloc. */
static bfd_boolean
nlm_alpha_write_import (bfd * abfd, asection * sec, arelent * rel)
{
asymbol *sym;
bfd_vma r_vaddr;
long r_symndx;
int r_type, r_extern, r_offset, r_size;
struct nlm32_alpha_external_reloc ext;
sym = *rel->sym_ptr_ptr;
/* Get values for the relocation fields. */
r_type = rel->howto->type;
if (r_type != ALPHA_R_NW_RELOC)
{
r_vaddr = bfd_get_section_vma (abfd, sec) + rel->address;
if ((sec->flags & SEC_CODE) == 0)
r_vaddr += bfd_get_section_by_name (abfd, NLM_CODE_NAME) -> size;
if (bfd_is_und_section (bfd_get_section (sym)))
{
r_extern = 1;
r_symndx = 0;
}
else
{
r_extern = 0;
if (bfd_get_section_flags (abfd, bfd_get_section (sym)) & SEC_CODE)
r_symndx = ALPHA_RELOC_SECTION_TEXT;
else
r_symndx = ALPHA_RELOC_SECTION_DATA;
}
r_offset = 0;
r_size = 0;
switch (r_type)
{
case ALPHA_R_LITUSE:
case ALPHA_R_GPDISP:
r_symndx = rel->addend;
break;
case ALPHA_R_OP_STORE:
r_size = rel->addend & 0xff;
r_offset = (rel->addend >> 8) & 0xff;
break;
case ALPHA_R_OP_PUSH:
case ALPHA_R_OP_PSUB:
case ALPHA_R_OP_PRSHIFT:
r_vaddr = rel->addend;
break;
case ALPHA_R_IGNORE:
r_vaddr = rel->address;
break;
default:
break;
}
}
else
{
/* r_type == ALPHA_R_NW_RELOC. */
r_vaddr = rel->address;
if (rel->addend == 0)
{
r_symndx = 0;
r_size = ALPHA_R_NW_RELOC_SETGP;
}
else
{
r_symndx = rel->addend - 1;
r_size = ALPHA_R_NW_RELOC_LITA;
}
r_extern = 0;
r_offset = 0;
}
/* Swap out the relocation fields. */
H_PUT_64 (abfd, r_vaddr, ext.r_vaddr);
H_PUT_32 (abfd, r_symndx, ext.r_symndx);
BFD_ASSERT (bfd_little_endian (abfd));
ext.r_bits[0] = ((r_type << RELOC_BITS0_TYPE_SH_LITTLE)
& RELOC_BITS0_TYPE_LITTLE);
ext.r_bits[1] = ((r_extern ? RELOC_BITS1_EXTERN_LITTLE : 0)
| ((r_offset << RELOC_BITS1_OFFSET_SH_LITTLE)
& RELOC_BITS1_OFFSET_LITTLE));
ext.r_bits[2] = 0;
ext.r_bits[3] = ((r_size << RELOC_BITS3_SIZE_SH_LITTLE)
& RELOC_BITS3_SIZE_LITTLE);
/* Write out the relocation. */
if (bfd_bwrite (&ext, (bfd_size_type) sizeof ext, abfd) != sizeof ext)
return FALSE;
return TRUE;
}
/* Alpha NetWare does not use the high bit to determine whether a
public symbol is in the code segment or the data segment. Instead,
it just uses the address. The set_public_section and
get_public_offset routines override the default code which uses the
high bit. */
/* Set the section for a public symbol. */
static bfd_boolean
nlm_alpha_set_public_section (bfd * abfd, nlmNAME (symbol_type) * sym)
{
asection *code_sec, *data_sec;
code_sec = bfd_get_section_by_name (abfd, NLM_CODE_NAME);
data_sec = bfd_get_section_by_name (abfd, NLM_INITIALIZED_DATA_NAME);
if (sym->symbol.value < code_sec->size)
{
sym->symbol.section = code_sec;
sym->symbol.flags |= BSF_FUNCTION;
}
else
{
sym->symbol.section = data_sec;
sym->symbol.value -= code_sec->size;
/* The data segment had better be aligned. */
BFD_ASSERT ((code_sec->size & 0xf) == 0);
}
return TRUE;
}
/* Get the offset to write out for a public symbol. */
static bfd_vma
nlm_alpha_get_public_offset (bfd * abfd ATTRIBUTE_UNUSED, asymbol * sym)
{
return bfd_asymbol_value (sym);
}
/* Write an Alpha NLM external symbol. */
static bfd_boolean
nlm_alpha_write_external (bfd *abfd,
bfd_size_type count,
asymbol *sym,
struct reloc_and_sec *relocs)
{
bfd_size_type i;
bfd_byte len;
unsigned char temp[NLM_TARGET_LONG_SIZE];
arelent r;
len = strlen (sym->name);
if ((bfd_bwrite (&len, (bfd_size_type) sizeof (bfd_byte), abfd)
!= sizeof (bfd_byte))
|| bfd_bwrite (sym->name, (bfd_size_type) len, abfd) != len)
return FALSE;
bfd_put_32 (abfd, count + 2, temp);
if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), abfd) != sizeof (temp))
return FALSE;
/* The first two relocs for each external symbol are the .lita
address and the GP value. */
r.sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
r.howto = &nlm32_alpha_nw_howto;
r.address = nlm_alpha_backend_data (abfd)->lita_address;
r.addend = nlm_alpha_backend_data (abfd)->lita_size + 1;
if (! nlm_alpha_write_import (abfd, NULL, &r))
return FALSE;
r.address = nlm_alpha_backend_data (abfd)->gp;
r.addend = 0;
if (! nlm_alpha_write_import (abfd, NULL, &r))
return FALSE;
for (i = 0; i < count; i++)
if (! nlm_alpha_write_import (abfd, relocs[i].sec, relocs[i].rel))
return FALSE;
return TRUE;
}
#include "nlmswap.h"
static const struct nlm_backend_data nlm32_alpha_backend =
{
"NetWare Alpha Module \032",
sizeof (Nlm32_alpha_External_Fixed_Header),
sizeof (struct nlm32_alpha_external_prefix_header),
bfd_arch_alpha,
0,
TRUE, /* No uninitialized data permitted by Alpha NetWare. */
nlm_alpha_backend_object_p,
nlm_alpha_write_prefix,
nlm_alpha_read_reloc,
nlm_alpha_mangle_relocs,
nlm_alpha_read_import,
nlm_alpha_write_import,
nlm_alpha_set_public_section,
nlm_alpha_get_public_offset,
nlm_swap_fixed_header_in,
nlm_swap_fixed_header_out,
nlm_alpha_write_external,
0, /* Write_export. */
};
#define TARGET_LITTLE_NAME "nlm32-alpha"
#define TARGET_LITTLE_SYM alpha_nlm32_vec
#define TARGET_BACKEND_DATA & nlm32_alpha_backend
#include "nlm-target.h"

View File

@ -1,429 +0,0 @@
/* Support for 32-bit i386 NLM (NetWare Loadable Module)
Copyright (C) 1993-2018 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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#define ARCH_SIZE 32
#include "nlm/i386-ext.h"
#define Nlm_External_Fixed_Header Nlm32_i386_External_Fixed_Header
#include "libnlm.h"
/* Adjust the reloc location by an absolute value. */
static reloc_howto_type nlm_i386_abs_howto =
HOWTO (0, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
32, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"32", /* Name. */
TRUE, /* Partial_inplace. */
0xffffffff, /* Source mask. */
0xffffffff, /* Dest mask. */
FALSE); /* PR rel_offset. */
/* Adjust the reloc location by a PC relative displacement. */
static reloc_howto_type nlm_i386_pcrel_howto =
HOWTO (1, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
32, /* Bitsize. */
TRUE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
0, /* Special_function. */
"DISP32", /* Name. */
TRUE, /* Partial_inplace. */
0xffffffff, /* Source mask. */
0xffffffff, /* Dest mask. */
TRUE); /* PR rel_offset. */
/* Read a NetWare i386 reloc. */
static bfd_boolean
nlm_i386_read_reloc (bfd *abfd,
nlmNAME (symbol_type) *sym,
asection **secp,
arelent *rel)
{
bfd_byte temp[4];
bfd_vma val;
const char *name;
if (bfd_bread (temp, (bfd_size_type) sizeof (temp), abfd) != sizeof (temp))
return FALSE;
val = bfd_get_32 (abfd, temp);
/* The value is an offset into either the code or data segment.
This is the location which needs to be adjusted.
If this is a relocation fixup rather than an imported symbol (the
sym argument is NULL) then the high bit is 0 if the location
needs to be adjusted by the address of the data segment, or 1 if
the location needs to be adjusted by the address of the code
segment. If this is an imported symbol, then the high bit is 0
if the location is 0 if the location should be adjusted by the
offset to the symbol, or 1 if the location should adjusted by the
absolute value of the symbol.
The second most significant bit is 0 if the value is an offset
into the data segment, or 1 if the value is an offset into the
code segment.
All this translates fairly easily into a BFD reloc. */
if (sym == NULL)
{
if ((val & NLM_HIBIT) == 0)
name = NLM_INITIALIZED_DATA_NAME;
else
{
name = NLM_CODE_NAME;
val &=~ NLM_HIBIT;
}
rel->sym_ptr_ptr = bfd_get_section_by_name (abfd, name)->symbol_ptr_ptr;
rel->howto = &nlm_i386_abs_howto;
}
else
{
/* In this case we do not need to set the sym_ptr_ptr field. */
rel->sym_ptr_ptr = NULL;
if ((val & NLM_HIBIT) == 0)
rel->howto = &nlm_i386_pcrel_howto;
else
{
rel->howto = &nlm_i386_abs_howto;
val &=~ NLM_HIBIT;
}
}
if ((val & (NLM_HIBIT >> 1)) == 0)
*secp = bfd_get_section_by_name (abfd, NLM_INITIALIZED_DATA_NAME);
else
{
*secp = bfd_get_section_by_name (abfd, NLM_CODE_NAME);
val &=~ (NLM_HIBIT >> 1);
}
rel->address = val;
rel->addend = 0;
return TRUE;
}
/* Write a NetWare i386 reloc. */
static bfd_boolean
nlm_i386_write_import (bfd * abfd, asection * sec, arelent * rel)
{
asymbol *sym;
bfd_vma val;
bfd_byte temp[4];
/* NetWare only supports two kinds of relocs. We should check
special_function here, as well, but at the moment coff-i386
relocs uses a special_function which does not affect what we do
here. */
if (rel->addend != 0
|| rel->howto == NULL
|| rel->howto->rightshift != 0
|| rel->howto->size != 2
|| rel->howto->bitsize != 32
|| rel->howto->bitpos != 0
|| rel->howto->src_mask != 0xffffffff
|| rel->howto->dst_mask != 0xffffffff)
{
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
}
sym = *rel->sym_ptr_ptr;
/* The value we write out is the offset into the appropriate
segment. This offset is the section vma, adjusted by the vma of
the lowest section in that segment, plus the address of the
relocation. */
val = bfd_get_section_vma (abfd, sec) + rel->address;
/* The second most significant bit is 0 if the value is an offset
into the data segment, or 1 if the value is an offset into the
code segment. */
if (bfd_get_section_flags (abfd, sec) & SEC_CODE)
{
val -= nlm_get_text_low (abfd);
val |= NLM_HIBIT >> 1;
}
else
val -= nlm_get_data_low (abfd);
if (! bfd_is_und_section (bfd_get_section (sym)))
{
/* NetWare only supports absolute internal relocs. */
if (rel->howto->pc_relative)
{
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
}
/* The high bit is 1 if the reloc is against the code section, 0
if against the data section. */
if (bfd_get_section_flags (abfd, bfd_get_section (sym)) & SEC_CODE)
val |= NLM_HIBIT;
}
else
{
/* The high bit is 1 if this is an absolute reloc, 0 if it is PC
relative. */
if (! rel->howto->pc_relative)
val |= NLM_HIBIT;
else
{
/* PC relative relocs on NetWare must be pcrel_offset. */
if (! rel->howto->pcrel_offset)
{
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
}
}
}
bfd_put_32 (abfd, val, temp);
if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), abfd) != sizeof (temp))
return FALSE;
return TRUE;
}
/* I want to be able to use objcopy to turn an i386 a.out or COFF file
into a NetWare i386 module. That means that the relocs from the
source file have to be mapped into relocs that apply to the target
file. This function is called by nlm_set_section_contents to give
it a chance to rework the relocs.
This is actually a fairly general concept. However, this is not a
general implementation. */
static bfd_boolean
nlm_i386_mangle_relocs (bfd *abfd,
asection *sec,
const void * data,
bfd_vma offset,
bfd_size_type count)
{
arelent **rel_ptr_ptr, **rel_end;
rel_ptr_ptr = sec->orelocation;
rel_end = rel_ptr_ptr + sec->reloc_count;
for (; rel_ptr_ptr < rel_end; rel_ptr_ptr++)
{
arelent *rel;
asymbol *sym;
bfd_vma addend;
rel = *rel_ptr_ptr;
sym = *rel->sym_ptr_ptr;
/* Note that no serious harm will ensue if we fail to change a
reloc. We will wind up failing in nlm_i386_write_import. */
/* Make sure this reloc is within the data we have. We only 4
byte relocs here, so we insist on having 4 bytes. */
if (rel->address < offset
|| rel->address + 4 > offset + count)
continue;
/* NetWare doesn't support reloc addends, so we get rid of them
here by simply adding them into the object data. We handle
the symbol value, if any, the same way. */
addend = rel->addend + sym->value;
/* The value of a symbol is the offset into the section. If the
symbol is in the .bss segment, we need to include the size of
the data segment in the offset as well. Fortunately, we know
that at this point the size of the data section is in the NLM
header. */
if (((bfd_get_section_flags (abfd, bfd_get_section (sym))
& SEC_LOAD) == 0)
&& ((bfd_get_section_flags (abfd, bfd_get_section (sym))
& SEC_ALLOC) != 0))
addend += nlm_fixed_header (abfd)->dataImageSize;
if (addend != 0
&& rel->howto != NULL
&& rel->howto->rightshift == 0
&& rel->howto->size == 2
&& rel->howto->bitsize == 32
&& rel->howto->bitpos == 0
&& rel->howto->src_mask == 0xffffffff
&& rel->howto->dst_mask == 0xffffffff)
{
bfd_vma val;
val = bfd_get_32 (abfd, (bfd_byte *) data + rel->address - offset);
val += addend;
bfd_put_32 (abfd, val, (bfd_byte *) data + rel->address - offset);
rel->addend = 0;
}
/* NetWare uses a reloc with pcrel_offset set. We adjust
pc_relative relocs accordingly. We are going to change the
howto field, so we can only do this if the current one is
compatible. We should check special_function here, but at
the moment coff-i386 uses a special_function which does not
affect what we are doing here. */
if (rel->howto != NULL
&& rel->howto->pc_relative
&& ! rel->howto->pcrel_offset
&& rel->howto->rightshift == 0
&& rel->howto->size == 2
&& rel->howto->bitsize == 32
&& rel->howto->bitpos == 0
&& rel->howto->src_mask == 0xffffffff
&& rel->howto->dst_mask == 0xffffffff)
{
bfd_vma val;
/* When pcrel_offset is not set, it means that the negative
of the address of the memory location is stored in the
memory location. We must add it back in. */
val = bfd_get_32 (abfd, (bfd_byte *) data + rel->address - offset);
val += rel->address;
bfd_put_32 (abfd, val, (bfd_byte *) data + rel->address - offset);
rel->howto = &nlm_i386_pcrel_howto;
}
}
return TRUE;
}
/* Read a NetWare i386 import record. */
static bfd_boolean
nlm_i386_read_import (bfd * abfd, nlmNAME (symbol_type) * sym)
{
struct nlm_relent *nlm_relocs; /* Relocation records for symbol. */
bfd_size_type rcount; /* Number of relocs. */
bfd_byte temp[NLM_TARGET_LONG_SIZE]; /* Temporary 32-bit value. */
unsigned char symlength; /* Length of symbol name. */
char *name;
if (bfd_bread (& symlength, (bfd_size_type) sizeof (symlength), abfd)
!= sizeof (symlength))
return FALSE;
sym -> symbol.the_bfd = abfd;
name = bfd_alloc (abfd, (bfd_size_type) symlength + 1);
if (name == NULL)
return FALSE;
if (bfd_bread (name, (bfd_size_type) symlength, abfd) != symlength)
return FALSE;
name[symlength] = '\0';
sym -> symbol.name = name;
sym -> symbol.flags = 0;
sym -> symbol.value = 0;
sym -> symbol.section = bfd_und_section_ptr;
if (bfd_bread (temp, (bfd_size_type) sizeof (temp), abfd) != sizeof (temp))
return FALSE;
rcount = H_GET_32 (abfd, temp);
nlm_relocs = bfd_alloc (abfd, rcount * sizeof (struct nlm_relent));
if (!nlm_relocs)
return FALSE;
sym -> relocs = nlm_relocs;
sym -> rcnt = 0;
while (sym -> rcnt < rcount)
{
asection *section;
if (! nlm_i386_read_reloc (abfd, sym, &section, &nlm_relocs -> reloc))
return FALSE;
nlm_relocs -> section = section;
nlm_relocs++;
sym -> rcnt++;
}
return TRUE;
}
/* Write out an external reference. */
static bfd_boolean
nlm_i386_write_external (bfd *abfd,
bfd_size_type count,
asymbol *sym,
struct reloc_and_sec *relocs)
{
unsigned int i;
bfd_byte len;
unsigned char temp[NLM_TARGET_LONG_SIZE];
len = strlen (sym->name);
if ((bfd_bwrite (&len, (bfd_size_type) sizeof (bfd_byte), abfd)
!= sizeof (bfd_byte))
|| bfd_bwrite (sym->name, (bfd_size_type) len, abfd) != len)
return FALSE;
bfd_put_32 (abfd, count, temp);
if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), abfd) != sizeof (temp))
return FALSE;
for (i = 0; i < count; i++)
if (! nlm_i386_write_import (abfd, relocs[i].sec, relocs[i].rel))
return FALSE;
return TRUE;
}
#include "nlmswap.h"
static const struct nlm_backend_data nlm32_i386_backend =
{
"NetWare Loadable Module\032",
sizeof (Nlm32_i386_External_Fixed_Header),
0, /* Optional_prefix_size. */
bfd_arch_i386,
0,
FALSE,
0, /* Backend_object_p. */
0, /* Write_prefix_func. */
nlm_i386_read_reloc,
nlm_i386_mangle_relocs,
nlm_i386_read_import,
nlm_i386_write_import,
0, /* Set_public_section. */
0, /* Set_public_offset. */
nlm_swap_fixed_header_in,
nlm_swap_fixed_header_out,
nlm_i386_write_external,
0, /* Write_export. */
};
#define TARGET_LITTLE_NAME "nlm32-i386"
#define TARGET_LITTLE_SYM i386_nlm32_vec
#define TARGET_BACKEND_DATA & nlm32_i386_backend
#include "nlm-target.h"

View File

@ -1,986 +0,0 @@
/* Support for 32-bit PowerPC NLM (NetWare Loadable Module)
Copyright (C) 1994-2018 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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
/* The format of a PowerPC NLM changed. Define OLDFORMAT to get the
old format. */
#define ARCH_SIZE 32
#include "nlm/ppc-ext.h"
#define Nlm_External_Fixed_Header Nlm32_powerpc_External_Fixed_Header
#include "libnlm.h"
#ifdef OLDFORMAT
/* The prefix header is only used in the old format. */
/* PowerPC NLM's have a prefix header before the standard NLM. This
function reads it in, verifies the version, and seeks the bfd to
the location before the regular NLM header. */
static bfd_boolean
nlm_powerpc_backend_object_p (bfd *abfd)
{
struct nlm32_powerpc_external_prefix_header s;
if (bfd_bread (& s, (bfd_size_type) sizeof s, abfd) != sizeof s)
return FALSE;
if (memcmp (s.signature, NLM32_POWERPC_SIGNATURE, sizeof s.signature) != 0
|| H_GET_32 (abfd, s.headerVersion) != NLM32_POWERPC_HEADER_VERSION)
return FALSE;
return TRUE;
}
/* Write out the prefix. */
static bfd_boolean
nlm_powerpc_write_prefix (bfd *abfd)
{
struct nlm32_powerpc_external_prefix_header s;
memset (&s, 0, sizeof s);
memcpy (s.signature, NLM32_POWERPC_SIGNATURE, sizeof s.signature);
H_PUT_32 (abfd, NLM32_POWERPC_HEADER_VERSION, s.headerVersion);
H_PUT_32 (abfd, 0, s.origins);
/* FIXME: What should we do about the date? */
if (bfd_bwrite (& s, (bfd_size_type) sizeof s, abfd) != sizeof s)
return FALSE;
return TRUE;
}
/* This reloc handling is only applicable to the old format. */
/* How to process the various reloc types. PowerPC NLMs use XCOFF
reloc types, and I have just copied the XCOFF reloc table here. */
static reloc_howto_type nlm_powerpc_howto_table[] =
{
/* Standard 32 bit relocation. */
HOWTO (0, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
32, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_POS", /* Name. */
TRUE, /* Partial_inplace. */
0xffffffff, /* Source mask. */
0xffffffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* 32 bit relocation, but store negative value. */
HOWTO (1, /* Type. */
0, /* Rightshift. */
-2, /* Size (0 = byte, 1 = short, 2 = long). */
32, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_NEG", /* Name. */
TRUE, /* Partial_inplace. */
0xffffffff, /* Source mask. */
0xffffffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* 32 bit PC relative relocation. */
HOWTO (2, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
32, /* Bitsize. */
TRUE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
0, /* Special_function. */
"R_REL", /* Name. */
TRUE, /* Partial_inplace. */
0xffffffff, /* Source mask. */
0xffffffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* 16 bit TOC relative relocation. */
HOWTO (3, /* Type. */
0, /* Rightshift. */
1, /* Size (0 = byte, 1 = short, 2 = long). */
16, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
0, /* Special_function. */
"R_TOC", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* I don't really know what this is. */
HOWTO (4, /* Type. */
1, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
32, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_RTB", /* Name. */
TRUE, /* Partial_inplace. */
0xffffffff, /* Source mask. */
0xffffffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* External TOC relative symbol. */
HOWTO (5, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
16, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_GL", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* Local TOC relative symbol. */
HOWTO (6, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
16, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_TCL", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
FALSE), /* PC rel offset. */
{ 7 },
/* Non modifiable absolute branch. */
HOWTO (8, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
26, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_BA", /* Name. */
TRUE, /* Partial_inplace. */
0x3fffffc, /* Source mask. */
0x3fffffc, /* Dest mask. */
FALSE), /* PC rel offset. */
{ 9 },
/* Non modifiable relative branch. */
HOWTO (0xa, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
26, /* Bitsize. */
TRUE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
0, /* Special_function. */
"R_BR", /* Name. */
TRUE, /* Partial_inplace. */
0x3fffffc, /* Source mask. */
0x3fffffc, /* Dest mask. */
FALSE), /* PC rel offset. */
{ 0xb },
/* Indirect load. */
HOWTO (0xc, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
16, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_RL", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* Load address. */
HOWTO (0xd, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
16, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_RLA", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
FALSE), /* PC rel offset. */
{ 0xe },
/* Non-relocating reference. */
HOWTO (0xf, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
32, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_REF", /* Name. */
FALSE, /* Partial_inplace. */
0, /* Source mask. */
0, /* Dest mask. */
FALSE), /* PC rel offset. */
{ 0x10 },
{ 0x11 },
/* TOC relative indirect load. */
HOWTO (0x12, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
16, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_TRL", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* TOC relative load address. */
HOWTO (0x13, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
16, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_TRLA", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* Modifiable relative branch. */
HOWTO (0x14, /* Type. */
1, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
32, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_RRTBI", /* Name. */
TRUE, /* Partial_inplace. */
0xffffffff, /* Source mask. */
0xffffffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* Modifiable absolute branch. */
HOWTO (0x15, /* Type. */
1, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
32, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_RRTBA", /* Name. */
TRUE, /* Partial_inplace. */
0xffffffff, /* Source mask. */
0xffffffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* Modifiable call absolute indirect. */
HOWTO (0x16, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
16, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_CAI", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* Modifiable call relative. */
HOWTO (0x17, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
16, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_REL", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* Modifiable branch absolute. */
HOWTO (0x18, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
16, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_RBA", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* Modifiable branch absolute. */
HOWTO (0x19, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
16, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_RBAC", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* Modifiable branch relative. */
HOWTO (0x1a, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
26, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
0, /* Special_function. */
"R_REL", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
FALSE), /* PC rel offset. */
/* Modifiable branch absolute. */
HOWTO (0x1b, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
16, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"R_REL", /* Name. */
TRUE, /* Partial_inplace. */
0xffff, /* Source mask. */
0xffff, /* Dest mask. */
FALSE) /* PC rel offset. */
};
#define HOWTO_COUNT (sizeof nlm_powerpc_howto_table \
/ sizeof nlm_powerpc_howto_table[0])
/* Read a PowerPC NLM reloc. */
static bfd_boolean
nlm_powerpc_read_reloc (bfd *abfd,
nlmNAME (symbol_type) *sym,
asection **secp,
arelent *rel)
{
struct nlm32_powerpc_external_reloc ext;
bfd_vma l_vaddr;
unsigned long l_symndx;
int l_rtype;
int l_rsecnm;
asection *code_sec, *data_sec, *bss_sec;
/* Read the reloc from the file. */
if (bfd_bread (&ext, (bfd_size_type) sizeof ext, abfd) != sizeof ext)
return FALSE;
/* Swap in the fields. */
l_vaddr = H_GET_32 (abfd, ext.l_vaddr);
l_symndx = H_GET_32 (abfd, ext.l_symndx);
l_rtype = H_GET_16 (abfd, ext.l_rtype);
l_rsecnm = H_GET_16 (abfd, ext.l_rsecnm);
/* Get the sections now, for convenience. */
code_sec = bfd_get_section_by_name (abfd, NLM_CODE_NAME);
data_sec = bfd_get_section_by_name (abfd, NLM_INITIALIZED_DATA_NAME);
bss_sec = bfd_get_section_by_name (abfd, NLM_UNINITIALIZED_DATA_NAME);
/* Work out the arelent fields. */
if (sym != NULL)
/* This is an import. sym_ptr_ptr is filled in by
nlm_canonicalize_reloc. */
rel->sym_ptr_ptr = NULL;
else
{
asection *sec;
if (l_symndx == 0)
sec = code_sec;
else if (l_symndx == 1)
sec = data_sec;
else if (l_symndx == 2)
sec = bss_sec;
else
{
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
rel->sym_ptr_ptr = sec->symbol_ptr_ptr;
}
rel->addend = 0;
BFD_ASSERT ((l_rtype & 0xff) < HOWTO_COUNT);
rel->howto = nlm_powerpc_howto_table + (l_rtype & 0xff);
BFD_ASSERT (rel->howto->name != NULL
&& ((l_rtype & 0x8000) != 0
? (rel->howto->complain_on_overflow
== complain_overflow_signed)
: (rel->howto->complain_on_overflow
== complain_overflow_bitfield))
&& ((l_rtype >> 8) & 0x1f) == rel->howto->bitsize - 1);
if (l_rsecnm == 0)
*secp = code_sec;
else if (l_rsecnm == 1)
{
*secp = data_sec;
l_vaddr -= code_sec->size;
}
else
{
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
rel->address = l_vaddr;
return TRUE;
}
#else /* not OLDFORMAT */
/* There is only one type of reloc in a PowerPC NLM. */
static reloc_howto_type nlm_powerpc_howto =
HOWTO (0, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
32, /* Bitsize. */
FALSE, /* PC relative. */
0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
0, /* Special_function. */
"32", /* Name. */
TRUE, /* Partial_inplace. */
0xffffffff, /* Source mask. */
0xffffffff, /* Dest mask. */
FALSE); /* PC rel_offset. */
/* Read a PowerPC NLM reloc. */
static bfd_boolean
nlm_powerpc_read_reloc (bfd *abfd,
nlmNAME (symbol_type) *sym,
asection **secp,
arelent *rel)
{
bfd_byte temp[4];
bfd_vma val;
const char *name;
if (bfd_bread (temp, (bfd_size_type) sizeof (temp), abfd) != sizeof (temp))
return FALSE;
val = bfd_get_32 (abfd, temp);
/* The value is a word offset into either the code or data segment.
This is the location which needs to be adjusted.
The high bit is 0 if the value is an offset into the data
segment, or 1 if the value is an offset into the text segment.
If this is a relocation fixup rather than an imported symbol (the
sym argument is NULL), then the second most significant bit is 0
if the address of the data segment should be added to the
location addressed by the value, or 1 if the address of the text
segment should be added.
If this is an imported symbol, the second most significant bit is
not used and must be 0. */
if ((val & NLM_HIBIT) == 0)
name = NLM_INITIALIZED_DATA_NAME;
else
{
name = NLM_CODE_NAME;
val &=~ NLM_HIBIT;
}
*secp = bfd_get_section_by_name (abfd, name);
if (sym == NULL)
{
if ((val & (NLM_HIBIT >> 1)) == 0)
name = NLM_INITIALIZED_DATA_NAME;
else
{
name = NLM_CODE_NAME;
val &=~ (NLM_HIBIT >> 1);
}
rel->sym_ptr_ptr = bfd_get_section_by_name (abfd, name)->symbol_ptr_ptr;
}
rel->howto = & nlm_powerpc_howto;
rel->address = val << 2;
rel->addend = 0;
return TRUE;
}
#endif /* not OLDFORMAT */
/* Mangle PowerPC NLM relocs for output. */
static bfd_boolean
nlm_powerpc_mangle_relocs (bfd *abfd ATTRIBUTE_UNUSED,
asection *sec ATTRIBUTE_UNUSED,
const void * data ATTRIBUTE_UNUSED,
bfd_vma offset ATTRIBUTE_UNUSED,
bfd_size_type count ATTRIBUTE_UNUSED)
{
return TRUE;
}
/* Read a PowerPC NLM import record */
static bfd_boolean
nlm_powerpc_read_import (bfd * abfd, nlmNAME (symbol_type) * sym)
{
struct nlm_relent *nlm_relocs; /* Relocation records for symbol. */
bfd_size_type rcount; /* Number of relocs. */
bfd_byte temp[NLM_TARGET_LONG_SIZE]; /* Temporary 32-bit value. */
unsigned char symlength; /* Length of symbol name. */
char *name;
if (bfd_bread (& symlength, (bfd_size_type) sizeof (symlength), abfd)
!= sizeof (symlength))
return FALSE;
sym -> symbol.the_bfd = abfd;
name = bfd_alloc (abfd, (bfd_size_type) symlength + 1);
if (name == NULL)
return FALSE;
if (bfd_bread (name, (bfd_size_type) symlength, abfd) != symlength)
return FALSE;
name[symlength] = '\0';
sym -> symbol.name = name;
sym -> symbol.flags = 0;
sym -> symbol.value = 0;
sym -> symbol.section = bfd_und_section_ptr;
if (bfd_bread (temp, (bfd_size_type) sizeof (temp), abfd)
!= sizeof (temp))
return FALSE;
rcount = H_GET_32 (abfd, temp);
nlm_relocs = bfd_alloc (abfd, rcount * sizeof (struct nlm_relent));
if (nlm_relocs == NULL)
return FALSE;
sym -> relocs = nlm_relocs;
sym -> rcnt = 0;
while (sym -> rcnt < rcount)
{
asection *section;
if (! nlm_powerpc_read_reloc (abfd, sym, &section, &nlm_relocs -> reloc))
return FALSE;
nlm_relocs -> section = section;
nlm_relocs++;
sym -> rcnt++;
}
return TRUE;
}
#ifndef OLDFORMAT
/* Write a PowerPC NLM reloc. */
static bfd_boolean
nlm_powerpc_write_import (bfd * abfd, asection * sec, arelent * rel)
{
asymbol *sym;
bfd_vma val;
bfd_byte temp[4];
/* PowerPC NetWare only supports one kind of reloc. */
if (rel->addend != 0
|| rel->howto == NULL
|| rel->howto->rightshift != 0
|| rel->howto->size != 2
|| rel->howto->bitsize != 32
|| rel->howto->bitpos != 0
|| rel->howto->pc_relative
|| (rel->howto->src_mask != 0xffffffff && rel->addend != 0)
|| rel->howto->dst_mask != 0xffffffff)
{
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
}
sym = *rel->sym_ptr_ptr;
/* The value we write out is the offset into the appropriate
segment, rightshifted by two. This offset is the section vma,
adjusted by the vma of the lowest section in that segment, plus
the address of the relocation. */
val = bfd_get_section_vma (abfd, sec) + rel->address;
if ((val & 3) != 0)
{
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
val >>= 2;
/* The high bit is 0 if the reloc is in the data section, or 1 if
the reloc is in the code section. */
if (bfd_get_section_flags (abfd, sec) & SEC_DATA)
val -= nlm_get_data_low (abfd);
else
{
val -= nlm_get_text_low (abfd);
val |= NLM_HIBIT;
}
if (! bfd_is_und_section (bfd_get_section (sym)))
{
/* This is an internal relocation fixup. The second most
significant bit is 0 if this is a reloc against the data
segment, or 1 if it is a reloc against the text segment. */
if (bfd_get_section_flags (abfd, bfd_get_section (sym)) & SEC_CODE)
val |= NLM_HIBIT >> 1;
}
bfd_put_32 (abfd, val, temp);
if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), abfd) != sizeof (temp))
return FALSE;
return TRUE;
}
#else /* OLDFORMAT */
/* This is used for the reloc handling in the old format. */
/* Write a PowerPC NLM reloc. */
static bfd_boolean
nlm_powerpc_write_reloc (bfd *abfd,
asection *sec,
arelent *rel,
int indx)
{
struct nlm32_powerpc_external_reloc ext;
asection *code_sec, *data_sec, *bss_sec;
asymbol *sym;
asection *symsec;
unsigned long l_symndx;
int l_rtype;
int l_rsecnm;
reloc_howto_type *howto;
bfd_size_type address;
/* Get the sections now, for convenience. */
code_sec = bfd_get_section_by_name (abfd, NLM_CODE_NAME);
data_sec = bfd_get_section_by_name (abfd, NLM_INITIALIZED_DATA_NAME);
bss_sec = bfd_get_section_by_name (abfd, NLM_UNINITIALIZED_DATA_NAME);
sym = *rel->sym_ptr_ptr;
symsec = bfd_get_section (sym);
if (indx != -1)
{
BFD_ASSERT (bfd_is_und_section (symsec));
l_symndx = indx + 3;
}
else
{
if (symsec == code_sec)
l_symndx = 0;
else if (symsec == data_sec)
l_symndx = 1;
else if (symsec == bss_sec)
l_symndx = 2;
else
{
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
}
H_PUT_32 (abfd, l_symndx, ext.l_symndx);
for (howto = nlm_powerpc_howto_table;
howto < nlm_powerpc_howto_table + HOWTO_COUNT;
howto++)
{
if (howto->rightshift == rel->howto->rightshift
&& howto->size == rel->howto->size
&& howto->bitsize == rel->howto->bitsize
&& howto->pc_relative == rel->howto->pc_relative
&& howto->bitpos == rel->howto->bitpos
&& (howto->partial_inplace == rel->howto->partial_inplace
|| (! rel->howto->partial_inplace
&& rel->addend == 0))
&& (howto->src_mask == rel->howto->src_mask
|| (rel->howto->src_mask == 0
&& rel->addend == 0))
&& howto->dst_mask == rel->howto->dst_mask
&& howto->pcrel_offset == rel->howto->pcrel_offset)
break;
}
if (howto >= nlm_powerpc_howto_table + HOWTO_COUNT)
{
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
l_rtype = howto->type;
if (howto->complain_on_overflow == complain_overflow_signed)
l_rtype |= 0x8000;
l_rtype |= (howto->bitsize - 1) << 8;
H_PUT_16 (abfd, l_rtype, ext.l_rtype);
address = rel->address;
if (sec == code_sec)
l_rsecnm = 0;
else if (sec == data_sec)
{
l_rsecnm = 1;
address += code_sec->size;
}
else
{
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
H_PUT_16 (abfd, l_rsecnm, ext.l_rsecnm);
H_PUT_32 (abfd, address, ext.l_vaddr);
if (bfd_bwrite (&ext, (bfd_size_type) sizeof ext, abfd) != sizeof ext)
return FALSE;
return TRUE;
}
/* Write a PowerPC NLM import. */
static bfd_boolean
nlm_powerpc_write_import (bfd * abfd, asection * sec, arelent * rel)
{
return nlm_powerpc_write_reloc (abfd, sec, rel, -1);
}
#endif /* OLDFORMAT */
/* Write a PowerPC NLM external symbol. This routine keeps a static
count of the symbol index. FIXME: I don't know if this is
necessary, and the index never gets reset. */
static bfd_boolean
nlm_powerpc_write_external (bfd *abfd,
bfd_size_type count,
asymbol *sym,
struct reloc_and_sec *relocs)
{
unsigned int i;
bfd_byte len;
unsigned char temp[NLM_TARGET_LONG_SIZE];
#ifdef OLDFORMAT
static int indx;
#endif
len = strlen (sym->name);
if ((bfd_bwrite (&len, (bfd_size_type) sizeof (bfd_byte), abfd)
!= sizeof (bfd_byte))
|| bfd_bwrite (sym->name, (bfd_size_type) len, abfd) != len)
return FALSE;
bfd_put_32 (abfd, count, temp);
if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), abfd) != sizeof (temp))
return FALSE;
for (i = 0; i < count; i++)
{
#ifndef OLDFORMAT
if (! nlm_powerpc_write_import (abfd, relocs[i].sec, relocs[i].rel))
return FALSE;
#else
if (! nlm_powerpc_write_reloc (abfd, relocs[i].sec,
relocs[i].rel, indx))
return FALSE;
#endif
}
#ifdef OLDFORMAT
++indx;
#endif
return TRUE;
}
#ifndef OLDFORMAT
/* PowerPC Netware uses a word offset, not a byte offset, for public
symbols. */
/* Set the section for a public symbol. */
static bfd_boolean
nlm_powerpc_set_public_section (bfd *abfd, nlmNAME (symbol_type) *sym)
{
if (sym->symbol.value & NLM_HIBIT)
{
sym->symbol.value &= ~NLM_HIBIT;
sym->symbol.flags |= BSF_FUNCTION;
sym->symbol.section =
bfd_get_section_by_name (abfd, NLM_CODE_NAME);
}
else
sym->symbol.section =
bfd_get_section_by_name (abfd, NLM_INITIALIZED_DATA_NAME);
sym->symbol.value <<= 2;
return TRUE;
}
/* Get the offset to write out for a public symbol. */
static bfd_vma
nlm_powerpc_get_public_offset (bfd *abfd, asymbol *sym)
{
bfd_vma offset;
asection *sec;
offset = bfd_asymbol_value (sym);
sec = bfd_get_section (sym);
if (sec->flags & SEC_CODE)
{
offset -= nlm_get_text_low (abfd);
offset |= NLM_HIBIT;
}
else if (sec->flags & (SEC_DATA | SEC_ALLOC))
{
/* SEC_ALLOC is for the .bss section. */
offset -= nlm_get_data_low (abfd);
}
else
{
/* We can't handle an exported symbol that is not in the code or
data segment. */
bfd_set_error (bfd_error_invalid_operation);
/* FIXME: No way to return error. */
abort ();
}
return offset;
}
#endif /* ! defined (OLDFORMAT) */
#include "nlmswap.h"
static const struct nlm_backend_data nlm32_powerpc_backend =
{
"NetWare PowerPC Module \032",
sizeof (Nlm32_powerpc_External_Fixed_Header),
#ifndef OLDFORMAT
0, /* Optional_prefix_size. */
#else
sizeof (struct nlm32_powerpc_external_prefix_header),
#endif
bfd_arch_powerpc,
0,
FALSE,
#ifndef OLDFORMAT
0, /* Backend_object_p. */
0, /* Write_prefix. */
#else
nlm_powerpc_backend_object_p,
nlm_powerpc_write_prefix,
#endif
nlm_powerpc_read_reloc,
nlm_powerpc_mangle_relocs,
nlm_powerpc_read_import,
nlm_powerpc_write_import,
#ifndef OLDFORMAT
nlm_powerpc_set_public_section,
nlm_powerpc_get_public_offset,
#else
0, /* Set_public_section. */
0, /* Get_public_offset. */
#endif
nlm_swap_fixed_header_in,
nlm_swap_fixed_header_out,
nlm_powerpc_write_external,
0, /* Write_export. */
};
#define TARGET_BIG_NAME "nlm32-powerpc"
#define TARGET_BIG_SYM powerpc_nlm32_vec
#define TARGET_BACKEND_DATA & nlm32_powerpc_backend
#include "nlm-target.h"

View File

@ -1,378 +0,0 @@
/* Support for 32-bit SPARC NLM (NetWare Loadable Module)
Copyright (C) 1993-2018 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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#define ARCH_SIZE 32
#include "nlm/sparc32-ext.h"
#define Nlm_External_Fixed_Header Nlm32_sparc_External_Fixed_Header
#include "libnlm.h"
enum reloc_type
{
R_SPARC_NONE = 0,
R_SPARC_8, R_SPARC_16, R_SPARC_32,
R_SPARC_DISP8, R_SPARC_DISP16, R_SPARC_DISP32,
R_SPARC_WDISP30, R_SPARC_WDISP22,
R_SPARC_HI22, R_SPARC_22,
R_SPARC_13, R_SPARC_LO10,
R_SPARC_GOT10, R_SPARC_GOT13, R_SPARC_GOT22,
R_SPARC_PC10, R_SPARC_PC22,
R_SPARC_WPLT30,
R_SPARC_COPY,
R_SPARC_GLOB_DAT, R_SPARC_JMP_SLOT,
R_SPARC_RELATIVE,
R_SPARC_UA32,
R_SPARC_max
};
static reloc_howto_type nlm32_sparc_howto_table[] =
{
HOWTO (R_SPARC_NONE, 0,3, 0,FALSE,0,complain_overflow_dont, 0,"R_SPARC_NONE", FALSE,0,0x00000000,TRUE),
HOWTO (R_SPARC_8, 0,0, 8,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_8", FALSE,0,0x000000ff,TRUE),
HOWTO (R_SPARC_16, 0,1,16,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_16", FALSE,0,0x0000ffff,TRUE),
HOWTO (R_SPARC_32, 0,2,32,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_32", FALSE,0,0xffffffff,TRUE),
HOWTO (R_SPARC_DISP8, 0,0, 8,TRUE, 0,complain_overflow_signed, 0,"R_SPARC_DISP8", FALSE,0,0x000000ff,TRUE),
HOWTO (R_SPARC_DISP16, 0,1,16,TRUE, 0,complain_overflow_signed, 0,"R_SPARC_DISP16", FALSE,0,0x0000ffff,TRUE),
HOWTO (R_SPARC_DISP32, 0,2,32,TRUE, 0,complain_overflow_signed, 0,"R_SPARC_DISP32", FALSE,0,0x00ffffff,TRUE),
HOWTO (R_SPARC_WDISP30, 2,2,30,TRUE, 0,complain_overflow_signed, 0,"R_SPARC_WDISP30", FALSE,0,0x3fffffff,TRUE),
HOWTO (R_SPARC_WDISP22, 2,2,22,TRUE, 0,complain_overflow_signed, 0,"R_SPARC_WDISP22", FALSE,0,0x003fffff,TRUE),
HOWTO (R_SPARC_HI22, 10,2,22,FALSE,0,complain_overflow_dont, 0,"R_SPARC_HI22", FALSE,0,0x003fffff,TRUE),
HOWTO (R_SPARC_22, 0,2,22,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_22", FALSE,0,0x003fffff,TRUE),
HOWTO (R_SPARC_13, 0,2,13,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_13", FALSE,0,0x00001fff,TRUE),
HOWTO (R_SPARC_LO10, 0,2,10,FALSE,0,complain_overflow_dont, 0,"R_SPARC_LO10", FALSE,0,0x000003ff,TRUE),
HOWTO (R_SPARC_GOT10, 0,2,10,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_GOT10", FALSE,0,0x000003ff,TRUE),
HOWTO (R_SPARC_GOT13, 0,2,13,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_GOT13", FALSE,0,0x00001fff,TRUE),
HOWTO (R_SPARC_GOT22, 10,2,22,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_GOT22", FALSE,0,0x003fffff,TRUE),
HOWTO (R_SPARC_PC10, 0,2,10,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_PC10", FALSE,0,0x000003ff,TRUE),
HOWTO (R_SPARC_PC22, 0,2,22,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_PC22", FALSE,0,0x003fffff,TRUE),
HOWTO (R_SPARC_WPLT30, 0,0,00,FALSE,0,complain_overflow_dont, 0,"R_SPARC_WPLT30", FALSE,0,0x00000000,TRUE),
HOWTO (R_SPARC_COPY, 0,0,00,FALSE,0,complain_overflow_dont, 0,"R_SPARC_COPY", FALSE,0,0x00000000,TRUE),
HOWTO (R_SPARC_GLOB_DAT,0,0,00,FALSE,0,complain_overflow_dont, 0,"R_SPARC_GLOB_DAT",FALSE,0,0x00000000,TRUE),
HOWTO (R_SPARC_JMP_SLOT,0,0,00,FALSE,0,complain_overflow_dont, 0,"R_SPARC_JMP_SLOT",FALSE,0,0x00000000,TRUE),
HOWTO (R_SPARC_RELATIVE,0,0,00,FALSE,0,complain_overflow_dont, 0,"R_SPARC_RELATIVE",FALSE,0,0x00000000,TRUE),
HOWTO (R_SPARC_UA32, 0,0,00,FALSE,0,complain_overflow_dont, 0,"R_SPARC_UA32", FALSE,0,0x00000000,TRUE),
};
/* Read a NetWare sparc reloc. */
struct nlm32_sparc_reloc_ext
{
unsigned char offset[4];
unsigned char addend[4];
unsigned char type[1];
unsigned char pad1[3];
};
static bfd_boolean
nlm_sparc_read_reloc (bfd *abfd,
nlmNAME (symbol_type) *sym ATTRIBUTE_UNUSED,
asection **secp,
arelent *rel)
{
bfd_vma val, addend;
unsigned int howto_index;
unsigned int type;
struct nlm32_sparc_reloc_ext tmp_reloc;
asection *code_sec;
if (bfd_bread (&tmp_reloc, (bfd_size_type) 12, abfd) != 12)
return FALSE;
code_sec = bfd_get_section_by_name (abfd, NLM_CODE_NAME);
*secp = code_sec;
val = bfd_get_32 (abfd, tmp_reloc.offset);
addend = bfd_get_32 (abfd, tmp_reloc.addend);
type = bfd_get_8 (abfd, tmp_reloc.type);
rel->address = val;
rel->addend = addend;
rel->howto = NULL;
for (howto_index = 0;
howto_index < sizeof (nlm32_sparc_howto_table) / sizeof (reloc_howto_type);
howto_index++)
if (nlm32_sparc_howto_table[howto_index].type == type)
{
rel->howto = &nlm32_sparc_howto_table[howto_index];
break;
}
#ifdef DEBUG
fprintf (stderr, "%s: address = %08lx, addend = %08lx, type = %u, howto = %p\n",
__FUNCTION__, (unsigned long) rel->address,
(unsigned long) rel->addend, type, rel->howto);
#endif
return TRUE;
}
/* Write a NetWare sparc reloc. */
static bfd_boolean
nlm_sparc_write_reloc (bfd * abfd, asection * sec, arelent * rel)
{
bfd_vma val;
struct nlm32_sparc_reloc_ext tmp_reloc;
unsigned int howto_index;
int type = -1;
reloc_howto_type *tmp;
for (howto_index = 0;
howto_index < sizeof (nlm32_sparc_howto_table) / sizeof (reloc_howto_type);
howto_index++)
{
tmp = &nlm32_sparc_howto_table[howto_index];
if (tmp->rightshift == rel->howto->rightshift
&& tmp->size == rel->howto->size
&& tmp->bitsize == rel->howto->bitsize
&& tmp->pc_relative == rel->howto->pc_relative
&& tmp->bitpos == rel->howto->bitpos
&& tmp->src_mask == rel->howto->src_mask
&& tmp->dst_mask == rel->howto->dst_mask)
{
type = tmp->type;
break;
}
}
if (type == -1)
abort ();
/* Netware wants a list of relocs for each address.
Format is:
long offset
long addend
char type
That should be it. */
/* The value we write out is the offset into the appropriate
segment. This offset is the section vma, adjusted by the vma of
the lowest section in that segment, plus the address of the
relocation. */
val = bfd_get_section_vma (abfd, sec) + rel->address;
#ifdef DEBUG
fprintf (stderr, "%s: val = %08lx, addend = %08lx, type = %u\n",
__FUNCTION__, (unsigned long) val, (unsigned long) rel->addend,
rel->howto->type);
#endif
bfd_put_32 (abfd, val, tmp_reloc.offset);
bfd_put_32 (abfd, rel->addend, tmp_reloc.addend);
bfd_put_8 (abfd, (short) (rel->howto->type), tmp_reloc.type);
if (bfd_bwrite (&tmp_reloc, (bfd_size_type) 12, abfd) != 12)
return FALSE;
return TRUE;
}
/* Mangle relocs for SPARC NetWare. We can just use the standard
SPARC relocs. */
static bfd_boolean
nlm_sparc_mangle_relocs (bfd *abfd ATTRIBUTE_UNUSED,
asection *sec ATTRIBUTE_UNUSED,
const void * data ATTRIBUTE_UNUSED,
bfd_vma offset ATTRIBUTE_UNUSED,
bfd_size_type count ATTRIBUTE_UNUSED)
{
return TRUE;
}
/* Read a NetWare sparc import record. */
static bfd_boolean
nlm_sparc_read_import (bfd *abfd, nlmNAME (symbol_type) *sym)
{
struct nlm_relent *nlm_relocs; /* Relocation records for symbol. */
bfd_size_type rcount; /* Number of relocs. */
bfd_byte temp[NLM_TARGET_LONG_SIZE]; /* Temporary 32-bit value. */
unsigned char symlength; /* Length of symbol name. */
char *name;
/* First, read in the number of relocation
entries for this symbol. */
if (bfd_bread (temp, (bfd_size_type) 4, abfd) != 4)
return FALSE;
rcount = bfd_get_32 (abfd, temp);
/* Next, read in the length of the symbol. */
if (bfd_bread (& symlength, (bfd_size_type) sizeof (symlength), abfd)
!= sizeof (symlength))
return FALSE;
sym -> symbol.the_bfd = abfd;
name = bfd_alloc (abfd, (bfd_size_type) symlength + 1);
if (name == NULL)
return FALSE;
/* Then read in the symbol. */
if (bfd_bread (name, (bfd_size_type) symlength, abfd) != symlength)
return FALSE;
name[symlength] = '\0';
sym -> symbol.name = name;
sym -> symbol.flags = 0;
sym -> symbol.value = 0;
sym -> symbol.section = bfd_und_section_ptr;
/* Next, start reading in the relocs. */
nlm_relocs = bfd_alloc (abfd, rcount * sizeof (struct nlm_relent));
if (!nlm_relocs)
return FALSE;
sym -> relocs = nlm_relocs;
sym -> rcnt = 0;
while (sym -> rcnt < rcount)
{
asection *section;
if (! nlm_sparc_read_reloc (abfd, sym, &section, &nlm_relocs -> reloc))
return FALSE;
nlm_relocs -> section = section;
nlm_relocs++;
sym -> rcnt++;
}
return TRUE;
}
static bfd_boolean
nlm_sparc_write_import (bfd * abfd, asection * sec, arelent * rel)
{
char temp[4];
asection *code, *data, *bss, *symsec;
bfd_vma base;
code = bfd_get_section_by_name (abfd, NLM_CODE_NAME);
data = bfd_get_section_by_name (abfd, NLM_INITIALIZED_DATA_NAME);
bss = bfd_get_section_by_name (abfd, NLM_UNINITIALIZED_DATA_NAME);
symsec = (*rel->sym_ptr_ptr)->section;
if (symsec == code)
base = 0;
else if (symsec == data)
base = code->size;
else if (symsec == bss)
base = code->size + data->size;
else
base = 0;
#ifdef DEBUG
fprintf (stderr, "%s: <%lx, 1>\n\t",
__FUNCTION__, (unsigned long) (base + (*rel->sym_ptr_ptr)->value));
#endif
bfd_put_32 (abfd, base + (*rel->sym_ptr_ptr)->value, temp);
if (bfd_bwrite (temp, (bfd_size_type) 4, abfd) != 4)
return FALSE;
bfd_put_32 (abfd, (bfd_vma) 1, temp);
if (bfd_bwrite (temp, (bfd_size_type) 4, abfd) != 4)
return FALSE;
if (! nlm_sparc_write_reloc (abfd, sec, rel))
return FALSE;
return TRUE;
}
/* Write out an external reference. */
static bfd_boolean
nlm_sparc_write_external (bfd *abfd,
bfd_size_type count,
asymbol *sym,
struct reloc_and_sec *relocs)
{
unsigned int i;
bfd_byte len;
unsigned char temp[NLM_TARGET_LONG_SIZE];
bfd_put_32 (abfd, count, temp);
if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), abfd) != sizeof (temp))
return FALSE;
len = strlen (sym->name);
if ((bfd_bwrite (&len, (bfd_size_type) sizeof (bfd_byte), abfd)
!= sizeof (bfd_byte))
|| bfd_bwrite (sym->name, (bfd_size_type) len, abfd) != len)
return FALSE;
for (i = 0; i < count; i++)
if (! nlm_sparc_write_reloc (abfd, relocs[i].sec, relocs[i].rel))
return FALSE;
return TRUE;
}
static bfd_boolean
nlm_sparc_write_export (bfd * abfd, asymbol * sym, bfd_vma value)
{
bfd_byte len;
bfd_byte temp[4];
#ifdef DEBUG
fprintf (stderr, "%s: <%lx, %u, %s>\n",
__FUNCTION__, (unsigned long) value, strlen (sym->name), sym->name);
#endif
bfd_put_32 (abfd, value, temp);
len = strlen (sym->name);
if (bfd_bwrite (temp, (bfd_size_type) 4, abfd) != 4
|| bfd_bwrite (&len, (bfd_size_type) 1, abfd) != 1
|| bfd_bwrite (sym->name, (bfd_size_type) len, abfd) != len)
return FALSE;
return TRUE;
}
#undef nlm_swap_fixed_header_in
#undef nlm_swap_fixed_header_out
#include "nlmswap.h"
static const struct nlm_backend_data nlm32_sparc_backend =
{
"NetWare SPARC Module \032",
sizeof (Nlm32_sparc_External_Fixed_Header),
0, /* Optional_prefix_size. */
bfd_arch_sparc,
0,
FALSE,
0, /* Backend_object_p. */
0, /* Write_prefix_func. */
nlm_sparc_read_reloc,
nlm_sparc_mangle_relocs,
nlm_sparc_read_import,
nlm_sparc_write_import,
0, /* Set_public_section. */
0, /* Get_public_offset. */
nlm_swap_fixed_header_in,
nlm_swap_fixed_header_out,
nlm_sparc_write_external,
nlm_sparc_write_export
};
#define TARGET_BIG_NAME "nlm32-sparc"
#define TARGET_BIG_SYM sparc_nlm32_vec
#define TARGET_BACKEND_DATA & nlm32_sparc_backend
#include "nlm-target.h"

View File

@ -1,22 +0,0 @@
/* NLM (NetWare Loadable Module) 32-bit executable support for BFD.
Copyright (C) 1993-2018 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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
#define ARCH_SIZE 32
#include "nlmcode.h"

View File

@ -1,22 +0,0 @@
/* NLM (NetWare Loadable Module) 64-bit executable support for BFD.
Copyright (C) 1993-2018 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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
#define ARCH_SIZE 64
#include "nlmcode.h"

File diff suppressed because it is too large Load Diff

View File

@ -1,153 +0,0 @@
/* NLM (NetWare Loadable Module) swapping routines for BFD.
Copyright (C) 1993-2018 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, using ELF support as the
template.
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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
/* Although this is a header file, it defines functions. It is
included by NLM backends to define swapping functions that vary
from one NLM to another. The backend code must arrange for
Nlm_External_xxxx to be defined appropriately, and can then include
this file to get the swapping routines.
At the moment this is only needed for one structure, the fixed NLM
file header. */
/* Translate an NLM fixed length file header in external format into an NLM
file header in internal format. */
static void
nlm_swap_fixed_header_in (bfd *abfd,
void * realsrc,
Nlm_Internal_Fixed_Header *dst)
{
Nlm_External_Fixed_Header *src = (Nlm_External_Fixed_Header *) realsrc;
memcpy (dst->signature, src->signature, NLM_SIGNATURE_SIZE);
memcpy (dst->moduleName, src->moduleName, NLM_MODULE_NAME_SIZE);
dst->version =
H_GET_32 (abfd, src->version);
dst->codeImageOffset =
H_GET_32 (abfd, src->codeImageOffset);
dst->codeImageSize =
H_GET_32 (abfd, src->codeImageSize);
dst->dataImageOffset =
H_GET_32 (abfd, src->dataImageOffset);
dst->dataImageSize =
H_GET_32 (abfd, src->dataImageSize);
dst->uninitializedDataSize =
H_GET_32 (abfd, src->uninitializedDataSize);
dst->customDataOffset =
H_GET_32 (abfd, src->customDataOffset);
dst->customDataSize =
H_GET_32 (abfd, src->customDataSize);
dst->moduleDependencyOffset =
H_GET_32 (abfd, src->moduleDependencyOffset);
dst->numberOfModuleDependencies =
H_GET_32 (abfd, src->numberOfModuleDependencies);
dst->relocationFixupOffset =
H_GET_32 (abfd, src->relocationFixupOffset);
dst->numberOfRelocationFixups =
H_GET_32 (abfd, src->numberOfRelocationFixups);
dst->externalReferencesOffset =
H_GET_32 (abfd, src->externalReferencesOffset);
dst->numberOfExternalReferences =
H_GET_32 (abfd, src->numberOfExternalReferences);
dst->publicsOffset =
H_GET_32 (abfd, src->publicsOffset);
dst->numberOfPublics =
H_GET_32 (abfd, src->numberOfPublics);
dst->debugInfoOffset =
H_GET_32 (abfd, src->debugInfoOffset);
dst->numberOfDebugRecords =
H_GET_32 (abfd, src->numberOfDebugRecords);
dst->codeStartOffset =
H_GET_32 (abfd, src->codeStartOffset);
dst->exitProcedureOffset =
H_GET_32 (abfd, src->exitProcedureOffset);
dst->checkUnloadProcedureOffset =
H_GET_32 (abfd, src->checkUnloadProcedureOffset);
dst->moduleType =
H_GET_32 (abfd, src->moduleType);
dst->flags =
H_GET_32 (abfd, src->flags);
}
/* Translate an NLM fixed length file header in internal format into
an NLM file header in external format. */
static void
nlm_swap_fixed_header_out (bfd *abfd,
Nlm_Internal_Fixed_Header *src,
void * realdst)
{
Nlm_External_Fixed_Header *dst = (Nlm_External_Fixed_Header *) realdst;
memset (dst, 0, sizeof *dst);
memcpy (dst->signature, src->signature, NLM_SIGNATURE_SIZE);
memcpy (dst->moduleName, src->moduleName, NLM_MODULE_NAME_SIZE);
H_PUT_32 (abfd, src->version,
dst->version);
H_PUT_32 (abfd, src->codeImageOffset,
dst->codeImageOffset);
H_PUT_32 (abfd, src->codeImageSize,
dst->codeImageSize);
H_PUT_32 (abfd, src->dataImageOffset,
dst->dataImageOffset);
H_PUT_32 (abfd, src->dataImageSize,
dst->dataImageSize);
H_PUT_32 (abfd, src->uninitializedDataSize,
dst->uninitializedDataSize);
H_PUT_32 (abfd, src->customDataOffset,
dst->customDataOffset);
H_PUT_32 (abfd, src->customDataSize,
dst->customDataSize);
H_PUT_32 (abfd, src->moduleDependencyOffset,
dst->moduleDependencyOffset);
H_PUT_32 (abfd, src->numberOfModuleDependencies,
dst->numberOfModuleDependencies);
H_PUT_32 (abfd, src->relocationFixupOffset,
dst->relocationFixupOffset);
H_PUT_32 (abfd, src->numberOfRelocationFixups,
dst->numberOfRelocationFixups);
H_PUT_32 (abfd, src->externalReferencesOffset,
dst->externalReferencesOffset);
H_PUT_32 (abfd, src->numberOfExternalReferences,
dst->numberOfExternalReferences);
H_PUT_32 (abfd, src->publicsOffset,
dst->publicsOffset);
H_PUT_32 (abfd, src->numberOfPublics,
dst->numberOfPublics);
H_PUT_32 (abfd, src->debugInfoOffset,
dst->debugInfoOffset);
H_PUT_32 (abfd, src->numberOfDebugRecords,
dst->numberOfDebugRecords);
H_PUT_32 (abfd, src->codeStartOffset,
dst->codeStartOffset);
H_PUT_32 (abfd, src->exitProcedureOffset,
dst->exitProcedureOffset);
H_PUT_32 (abfd, src->checkUnloadProcedureOffset,
dst->checkUnloadProcedureOffset);
H_PUT_32 (abfd, src->moduleType,
dst->moduleType);
H_PUT_32 (abfd, src->flags,
dst->flags);
}

View File

@ -288,7 +288,6 @@ libcoff.h
libecoff.h
libhppa.h
libieee.h
libnlm.h
liboasys.h
libpei.h
libxcoff.h
@ -311,16 +310,6 @@ mmo.c
netbsd-core.c
netbsd.h
newsos3.c
nlm-target.h
nlm.c
nlm32-alpha.c
nlm32-i386.c
nlm32-ppc.c
nlm32-sparc.c
nlm32.c
nlm64.c
nlmcode.h
nlmswap.h
ns32k.h
ns32knetbsd.c
oasys.c

View File

@ -152,7 +152,6 @@ DESCRIPTION
. bfd_target_xcoff_flavour,
. bfd_target_elf_flavour,
. bfd_target_ieee_flavour,
. bfd_target_nlm_flavour,
. bfd_target_oasys_flavour,
. bfd_target_tekhex_flavour,
. bfd_target_srec_flavour,
@ -594,7 +593,6 @@ extern const bfd_target aarch64_mach_o_vec;
extern const bfd_target alpha_ecoff_le_vec;
extern const bfd_target alpha_elf64_vec;
extern const bfd_target alpha_elf64_fbsd_vec;
extern const bfd_target alpha_nlm32_vec;
extern const bfd_target alpha_vms_vec;
extern const bfd_target alpha_vms_lib_txt_vec;
extern const bfd_target am33_elf32_linux_vec;
@ -681,7 +679,6 @@ extern const bfd_target i386_elf32_sol2_vec;
extern const bfd_target i386_elf32_vxworks_vec;
extern const bfd_target i386_mach_o_vec;
extern const bfd_target i386_msdos_vec;
extern const bfd_target i386_nlm32_vec;
extern const bfd_target i386_pe_vec;
extern const bfd_target i386_pei_vec;
extern const bfd_target iamcu_elf32_vec;
@ -799,7 +796,6 @@ extern const bfd_target powerpc_elf32_vxworks_vec;
extern const bfd_target powerpc_elf64_vec;
extern const bfd_target powerpc_elf64_le_vec;
extern const bfd_target powerpc_elf64_fbsd_vec;
extern const bfd_target powerpc_nlm32_vec;
extern const bfd_target powerpc_pe_vec;
extern const bfd_target powerpc_pe_le_vec;
extern const bfd_target powerpc_pei_vec;
@ -861,7 +857,6 @@ extern const bfd_target sparc_elf32_vxworks_vec;
extern const bfd_target sparc_elf64_vec;
extern const bfd_target sparc_elf64_fbsd_vec;
extern const bfd_target sparc_elf64_sol2_vec;
extern const bfd_target sparc_nlm32_vec;
extern const bfd_target spu_elf32_vec;
extern const bfd_target sym_vec;
extern const bfd_target tic30_aout_vec;
@ -977,7 +972,6 @@ static const bfd_target * const _bfd_target_vector[] =
&alpha_ecoff_le_vec,
&alpha_elf64_vec,
&alpha_elf64_fbsd_vec,
&alpha_nlm32_vec,
&alpha_vms_vec,
#endif
&alpha_vms_lib_txt_vec,
@ -1111,7 +1105,6 @@ static const bfd_target * const _bfd_target_vector[] =
&i386_elf32_vxworks_vec,
&i386_mach_o_vec,
&i386_msdos_vec,
&i386_nlm32_vec,
&i386_pe_vec,
&i386_pei_vec,
@ -1291,7 +1284,6 @@ static const bfd_target * const _bfd_target_vector[] =
&powerpc_elf64_le_vec,
&powerpc_elf64_fbsd_vec,
#endif
&powerpc_nlm32_vec,
&powerpc_pe_vec,
&powerpc_pe_le_vec,
&powerpc_pei_vec,
@ -1376,7 +1368,6 @@ static const bfd_target * const _bfd_target_vector[] =
&sparc_elf64_fbsd_vec,
&sparc_elf64_sol2_vec,
#endif
&sparc_nlm32_vec,
&spu_elf32_vec,
@ -1872,7 +1863,6 @@ bfd_flavour_name (enum bfd_flavour flavour)
case bfd_target_xcoff_flavour: return "XCOFF";
case bfd_target_elf_flavour: return "ELF";
case bfd_target_ieee_flavour: return "IEEE";
case bfd_target_nlm_flavour: return "NLM";
case bfd_target_oasys_flavour: return "Oasys";
case bfd_target_tekhex_flavour: return "Tekhex";
case bfd_target_srec_flavour: return "Srec";

4
binutils/.gitignore vendored
View File

@ -6,7 +6,6 @@
/dlltool
/dllwrap
/elfedit
/nlmconv
/nm-new
/objcopy
/objdump
@ -29,8 +28,6 @@
/defparse.h
/mcparse.c
/mcparse.h
/nlmheader.c
/nlmheader.h
/rcparse.c
/rcparse.h
/sysinfo.c
@ -45,7 +42,6 @@
/doc/cxxfilt.man
/doc/dlltool.1
/doc/elfedit.1
/doc/nlmconv.1
/doc/nm.1
/doc/objcopy.1
/doc/objdump.1

View File

@ -1,3 +1,19 @@
2018-04-16 Alan Modra <amodra@gmail.com>
* .gitignore: Remove netware support.
* Makefile.am: Likewise.
* configure.ac: Likewise.
* doc/Makefile.am: Likewise.
* doc/binutils.texi: Likewise.
* testsuite/binutils-all/nm.exp: Likewise.
* nlmconv.c: Delete.
* nlmconv.h: Delete.
* nlmheader.y: Delete.
* Makefile.in: Regenerate.
* configure: Regenerate.
* doc/Makefile.in: Regenerate.
* po/POTFILES.in: Regenerate.
2018-04-16 Alan Modra <amodra@gmail.com>
* testsuite/binutils-all/objdump.exp: Remove tahoe support.

View File

@ -78,7 +78,6 @@ DEMANGLER_PROG=cxxfilt
ADDR2LINE_PROG=addr2line
NLMCONV_PROG=nlmconv
DLLTOOL_PROG=dlltool
WINDRES_PROG=windres
WINDMC_PROG=windmc
@ -86,7 +85,7 @@ DLLWRAP_PROG=dllwrap
SRCONV_PROG=srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT)
bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ @BUILD_WINDMC@ $(ADDR2LINE_PROG) $(READELF_PROG) $(ELFEDIT_PROG) @BUILD_DLLWRAP@
bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(OBJCOPY_PROG) @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ @BUILD_WINDMC@ $(ADDR2LINE_PROG) $(READELF_PROG) $(ELFEDIT_PROG) @BUILD_DLLWRAP@
bin_SCRIPTS = @BUILD_INSTALL_MISC@
EXTRA_SCRIPTS = embedspu
@ -102,7 +101,7 @@ TEST_PROGS = $(BFDTEST1_PROG) $(BFDTEST2_PROG)
RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG)
noinst_PROGRAMS = $(RENAMED_PROGS) $(TEST_PROGS) @BUILD_MISC@
EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG)
EXTRA_PROGRAMS = srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG)
# Stuff that goes in tooldir/ if appropriate.
TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy readelf
@ -119,7 +118,7 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \
HFILES = \
arsup.h binemul.h bucomm.h budbg.h \
coffgrok.h debug.h dlltool.h dwarf.h elfcomm.h nlmconv.h \
coffgrok.h debug.h dlltool.h dwarf.h elfcomm.h \
objdump.h sysdep.h unwind-ia64.h windres.h winduni.h windint.h \
windmc.h
@ -132,7 +131,7 @@ CFILES = \
dwarf.c debug.c dlltool.c dllwrap.c \
elfcomm.c emul_aix.c emul_vanilla.c filemode.c \
ieee.c is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c \
nlmconv.c nm.c not-ranlib.c not-strip.c \
nm.c not-ranlib.c not-strip.c \
objcopy.c objdump.c prdbg.c \
od-xcoff.c od-macho.c \
rclex.c rdcoff.c rddbg.c readelf.c rename.c \
@ -144,7 +143,7 @@ CFILES = \
GENERATED_CFILES = \
arparse.c arlex.c sysroff.c sysinfo.c syslex.c \
defparse.c deflex.c nlmheader.c rcparse.c mcparse.c
defparse.c deflex.c rcparse.c mcparse.c
DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c
WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c
@ -216,7 +215,6 @@ strip_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
ranlib_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
cxxfilt_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
objcopy_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
nlmconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
srconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
sysdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
coffdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
@ -388,18 +386,6 @@ endif
$(COMPILE) -c `test -f deflex.c || echo $(srcdir)/`deflex.c $(NO_WERROR)
endif
nlmheader.@OBJEXT@: nlmheader.c
if am__fastdepCC
$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f nlmheader.c || echo $(srcdir)/`nlmheader.c $(NO_WERROR)
mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
else
if AMDEP
source='nlmheader.c' object='$@' libtool=no @AMDEPBACKSLASH@
DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif
$(COMPILE) -c `test -f nlmheader.c || echo $(srcdir)/`nlmheader.c $(NO_WERROR)
endif
rcparse.@OBJEXT@: rcparse.c
if am__fastdepCC
$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f rcparse.c || echo $(srcdir)/`rcparse.c $(NO_WERROR)
@ -483,25 +469,6 @@ coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS)
sysdump_SOURCES = sysdump.c $(BULIBS)
sysdump.@OBJEXT@: sysroff.c
# coff/sym.h and coff/ecoff.h won't be found by the automatic dependency
# scripts, since they are only included conditionally.
nlmconv.@OBJEXT@: nlmconv.c
if am__fastdepCC
ldname=`echo ld | sed '$(transform)'`; \
$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ \
-DLD_NAME="\"$${ldname}\"" @NLMCONV_DEFS@ $(srcdir)/nlmconv.c
mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
else
if AMDEP
source='nlmconv.c' object='$@' libtool=no @AMDEPBACKSLASH@
DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif
ldname=`echo ld | sed '$(transform)'`; \
$(COMPILE) -c -DLD_NAME="\"$${ldname}\"" @NLMCONV_DEFS@ $(srcdir)/nlmconv.c
endif
nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS)
windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.c \
winduni.c resres.c $(BULIBS)
windres_LDADD = $(BFDLIB) $(LIBIBERTY) $(LEXLIB) $(LIBINTL) $(LIBICONV)
@ -514,7 +481,7 @@ dllwrap_SOURCES = dllwrap.c version.c
dllwrap_LDADD = $(LIBIBERTY) $(LIBINTL)
EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
EXTRA_DIST = arparse.c arparse.h arlex.c sysinfo.c sysinfo.h \
syslex.c deflex.c defparse.h defparse.c rcparse.h rcparse.c \
mcparse.h mcparse.c embedspu.sh

View File

@ -71,23 +71,23 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
bin_PROGRAMS = $(am__EXEEXT_6) $(am__EXEEXT_7) $(am__EXEEXT_8) \
$(am__EXEEXT_9) $(am__EXEEXT_10) $(am__EXEEXT_11) \
@BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ \
@BUILD_WINDMC@ $(am__EXEEXT_12) $(am__EXEEXT_13) \
$(am__EXEEXT_14) @BUILD_DLLWRAP@
noinst_PROGRAMS = $(am__EXEEXT_18) $(am__EXEEXT_21) @BUILD_MISC@
EXTRA_PROGRAMS = $(am__EXEEXT_1) srconv$(EXEEXT) sysdump$(EXEEXT) \
coffdump$(EXEEXT) $(am__EXEEXT_2) $(am__EXEEXT_3) \
$(am__EXEEXT_4) $(am__EXEEXT_5)
bin_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \
$(am__EXEEXT_8) $(am__EXEEXT_9) $(am__EXEEXT_10) \
@BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ @BUILD_WINDMC@ \
$(am__EXEEXT_11) $(am__EXEEXT_12) $(am__EXEEXT_13) \
@BUILD_DLLWRAP@ $(am__empty)
noinst_PROGRAMS = $(am__EXEEXT_17) $(am__EXEEXT_20) @BUILD_MISC@
EXTRA_PROGRAMS = srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT) \
$(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
$(am__EXEEXT_4)
subdir = .
DIST_COMMON = NEWS README ChangeLog $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(srcdir)/config.in \
$(srcdir)/../mkinstalldirs $(top_srcdir)/po/Make-in arparse.h \
arparse.c arlex.c defparse.h defparse.c deflex.c nlmheader.h \
nlmheader.c arparse.h arparse.c arlex.c mcparse.h mcparse.c \
rcparse.h rcparse.c $(srcdir)/../depcomp $(srcdir)/../ylwrap
arparse.c arlex.c defparse.h defparse.c deflex.c arparse.h \
arparse.c arlex.c mcparse.h mcparse.c rcparse.h rcparse.c \
$(srcdir)/../depcomp $(srcdir)/../ylwrap
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \
$(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../config/acx.m4 \
@ -117,28 +117,27 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = po/Makefile.in
CONFIG_CLEAN_VPATH_FILES =
am__EXEEXT_1 = nlmconv$(EXEEXT)
am__EXEEXT_2 = dlltool$(EXEEXT)
am__EXEEXT_3 = windres$(EXEEXT)
am__EXEEXT_4 = windmc$(EXEEXT)
am__EXEEXT_5 = dllwrap$(EXEEXT)
am__EXEEXT_6 = size$(EXEEXT)
am__EXEEXT_7 = objdump$(EXEEXT)
am__EXEEXT_8 = ar$(EXEEXT)
am__EXEEXT_9 = strings$(EXEEXT)
am__EXEEXT_10 = ranlib$(EXEEXT)
am__EXEEXT_11 = objcopy$(EXEEXT)
am__EXEEXT_12 = addr2line$(EXEEXT)
am__EXEEXT_13 = readelf$(EXEEXT)
am__EXEEXT_14 = elfedit$(EXEEXT)
am__EXEEXT_1 = dlltool$(EXEEXT)
am__EXEEXT_2 = windres$(EXEEXT)
am__EXEEXT_3 = windmc$(EXEEXT)
am__EXEEXT_4 = dllwrap$(EXEEXT)
am__EXEEXT_5 = size$(EXEEXT)
am__EXEEXT_6 = objdump$(EXEEXT)
am__EXEEXT_7 = ar$(EXEEXT)
am__EXEEXT_8 = strings$(EXEEXT)
am__EXEEXT_9 = ranlib$(EXEEXT)
am__EXEEXT_10 = objcopy$(EXEEXT)
am__EXEEXT_11 = addr2line$(EXEEXT)
am__EXEEXT_12 = readelf$(EXEEXT)
am__EXEEXT_13 = elfedit$(EXEEXT)
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
am__EXEEXT_15 = nm-new$(EXEEXT)
am__EXEEXT_16 = strip-new$(EXEEXT)
am__EXEEXT_17 = cxxfilt$(EXEEXT)
am__EXEEXT_18 = $(am__EXEEXT_15) $(am__EXEEXT_16) $(am__EXEEXT_17)
am__EXEEXT_19 = bfdtest1$(EXEEXT)
am__EXEEXT_20 = bfdtest2$(EXEEXT)
am__EXEEXT_21 = $(am__EXEEXT_19) $(am__EXEEXT_20)
am__EXEEXT_14 = nm-new$(EXEEXT)
am__EXEEXT_15 = strip-new$(EXEEXT)
am__EXEEXT_16 = cxxfilt$(EXEEXT)
am__EXEEXT_17 = $(am__EXEEXT_14) $(am__EXEEXT_15) $(am__EXEEXT_16)
am__EXEEXT_18 = bfdtest1$(EXEEXT)
am__EXEEXT_19 = bfdtest2$(EXEEXT)
am__EXEEXT_20 = $(am__EXEEXT_18) $(am__EXEEXT_19)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
am__objects_1 = bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT)
am_addr2line_OBJECTS = addr2line.$(OBJEXT) $(am__objects_1)
@ -171,10 +170,6 @@ am__objects_2 = elfcomm.$(OBJEXT)
am_elfedit_OBJECTS = elfedit.$(OBJEXT) version.$(OBJEXT) \
$(am__objects_2)
elfedit_OBJECTS = $(am_elfedit_OBJECTS)
am_nlmconv_OBJECTS = nlmconv.$(OBJEXT) nlmheader.$(OBJEXT) \
$(am__objects_1)
nlmconv_OBJECTS = $(am_nlmconv_OBJECTS)
nlmconv_LDADD = $(LDADD)
am_nm_new_OBJECTS = nm.$(OBJEXT) $(am__objects_1)
nm_new_OBJECTS = $(am_nm_new_OBJECTS)
nm_new_LDADD = $(LDADD)
@ -273,11 +268,11 @@ LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
SOURCES = $(addr2line_SOURCES) $(ar_SOURCES) $(EXTRA_ar_SOURCES) \
bfdtest1.c bfdtest2.c $(coffdump_SOURCES) $(cxxfilt_SOURCES) \
$(dlltool_SOURCES) $(dllwrap_SOURCES) $(elfedit_SOURCES) \
$(nlmconv_SOURCES) $(nm_new_SOURCES) $(objcopy_SOURCES) \
$(objdump_SOURCES) $(EXTRA_objdump_SOURCES) $(ranlib_SOURCES) \
$(readelf_SOURCES) $(size_SOURCES) $(srconv_SOURCES) \
$(strings_SOURCES) $(strip_new_SOURCES) $(sysdump_SOURCES) \
$(windmc_SOURCES) $(windres_SOURCES)
$(nm_new_SOURCES) $(objcopy_SOURCES) $(objdump_SOURCES) \
$(EXTRA_objdump_SOURCES) $(ranlib_SOURCES) $(readelf_SOURCES) \
$(size_SOURCES) $(srconv_SOURCES) $(strings_SOURCES) \
$(strip_new_SOURCES) $(sysdump_SOURCES) $(windmc_SOURCES) \
$(windres_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
@ -311,7 +306,6 @@ BUILD_DLLTOOL = @BUILD_DLLTOOL@
BUILD_DLLWRAP = @BUILD_DLLWRAP@
BUILD_INSTALL_MISC = @BUILD_INSTALL_MISC@
BUILD_MISC = @BUILD_MISC@
BUILD_NLMCONV = @BUILD_NLMCONV@
BUILD_SRCONV = @BUILD_SRCONV@
BUILD_WINDMC = @BUILD_WINDMC@
BUILD_WINDRES = @BUILD_WINDRES@
@ -372,7 +366,6 @@ MKDIR_P = @MKDIR_P@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
NLMCONV_DEFS = @NLMCONV_DEFS@
NM = @NM@
NMEDIT = @NMEDIT@
NO_WERROR = @NO_WERROR@
@ -501,7 +494,6 @@ OBJDUMP_PROG = objdump
# Note: This one is used as the installed name too, unlike the above.
DEMANGLER_PROG = cxxfilt
ADDR2LINE_PROG = addr2line
NLMCONV_PROG = nlmconv
DLLTOOL_PROG = dlltool
WINDRES_PROG = windres
WINDMC_PROG = windmc
@ -527,7 +519,7 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \
HFILES = \
arsup.h binemul.h bucomm.h budbg.h \
coffgrok.h debug.h dlltool.h dwarf.h elfcomm.h nlmconv.h \
coffgrok.h debug.h dlltool.h dwarf.h elfcomm.h \
objdump.h sysdep.h unwind-ia64.h windres.h winduni.h windint.h \
windmc.h
@ -539,7 +531,7 @@ CFILES = \
dwarf.c debug.c dlltool.c dllwrap.c \
elfcomm.c emul_aix.c emul_vanilla.c filemode.c \
ieee.c is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c \
nlmconv.c nm.c not-ranlib.c not-strip.c \
nm.c not-ranlib.c not-strip.c \
objcopy.c objdump.c prdbg.c \
od-xcoff.c od-macho.c \
rclex.c rdcoff.c rddbg.c readelf.c rename.c \
@ -551,7 +543,7 @@ CFILES = \
GENERATED_CFILES = \
arparse.c arlex.c sysroff.c sysinfo.c syslex.c \
defparse.c deflex.c nlmheader.c rcparse.c mcparse.c
defparse.c deflex.c rcparse.c mcparse.c
DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c
WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c
@ -595,7 +587,6 @@ strip_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
ranlib_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
cxxfilt_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
objcopy_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
nlmconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
srconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
sysdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
coffdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
@ -637,7 +628,6 @@ dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS)
dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) $(LEXLIB) $(LIBINTL)
coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS)
sysdump_SOURCES = sysdump.c $(BULIBS)
nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS)
windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.c \
winduni.c resres.c $(BULIBS)
@ -648,7 +638,7 @@ windmc_SOURCES = windmc.c mcparse.y mclex.c \
windmc_LDADD = $(BFDLIB) $(LIBIBERTY) $(LEXLIB) $(LIBINTL) $(LIBICONV)
dllwrap_SOURCES = dllwrap.c version.c
dllwrap_LDADD = $(LIBIBERTY) $(LIBINTL)
EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
EXTRA_DIST = arparse.c arparse.h arlex.c sysinfo.c sysinfo.h \
syslex.c deflex.c defparse.h defparse.c rcparse.h rcparse.c \
mcparse.h mcparse.c embedspu.sh
@ -803,12 +793,6 @@ dllwrap$(EXEEXT): $(dllwrap_OBJECTS) $(dllwrap_DEPENDENCIES) $(EXTRA_dllwrap_DEP
elfedit$(EXEEXT): $(elfedit_OBJECTS) $(elfedit_DEPENDENCIES) $(EXTRA_elfedit_DEPENDENCIES)
@rm -f elfedit$(EXEEXT)
$(LINK) $(elfedit_OBJECTS) $(elfedit_LDADD) $(LIBS)
nlmheader.h: nlmheader.c
@if test ! -f $@; then rm -f nlmheader.c; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) nlmheader.c; else :; fi
nlmconv$(EXEEXT): $(nlmconv_OBJECTS) $(nlmconv_DEPENDENCIES) $(EXTRA_nlmconv_DEPENDENCIES)
@rm -f nlmconv$(EXEEXT)
$(LINK) $(nlmconv_OBJECTS) $(nlmconv_LDADD) $(LIBS)
nm-new$(EXEEXT): $(nm_new_OBJECTS) $(nm_new_DEPENDENCIES) $(EXTRA_nm_new_DEPENDENCIES)
@rm -f nm-new$(EXEEXT)
$(LINK) $(nm_new_OBJECTS) $(nm_new_LDADD) $(LIBS)
@ -925,8 +909,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maybe-strip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mclex.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcparse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlmconv.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlmheader.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/not-ranlib.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/not-strip.Po@am__quote@
@ -1211,8 +1193,6 @@ maintainer-clean-generic:
-rm -f defparse.h
-rm -f mcparse.c
-rm -f mcparse.h
-rm -f nlmheader.c
-rm -f nlmheader.h
-rm -f rcparse.c
-rm -f rcparse.h
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
@ -1428,13 +1408,6 @@ deflex.@OBJEXT@: deflex.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f deflex.c || echo $(srcdir)/`deflex.c $(NO_WERROR)
nlmheader.@OBJEXT@: nlmheader.c
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f nlmheader.c || echo $(srcdir)/`nlmheader.c $(NO_WERROR)
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nlmheader.c' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f nlmheader.c || echo $(srcdir)/`nlmheader.c $(NO_WERROR)
rcparse.@OBJEXT@: rcparse.c
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f rcparse.c || echo $(srcdir)/`rcparse.c $(NO_WERROR)
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@ -1479,18 +1452,6 @@ rescoff.@OBJEXT@:
@am__fastdepCC_FALSE@ $(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/rescoff.c
sysdump.@OBJEXT@: sysroff.c
# coff/sym.h and coff/ecoff.h won't be found by the automatic dependency
# scripts, since they are only included conditionally.
nlmconv.@OBJEXT@: nlmconv.c
@am__fastdepCC_TRUE@ ldname=`echo ld | sed '$(transform)'`; \
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ \
@am__fastdepCC_TRUE@ -DLD_NAME="\"$${ldname}\"" @NLMCONV_DEFS@ $(srcdir)/nlmconv.c
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nlmconv.c' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ ldname=`echo ld | sed '$(transform)'`; \
@am__fastdepCC_FALSE@ $(COMPILE) -c -DLD_NAME="\"$${ldname}\"" @NLMCONV_DEFS@ $(srcdir)/nlmconv.c
diststuff: $(EXTRA_DIST) info
all: info
mostlyclean-local:

31
binutils/configure vendored
View File

@ -614,8 +614,6 @@ BUILD_WINDRES
DLLTOOL_DEFS
BUILD_DLLTOOL
BUILD_SRCONV
BUILD_NLMCONV
NLMCONV_DEFS
LTLIBICONV
LIBICONV
zlibinc
@ -11226,7 +11224,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11229 "configure"
#line 11227 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11332,7 +11330,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11335 "configure"
#line 11333 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -14420,8 +14418,6 @@ _ACEOF
all_targets=false
BUILD_NLMCONV=
NLMCONV_DEFS=
BUILD_SRCONV=
BUILD_DLLTOOL=
DLLTOOL_DEFS=
@ -14440,9 +14436,7 @@ for targ in $target $canon_targets
do
if test "x$targ" = "xall"; then
all_targets=true
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
BUILD_SRCONV='$(SRCONV_PROG)'
NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
@ -14454,25 +14448,6 @@ do
BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
od_vectors="$od_vectors objdump_private_desc_xcoff"
else
case $targ in
i[3-7]86*-*-netware*)
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
;;
alpha*-*-netware*)
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
;;
powerpc*-*-netware*)
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
;;
sparc*-*-netware*)
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
;;
esac
case $targ in
*-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
esac
@ -14667,8 +14642,6 @@ OBJDUMP_DEFS="${OBJDUMP_DEFS} -DOBJDUMP_PRIVATE_VECTORS=\"${OBJDUMP_PRIVATE_VECT
cat >>confdefs.h <<_ACEOF
#define TARGET "${target}"
_ACEOF

View File

@ -228,8 +228,6 @@ AC_CHECK_HEADER(iconv.h)
AM_ICONV
all_targets=false
BUILD_NLMCONV=
NLMCONV_DEFS=
BUILD_SRCONV=
BUILD_DLLTOOL=
DLLTOOL_DEFS=
@ -248,9 +246,7 @@ for targ in $target $canon_targets
do
if test "x$targ" = "xall"; then
all_targets=true
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
BUILD_SRCONV='$(SRCONV_PROG)'
NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
@ -263,27 +259,6 @@ do
od_vectors="$od_vectors objdump_private_desc_xcoff"
else
case $targ in
changequote(,)dnl
i[3-7]86*-*-netware*)
changequote([,])dnl
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
;;
alpha*-*-netware*)
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
;;
powerpc*-*-netware*)
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
;;
sparc*-*-netware*)
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
;;
esac
case $targ in
*-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
esac
@ -473,8 +448,6 @@ fi
OBJDUMP_DEFS="${OBJDUMP_DEFS} -DOBJDUMP_PRIVATE_VECTORS=\"${OBJDUMP_PRIVATE_VECTORS}\""
AC_SUBST(NLMCONV_DEFS)
AC_SUBST(BUILD_NLMCONV)
AC_SUBST(BUILD_SRCONV)
AC_SUBST(BUILD_DLLTOOL)
AC_SUBST(DLLTOOL_DEFS)

View File

@ -35,7 +35,6 @@ man_MANS = \
addr2line.1 \
ar.1 \
dlltool.1 \
nlmconv.1 \
nm.1 \
objcopy.1 \
objdump.1 \
@ -79,13 +78,6 @@ dlltool.1: $(binutils_TEXI) $(binutils_TEXINFOS)
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
rm -f dlltool.pod
nlmconv.1: $(binutils_TEXI) $(binutils_TEXINFOS)
touch $@
-$(TEXI2POD) $(MANCONF) -Dnlmconv < $(binutils_TEXI) > nlmconv.pod
-($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
rm -f nlmconv.pod
nm.1: $(binutils_TEXI) $(binutils_TEXINFOS)
touch $@
-$(TEXI2POD) $(MANCONF) -Dnm < $(binutils_TEXI) > nm.pod

View File

@ -161,7 +161,6 @@ BUILD_DLLTOOL = @BUILD_DLLTOOL@
BUILD_DLLWRAP = @BUILD_DLLWRAP@
BUILD_INSTALL_MISC = @BUILD_INSTALL_MISC@
BUILD_MISC = @BUILD_MISC@
BUILD_NLMCONV = @BUILD_NLMCONV@
BUILD_SRCONV = @BUILD_SRCONV@
BUILD_WINDMC = @BUILD_WINDMC@
BUILD_WINDRES = @BUILD_WINDRES@
@ -222,7 +221,6 @@ MKDIR_P = @MKDIR_P@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
NLMCONV_DEFS = @NLMCONV_DEFS@
NM = @NM@
NMEDIT = @NMEDIT@
NO_WERROR = @NO_WERROR@
@ -328,7 +326,6 @@ man_MANS = \
addr2line.1 \
ar.1 \
dlltool.1 \
nlmconv.1 \
nm.1 \
objcopy.1 \
objdump.1 \
@ -828,13 +825,6 @@ dlltool.1: $(binutils_TEXI) $(binutils_TEXINFOS)
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
rm -f dlltool.pod
nlmconv.1: $(binutils_TEXI) $(binutils_TEXINFOS)
touch $@
-$(TEXI2POD) $(MANCONF) -Dnlmconv < $(binutils_TEXI) > nlmconv.pod
-($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
rm -f nlmconv.pod
nm.1: $(binutils_TEXI) $(binutils_TEXINFOS)
touch $@
-$(TEXI2POD) $(MANCONF) -Dnm < $(binutils_TEXI) > nm.pod

View File

@ -34,7 +34,6 @@ section entitled ``GNU Free Documentation License''.
* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols.
* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt.
* dlltool: (binutils)dlltool. Create files needed to build and use DLLs.
* nlmconv: (binutils)nlmconv. Converts object code into an NLM.
* nm: (binutils)nm. List symbols from object files.
* objcopy: (binutils)objcopy. Copy and translate object files.
* objdump: (binutils)objdump. Display information from object files.
@ -121,9 +120,6 @@ Demangle encoded C++ symbols (on MS-DOS, this program is named
@item addr2line
Convert addresses into file names and line numbers
@item nlmconv
Convert object code into a Netware Loadable Module
@item windres
Manipulate Windows resources
@ -151,7 +147,6 @@ in the section entitled ``GNU Free Documentation License''.
* c++filt:: Filter to demangle encoded C++ symbols
* cxxfilt: c++filt. MS-DOS name for c++filt
* addr2line:: Convert addresses to file and line
* nlmconv:: Converts object code into an NLM
* windmc:: Generator for Windows message resources
* windres:: Manipulate Windows resources
* dlltool:: Create files needed to build and use DLLs
@ -3697,111 +3692,6 @@ Info entries for @file{binutils}.
@c man end
@end ignore
@node nlmconv
@chapter nlmconv
@command{nlmconv} converts a relocatable object file into a NetWare
Loadable Module.
@ignore
@command{nlmconv} currently works with @samp{i386} object
files in @code{coff}, @sc{elf}, or @code{a.out} format, and @sc{SPARC}
object files in @sc{elf}, or @code{a.out} format@footnote{
@command{nlmconv} should work with any @samp{i386} or @sc{sparc} object
format in the Binary File Descriptor library. It has only been tested
with the above formats.}.
@end ignore
@quotation
@emph{Warning:} @command{nlmconv} is not always built as part of the binary
utilities, since it is only useful for NLM targets.
@end quotation
@c man title nlmconv converts object code into an NLM.
@smallexample
@c man begin SYNOPSIS nlmconv
nlmconv [@option{-I} @var{bfdname}|@option{--input-target=}@var{bfdname}]
[@option{-O} @var{bfdname}|@option{--output-target=}@var{bfdname}]
[@option{-T} @var{headerfile}|@option{--header-file=}@var{headerfile}]
[@option{-d}|@option{--debug}] [@option{-l} @var{linker}|@option{--linker=}@var{linker}]
[@option{-h}|@option{--help}] [@option{-V}|@option{--version}]
@var{infile} @var{outfile}
@c man end
@end smallexample
@c man begin DESCRIPTION nlmconv
@command{nlmconv} converts the relocatable @samp{i386} object file
@var{infile} into the NetWare Loadable Module @var{outfile}, optionally
reading @var{headerfile} for NLM header information. For instructions
on writing the NLM command file language used in header files, see the
@samp{linkers} section, @samp{NLMLINK} in particular, of the @cite{NLM
Development and Tools Overview}, which is part of the NLM Software
Developer's Kit (``NLM SDK''), available from Novell, Inc.
@command{nlmconv} uses the @sc{gnu} Binary File Descriptor library to read
@var{infile};
@ifclear man
see @ref{BFD,,BFD,ld.info,Using LD}, for more information.
@end ifclear
@command{nlmconv} can perform a link step. In other words, you can list
more than one object file for input if you list them in the definitions
file (rather than simply specifying one input file on the command line).
In this case, @command{nlmconv} calls the linker for you.
@c man end
@c man begin OPTIONS nlmconv
@table @env
@item -I @var{bfdname}
@itemx --input-target=@var{bfdname}
Object format of the input file. @command{nlmconv} can usually determine
the format of a given file (so no default is necessary).
@xref{Target Selection}, for more information.
@item -O @var{bfdname}
@itemx --output-target=@var{bfdname}
Object format of the output file. @command{nlmconv} infers the output
format based on the input format, e.g. for a @samp{i386} input file the
output format is @samp{nlm32-i386}.
@xref{Target Selection}, for more information.
@item -T @var{headerfile}
@itemx --header-file=@var{headerfile}
Reads @var{headerfile} for NLM header information. For instructions on
writing the NLM command file language used in header files, see@ see the
@samp{linkers} section, of the @cite{NLM Development and Tools
Overview}, which is part of the NLM Software Developer's Kit, available
from Novell, Inc.
@item -d
@itemx --debug
Displays (on standard error) the linker command line used by @command{nlmconv}.
@item -l @var{linker}
@itemx --linker=@var{linker}
Use @var{linker} for any linking. @var{linker} can be an absolute or a
relative pathname.
@item -h
@itemx --help
Prints a usage summary.
@item -V
@itemx --version
Prints the version number for @command{nlmconv}.
@end table
@c man end
@ignore
@c man begin SEEALSO nlmconv
the Info entries for @file{binutils}.
@c man end
@end ignore
@node windmc
@chapter windmc

File diff suppressed because it is too large Load Diff

View File

@ -1,86 +0,0 @@
/* nlmconv.h -- header file for NLM conversion program
Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of GNU Binutils.
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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
/* Written by Ian Lance Taylor <ian@cygnus.com>.
bfd.h, nlm/common.h and nlm/internal.h must be included before this
file. */
/* A linked list of strings. */
struct string_list
{
struct string_list *next;
char *string;
};
/* The NLM header parser in nlmheader.y stores information in the
following variables. */
extern Nlm_Internal_Fixed_Header *fixed_hdr;
extern Nlm_Internal_Variable_Header *var_hdr;
extern Nlm_Internal_Version_Header *version_hdr;
extern Nlm_Internal_Copyright_Header *copyright_hdr;
extern Nlm_Internal_Extended_Header *extended_hdr;
/* Procedure named by CHECK. */
extern char *check_procedure;
/* File named by CUSTOM. */
extern char *custom_file;
/* Whether to generate debugging information (DEBUG). */
extern bfd_boolean debug_info;
/* Procedure named by EXIT. */
extern char *exit_procedure;
/* Exported symbols (EXPORT). */
extern struct string_list *export_symbols;
/* List of files from INPUT. */
extern struct string_list *input_files;
/* Map file name (MAP, FULLMAP). */
extern char *map_file;
/* Whether a full map has been requested (FULLMAP). */
extern bfd_boolean full_map;
/* File named by HELP. */
extern char *help_file;
/* Imported symbols (IMPORT). */
extern struct string_list *import_symbols;
/* File named by MESSAGES. */
extern char *message_file;
/* Autoload module list (MODULE). */
extern struct string_list *modules;
/* File named by OUTPUT. */
extern char *output_file;
/* File named by SHARELIB. */
extern char *sharelib_file;
/* Start procedure name (START). */
extern char *start_procedure;
/* VERBOSE. */
extern bfd_boolean verbose;
/* RPC description file (XDCDATA). */
extern char *rpc_file;
/* The number of serious parse errors. */
extern int parse_errors;
/* The parser. */
extern int yyparse (void);
/* Tell the lexer what file to read. */
extern bfd_boolean nlmlex_file (const char *);

View File

@ -1,959 +0,0 @@
%{/* nlmheader.y - parse NLM header specification keywords.
Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of GNU Binutils.
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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
/* Written by Ian Lance Taylor <ian@cygnus.com>.
This bison file parses the commands recognized by the NetWare NLM
linker, except for lists of object files. It stores the
information in global variables.
This implementation is based on the description in the NetWare Tool
Maker Specification manual, edition 1.0. */
#include "sysdep.h"
#include "safe-ctype.h"
#include "bfd.h"
#include "nlm/common.h"
#include "nlm/internal.h"
#include "bucomm.h"
#include "nlmconv.h"
/* Information is stored in the structures pointed to by these
variables. */
Nlm_Internal_Fixed_Header *fixed_hdr;
Nlm_Internal_Variable_Header *var_hdr;
Nlm_Internal_Version_Header *version_hdr;
Nlm_Internal_Copyright_Header *copyright_hdr;
Nlm_Internal_Extended_Header *extended_hdr;
/* Procedure named by CHECK. */
char *check_procedure;
/* File named by CUSTOM. */
char *custom_file;
/* Whether to generate debugging information (DEBUG). */
bfd_boolean debug_info;
/* Procedure named by EXIT. */
char *exit_procedure;
/* Exported symbols (EXPORT). */
struct string_list *export_symbols;
/* List of files from INPUT. */
struct string_list *input_files;
/* Map file name (MAP, FULLMAP). */
char *map_file;
/* Whether a full map has been requested (FULLMAP). */
bfd_boolean full_map;
/* File named by HELP. */
char *help_file;
/* Imported symbols (IMPORT). */
struct string_list *import_symbols;
/* File named by MESSAGES. */
char *message_file;
/* Autoload module list (MODULE). */
struct string_list *modules;
/* File named by OUTPUT. */
char *output_file;
/* File named by SHARELIB. */
char *sharelib_file;
/* Start procedure name (START). */
char *start_procedure;
/* VERBOSE. */
bfd_boolean verbose;
/* RPC description file (XDCDATA). */
char *rpc_file;
/* The number of serious errors that have occurred. */
int parse_errors;
/* The current symbol prefix when reading a list of import or export
symbols. */
static char *symbol_prefix;
/* Parser error message handler. */
#define yyerror(msg) nlmheader_error (msg);
/* Local functions. */
static int yylex (void);
static void nlmlex_file_push (const char *);
static bfd_boolean nlmlex_file_open (const char *);
static int nlmlex_buf_init (void);
static char nlmlex_buf_add (int);
static long nlmlex_get_number (const char *);
static void nlmheader_identify (void);
static void nlmheader_warn (const char *, int);
static void nlmheader_error (const char *);
static struct string_list * string_list_cons (char *, struct string_list *);
static struct string_list * string_list_append (struct string_list *,
struct string_list *);
static struct string_list * string_list_append1 (struct string_list *,
char *);
static char *xstrdup (const char *);
%}
%union
{
char *string;
struct string_list *list;
};
/* The reserved words. */
%token CHECK CODESTART COPYRIGHT CUSTOM DATE DEBUG_K DESCRIPTION EXIT
%token EXPORT FLAG_ON FLAG_OFF FULLMAP HELP IMPORT INPUT MAP MESSAGES
%token MODULE MULTIPLE OS_DOMAIN OUTPUT PSEUDOPREEMPTION REENTRANT
%token SCREENNAME SHARELIB STACK START SYNCHRONIZE
%token THREADNAME TYPE VERBOSE VERSIONK XDCDATA
/* Arguments. */
%token <string> STRING
%token <string> QUOTED_STRING
/* Typed non-terminals. */
%type <list> symbol_list_opt symbol_list string_list
%type <string> symbol
%%
/* Keywords must start in the leftmost column of the file. Arguments
may appear anywhere else. The lexer uses this to determine what
token to return, so we don't have to worry about it here. */
/* The entire file is just a list of commands. */
file:
commands
;
/* A possibly empty list of commands. */
commands:
/* May be empty. */
| command commands
;
/* A single command. There is where most of the work takes place. */
command:
CHECK STRING
{
check_procedure = $2;
}
| CODESTART STRING
{
nlmheader_warn (_("CODESTART is not implemented; sorry"), -1);
free ($2);
}
| COPYRIGHT QUOTED_STRING
{
int len;
strncpy (copyright_hdr->stamp, "CoPyRiGhT=", 10);
len = strlen ($2);
if (len >= NLM_MAX_COPYRIGHT_MESSAGE_LENGTH)
{
nlmheader_warn (_("copyright string is too long"),
NLM_MAX_COPYRIGHT_MESSAGE_LENGTH - 1);
len = NLM_MAX_COPYRIGHT_MESSAGE_LENGTH - 1;
}
copyright_hdr->copyrightMessageLength = len;
strncpy (copyright_hdr->copyrightMessage, $2, len);
copyright_hdr->copyrightMessage[len] = '\0';
free ($2);
}
| CUSTOM STRING
{
custom_file = $2;
}
| DATE STRING STRING STRING
{
/* We don't set the version stamp here, because we use the
version stamp to detect whether the required VERSION
keyword was given. */
version_hdr->month = nlmlex_get_number ($2);
version_hdr->day = nlmlex_get_number ($3);
version_hdr->year = nlmlex_get_number ($4);
free ($2);
free ($3);
free ($4);
if (version_hdr->month < 1 || version_hdr->month > 12)
nlmheader_warn (_("illegal month"), -1);
if (version_hdr->day < 1 || version_hdr->day > 31)
nlmheader_warn (_("illegal day"), -1);
if (version_hdr->year < 1900 || version_hdr->year > 3000)
nlmheader_warn (_("illegal year"), -1);
}
| DEBUG_K
{
debug_info = TRUE;
}
| DESCRIPTION QUOTED_STRING
{
int len;
len = strlen ($2);
if (len > NLM_MAX_DESCRIPTION_LENGTH)
{
nlmheader_warn (_("description string is too long"),
NLM_MAX_DESCRIPTION_LENGTH);
len = NLM_MAX_DESCRIPTION_LENGTH;
}
var_hdr->descriptionLength = len;
strncpy (var_hdr->descriptionText, $2, len);
var_hdr->descriptionText[len] = '\0';
free ($2);
}
| EXIT STRING
{
exit_procedure = $2;
}
| EXPORT
{
symbol_prefix = NULL;
}
symbol_list_opt
{
export_symbols = string_list_append (export_symbols, $3);
}
| FLAG_ON STRING
{
fixed_hdr->flags |= nlmlex_get_number ($2);
free ($2);
}
| FLAG_OFF STRING
{
fixed_hdr->flags &=~ nlmlex_get_number ($2);
free ($2);
}
| FULLMAP
{
map_file = "";
full_map = TRUE;
}
| FULLMAP STRING
{
map_file = $2;
full_map = TRUE;
}
| HELP STRING
{
help_file = $2;
}
| IMPORT
{
symbol_prefix = NULL;
}
symbol_list_opt
{
import_symbols = string_list_append (import_symbols, $3);
}
| INPUT string_list
{
input_files = string_list_append (input_files, $2);
}
| MAP
{
map_file = "";
}
| MAP STRING
{
map_file = $2;
}
| MESSAGES STRING
{
message_file = $2;
}
| MODULE string_list
{
modules = string_list_append (modules, $2);
}
| MULTIPLE
{
fixed_hdr->flags |= 0x2;
}
| OS_DOMAIN
{
fixed_hdr->flags |= 0x10;
}
| OUTPUT STRING
{
if (output_file == NULL)
output_file = $2;
else
nlmheader_warn (_("ignoring duplicate OUTPUT statement"), -1);
}
| PSEUDOPREEMPTION
{
fixed_hdr->flags |= 0x8;
}
| REENTRANT
{
fixed_hdr->flags |= 0x1;
}
| SCREENNAME QUOTED_STRING
{
int len;
len = strlen ($2);
if (len >= NLM_MAX_SCREEN_NAME_LENGTH)
{
nlmheader_warn (_("screen name is too long"),
NLM_MAX_SCREEN_NAME_LENGTH);
len = NLM_MAX_SCREEN_NAME_LENGTH;
}
var_hdr->screenNameLength = len;
strncpy (var_hdr->screenName, $2, len);
var_hdr->screenName[NLM_MAX_SCREEN_NAME_LENGTH] = '\0';
free ($2);
}
| SHARELIB STRING
{
sharelib_file = $2;
}
| STACK STRING
{
var_hdr->stackSize = nlmlex_get_number ($2);
free ($2);
}
| START STRING
{
start_procedure = $2;
}
| SYNCHRONIZE
{
fixed_hdr->flags |= 0x4;
}
| THREADNAME QUOTED_STRING
{
int len;
len = strlen ($2);
if (len >= NLM_MAX_THREAD_NAME_LENGTH)
{
nlmheader_warn (_("thread name is too long"),
NLM_MAX_THREAD_NAME_LENGTH);
len = NLM_MAX_THREAD_NAME_LENGTH;
}
var_hdr->threadNameLength = len;
strncpy (var_hdr->threadName, $2, len);
var_hdr->threadName[len] = '\0';
free ($2);
}
| TYPE STRING
{
fixed_hdr->moduleType = nlmlex_get_number ($2);
free ($2);
}
| VERBOSE
{
verbose = TRUE;
}
| VERSIONK STRING STRING STRING
{
long val;
strncpy (version_hdr->stamp, "VeRsIoN#", 8);
version_hdr->majorVersion = nlmlex_get_number ($2);
val = nlmlex_get_number ($3);
if (val < 0 || val > 99)
nlmheader_warn (_("illegal minor version number (must be between 0 and 99)"),
-1);
else
version_hdr->minorVersion = val;
val = nlmlex_get_number ($4);
if (val < 0)
nlmheader_warn (_("illegal revision number (must be between 0 and 26)"),
-1);
else if (val > 26)
version_hdr->revision = 0;
else
version_hdr->revision = val;
free ($2);
free ($3);
free ($4);
}
| VERSIONK STRING STRING
{
long val;
strncpy (version_hdr->stamp, "VeRsIoN#", 8);
version_hdr->majorVersion = nlmlex_get_number ($2);
val = nlmlex_get_number ($3);
if (val < 0 || val > 99)
nlmheader_warn (_("illegal minor version number (must be between 0 and 99)"),
-1);
else
version_hdr->minorVersion = val;
version_hdr->revision = 0;
free ($2);
free ($3);
}
| XDCDATA STRING
{
rpc_file = $2;
}
;
/* A possibly empty list of symbols. */
symbol_list_opt:
/* Empty. */
{
$$ = NULL;
}
| symbol_list
{
$$ = $1;
}
;
/* A list of symbols in an import or export list. Prefixes may appear
in parentheses. We need to use left recursion here to avoid
building up a large import list on the parser stack. */
symbol_list:
symbol
{
$$ = string_list_cons ($1, NULL);
}
| symbol_prefix
{
$$ = NULL;
}
| symbol_list symbol
{
$$ = string_list_append1 ($1, $2);
}
| symbol_list symbol_prefix
{
$$ = $1;
}
;
/* A prefix for subsequent symbols. */
symbol_prefix:
'(' STRING ')'
{
if (symbol_prefix != NULL)
free (symbol_prefix);
symbol_prefix = $2;
}
;
/* A single symbol. */
symbol:
STRING
{
if (symbol_prefix == NULL)
$$ = $1;
else
{
$$ = xmalloc (strlen (symbol_prefix) + strlen ($1) + 2);
sprintf ($$, "%s@%s", symbol_prefix, $1);
free ($1);
}
}
;
/* A list of strings. */
string_list:
/* May be empty. */
{
$$ = NULL;
}
| STRING string_list
{
$$ = string_list_cons ($1, $2);
}
;
%%
/* If strerror is just a macro, we want to use the one from libiberty
since it will handle undefined values. */
#undef strerror
extern char *strerror (int);
/* The lexer is simple, too simple for flex. Keywords are only
recognized at the start of lines. Everything else must be an
argument. A comma is treated as whitespace. */
/* The states the lexer can be in. */
enum lex_state
{
/* At the beginning of a line. */
BEGINNING_OF_LINE,
/* In the middle of a line. */
IN_LINE
};
/* We need to keep a stack of files to handle file inclusion. */
struct input
{
/* The file to read from. */
FILE *file;
/* The name of the file. */
char *name;
/* The current line number. */
int lineno;
/* The current state. */
enum lex_state state;
/* The next file on the stack. */
struct input *next;
};
/* The current input file. */
static struct input current;
/* The character which introduces comments. */
#define COMMENT_CHAR '#'
/* Start the lexer going on the main input file. */
bfd_boolean
nlmlex_file (const char *name)
{
current.next = NULL;
return nlmlex_file_open (name);
}
/* Start the lexer going on a subsidiary input file. */
static void
nlmlex_file_push (const char *name)
{
struct input *push;
push = (struct input *) xmalloc (sizeof (struct input));
*push = current;
if (nlmlex_file_open (name))
current.next = push;
else
{
current = *push;
free (push);
}
}
/* Start lexing from a file. */
static bfd_boolean
nlmlex_file_open (const char *name)
{
current.file = fopen (name, "r");
if (current.file == NULL)
{
fprintf (stderr, "%s:%s: %s\n", program_name, name, strerror (errno));
++parse_errors;
return FALSE;
}
current.name = xstrdup (name);
current.lineno = 1;
current.state = BEGINNING_OF_LINE;
return TRUE;
}
/* Table used to turn keywords into tokens. */
struct keyword_tokens_struct
{
const char *keyword;
int token;
};
static struct keyword_tokens_struct keyword_tokens[] =
{
{ "CHECK", CHECK },
{ "CODESTART", CODESTART },
{ "COPYRIGHT", COPYRIGHT },
{ "CUSTOM", CUSTOM },
{ "DATE", DATE },
{ "DEBUG", DEBUG_K },
{ "DESCRIPTION", DESCRIPTION },
{ "EXIT", EXIT },
{ "EXPORT", EXPORT },
{ "FLAG_ON", FLAG_ON },
{ "FLAG_OFF", FLAG_OFF },
{ "FULLMAP", FULLMAP },
{ "HELP", HELP },
{ "IMPORT", IMPORT },
{ "INPUT", INPUT },
{ "MAP", MAP },
{ "MESSAGES", MESSAGES },
{ "MODULE", MODULE },
{ "MULTIPLE", MULTIPLE },
{ "OS_DOMAIN", OS_DOMAIN },
{ "OUTPUT", OUTPUT },
{ "PSEUDOPREEMPTION", PSEUDOPREEMPTION },
{ "REENTRANT", REENTRANT },
{ "SCREENNAME", SCREENNAME },
{ "SHARELIB", SHARELIB },
{ "STACK", STACK },
{ "STACKSIZE", STACK },
{ "START", START },
{ "SYNCHRONIZE", SYNCHRONIZE },
{ "THREADNAME", THREADNAME },
{ "TYPE", TYPE },
{ "VERBOSE", VERBOSE },
{ "VERSION", VERSIONK },
{ "XDCDATA", XDCDATA }
};
#define KEYWORD_COUNT (sizeof (keyword_tokens) / sizeof (keyword_tokens[0]))
/* The lexer accumulates strings in these variables. */
static char *lex_buf;
static int lex_size;
static int lex_pos;
/* Start accumulating strings into the buffer. */
#define BUF_INIT() \
((void) (lex_buf != NULL ? lex_pos = 0 : nlmlex_buf_init ()))
static int
nlmlex_buf_init (void)
{
lex_size = 10;
lex_buf = xmalloc (lex_size + 1);
lex_pos = 0;
return 0;
}
/* Finish a string in the buffer. */
#define BUF_FINISH() ((void) (lex_buf[lex_pos] = '\0'))
/* Accumulate a character into the buffer. */
#define BUF_ADD(c) \
((void) (lex_pos < lex_size \
? lex_buf[lex_pos++] = (c) \
: nlmlex_buf_add (c)))
static char
nlmlex_buf_add (int c)
{
if (lex_pos >= lex_size)
{
lex_size *= 2;
lex_buf = xrealloc (lex_buf, lex_size + 1);
}
return lex_buf[lex_pos++] = c;
}
/* The lexer proper. This is called by the bison generated parsing
code. */
static int
yylex (void)
{
int c;
tail_recurse:
c = getc (current.file);
/* Commas are treated as whitespace characters. */
while (ISSPACE (c) || c == ',')
{
current.state = IN_LINE;
if (c == '\n')
{
++current.lineno;
current.state = BEGINNING_OF_LINE;
}
c = getc (current.file);
}
/* At the end of the file we either pop to the previous file or
finish up. */
if (c == EOF)
{
fclose (current.file);
free (current.name);
if (current.next == NULL)
return 0;
else
{
struct input *next;
next = current.next;
current = *next;
free (next);
goto tail_recurse;
}
}
/* A comment character always means to drop everything until the
next newline. */
if (c == COMMENT_CHAR)
{
do
{
c = getc (current.file);
}
while (c != '\n');
++current.lineno;
current.state = BEGINNING_OF_LINE;
goto tail_recurse;
}
/* An '@' introduces an include file. */
if (c == '@')
{
do
{
c = getc (current.file);
if (c == '\n')
++current.lineno;
}
while (ISSPACE (c));
BUF_INIT ();
while (! ISSPACE (c) && c != EOF)
{
BUF_ADD (c);
c = getc (current.file);
}
BUF_FINISH ();
ungetc (c, current.file);
nlmlex_file_push (lex_buf);
goto tail_recurse;
}
/* A non-space character at the start of a line must be the start of
a keyword. */
if (current.state == BEGINNING_OF_LINE)
{
BUF_INIT ();
while (ISALNUM (c) || c == '_')
{
BUF_ADD (TOUPPER (c));
c = getc (current.file);
}
BUF_FINISH ();
if (c != EOF && ! ISSPACE (c) && c != ',')
{
nlmheader_identify ();
fprintf (stderr, _("%s:%d: illegal character in keyword: %c\n"),
current.name, current.lineno, c);
}
else
{
unsigned int i;
for (i = 0; i < KEYWORD_COUNT; i++)
{
if (lex_buf[0] == keyword_tokens[i].keyword[0]
&& strcmp (lex_buf, keyword_tokens[i].keyword) == 0)
{
/* Pushing back the final whitespace avoids worrying
about \n here. */
ungetc (c, current.file);
current.state = IN_LINE;
return keyword_tokens[i].token;
}
}
nlmheader_identify ();
fprintf (stderr, _("%s:%d: unrecognized keyword: %s\n"),
current.name, current.lineno, lex_buf);
}
++parse_errors;
/* Treat the rest of this line as a comment. */
ungetc (COMMENT_CHAR, current.file);
goto tail_recurse;
}
/* Parentheses just represent themselves. */
if (c == '(' || c == ')')
return c;
/* Handle quoted strings. */
if (c == '"' || c == '\'')
{
int quote;
int start_lineno;
quote = c;
start_lineno = current.lineno;
c = getc (current.file);
BUF_INIT ();
while (c != quote && c != EOF)
{
BUF_ADD (c);
if (c == '\n')
++current.lineno;
c = getc (current.file);
}
BUF_FINISH ();
if (c == EOF)
{
nlmheader_identify ();
fprintf (stderr, _("%s:%d: end of file in quoted string\n"),
current.name, start_lineno);
++parse_errors;
}
/* FIXME: Possible memory leak. */
yylval.string = xstrdup (lex_buf);
return QUOTED_STRING;
}
/* Gather a generic argument. */
BUF_INIT ();
while (! ISSPACE (c)
&& c != ','
&& c != COMMENT_CHAR
&& c != '('
&& c != ')')
{
BUF_ADD (c);
c = getc (current.file);
}
BUF_FINISH ();
ungetc (c, current.file);
/* FIXME: Possible memory leak. */
yylval.string = xstrdup (lex_buf);
return STRING;
}
/* Get a number from a string. */
static long
nlmlex_get_number (const char *s)
{
long ret;
char *send;
ret = strtol (s, &send, 10);
if (*send != '\0')
nlmheader_warn (_("bad number"), -1);
return ret;
}
/* Prefix the nlmconv warnings with a note as to where they come from.
We don't use program_name on every warning, because then some
versions of the emacs next-error function can't recognize the line
number. */
static void
nlmheader_identify (void)
{
static int done;
if (! done)
{
fprintf (stderr, _("%s: problems in NLM command language input:\n"),
program_name);
done = 1;
}
}
/* Issue a warning. */
static void
nlmheader_warn (const char *s, int imax)
{
nlmheader_identify ();
fprintf (stderr, "%s:%d: %s", current.name, current.lineno, s);
if (imax != -1)
fprintf (stderr, " (max %d)", imax);
fprintf (stderr, "\n");
}
/* Report an error. */
static void
nlmheader_error (const char *s)
{
nlmheader_warn (s, -1);
++parse_errors;
}
/* Add a string to a string list. */
static struct string_list *
string_list_cons (char *s, struct string_list *l)
{
struct string_list *ret;
ret = (struct string_list *) xmalloc (sizeof (struct string_list));
ret->next = l;
ret->string = s;
return ret;
}
/* Append a string list to another string list. */
static struct string_list *
string_list_append (struct string_list *l1, struct string_list *l2)
{
register struct string_list **pp;
for (pp = &l1; *pp != NULL; pp = &(*pp)->next)
;
*pp = l2;
return l1;
}
/* Append a string to a string list. */
static struct string_list *
string_list_append1 (struct string_list *l, char *s)
{
struct string_list *n;
register struct string_list **pp;
n = (struct string_list *) xmalloc (sizeof (struct string_list));
n->next = NULL;
n->string = s;
for (pp = &l; *pp != NULL; pp = &(*pp)->next)
;
*pp = n;
return l;
}
/* Duplicate a string in memory. */
static char *
xstrdup (const char *s)
{
unsigned long len;
char *ret;
len = strlen (s);
ret = xmalloc (len + 1);
strcpy (ret, s);
return ret;
}

View File

@ -33,8 +33,6 @@ is-strip.c
maybe-ranlib.c
maybe-strip.c
mclex.c
nlmconv.c
nlmconv.h
nm.c
not-ranlib.c
not-strip.c

View File

@ -44,7 +44,7 @@ if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
# This test does not work correctly on ECOFF targets, because ECOFF
# stores most symbols twice, which messes up the nm output.
setup_xfail "alpha*-*-osf*" "alpha*-*-netware*"
setup_xfail "alpha*-*-osf*"
setup_xfail "mips*-*-ultrix*" "mips*-*-ecoff*" "mips*-*-irix4*"
setup_xfail "mips*-*-riscos*" "mips*-*-sysv3*" "mips*-sony-bsd*"
@ -102,7 +102,7 @@ if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
# This test does not work correctly on ECOFF targets, because ECOFF
# stores most symbols twice, which messes up the nm output.
setup_xfail "alpha*-*-osf*" "alpha*-*-netware*"
setup_xfail "alpha*-*-osf*"
setup_xfail "mips*-*-ultrix*" "mips*-*-ecoff*" "mips*-*-irix4*"
setup_xfail "mips*-*-riscos*" "mips*-*-sysv3*" "mips*-sony-bsd*"
@ -135,7 +135,6 @@ if { [is_elf_format]
|| [istarget *-*-freebsd*]
|| [istarget *-*-lynxos*]
|| [istarget "mmix-knuth-mmixware"]
|| [istarget *-*-netware*]
|| [istarget *-*-nto*]
|| [istarget *-*-rdos*]
|| [istarget *-*-tpf*]
@ -160,7 +159,7 @@ if {![binutils_assemble $srcdir/$subdir/$nm_1_src tmpdir/nm-1.o]} then {
# This test does not work correctly on ECOFF targets, because ECOFF
# stores most symbols twice, which messes up the nm output.
setup_xfail "alpha*-*-osf*" "alpha*-*-netware*"
setup_xfail "alpha*-*-osf*"
setup_xfail "mips*-*-ultrix*" "mips*-*-ecoff*" "mips*-*-irix4*"
setup_xfail "mips*-*-riscos*" "mips*-*-sysv3*" "mips*-sony-bsd*"

View File

@ -1,3 +1,12 @@
2018-04-16 Alan Modra <amodra@gmail.com>
* Makefile.am: Remove netware support.
* config/tc-i386.c: Likewise.
* configure.tgt: Likewise.
* config/te-netware.h: Delete.
* Makefile.in: Regenerate.
* po/POTFILES.in: Regenerate.
2018-04-15 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/gas/i386/x86-64-waitpkg.s: Add 32-bit registers

View File

@ -327,7 +327,6 @@ TARG_ENV_HFILES = \
config/te-macos.h \
config/te-nbsd.h \
config/te-nbsd532.h \
config/te-netware.h \
config/te-pc532mach.h \
config/te-pe.h \
config/te-psos.h \

View File

@ -623,7 +623,6 @@ TARG_ENV_HFILES = \
config/te-macos.h \
config/te-nbsd.h \
config/te-nbsd532.h \
config/te-netware.h \
config/te-pc532mach.h \
config/te-pe.h \
config/te-psos.h \

View File

@ -432,7 +432,6 @@ const char extra_symbol_chars[] = "*%-([{}"
&& !defined (TE_GNU) \
&& !defined (TE_LINUX) \
&& !defined (TE_NACL) \
&& !defined (TE_NETWARE) \
&& !defined (TE_FreeBSD) \
&& !defined (TE_DragonFly) \
&& !defined (TE_NetBSD)))

View File

@ -1,28 +0,0 @@
/* te-netware.h -- NetWare target environment declarations.
Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
GAS 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 3, or (at your option)
any later version.
GAS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GAS; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
#define TE_NETWARE
#define LOCAL_LABELS_FB 1
#define LEX_AT (LEX_NAME | LEX_BEGIN_NAME) /* Can have @'s inside labels. */
#define LEX_PCT (LEX_NAME | LEX_BEGIN_NAME) /* Can have %'s inside labels. */
#define LEX_QM (LEX_NAME | LEX_BEGIN_NAME) /* Can have ?'s inside labels. */
#include "obj-format.h"

View File

@ -490,7 +490,6 @@ case ${generic_target} in
*-*-solaris*) fmt=elf em=solaris ;;
*-*-aros*) fmt=elf em=linux ;;
*-*-vxworks* | *-*-windiss) fmt=elf em=vxworks ;;
*-*-netware) fmt=elf em=netware ;;
esac
case ${cpu_type} in

View File

@ -202,7 +202,6 @@ config/te-mach.h
config/te-macos.h
config/te-nbsd.h
config/te-nbsd532.h
config/te-netware.h
config/te-pc532mach.h
config/te-pe.h
config/te-psos.h

View File

@ -1,3 +1,7 @@
2018-04-16 Alan Modra <amodra@gmail.com>
* corefile.c: Remove netware support.
2018-04-16 Alan Modra <amodra@gmail.com>
* Makefile.am: Remove tahoe support.

View File

@ -603,7 +603,6 @@ core_create_function_syms (void)
case bfd_target_ecoff_flavour:
case bfd_target_xcoff_flavour:
case bfd_target_elf_flavour:
case bfd_target_nlm_flavour:
case bfd_target_som_flavour:
core_has_func_syms = 1;
}

View File

@ -1,3 +1,14 @@
2018-04-16 Alan Modra <amodra@gmail.com>
* nlm/ChangeLog-9315: Delete.
* nlm/alpha-ext.h: Delete.
* nlm/common.h: Delete.
* nlm/external.h: Delete.
* nlm/i386-ext.h: Delete.
* nlm/internal.h: Delete.
* nlm/ppc-ext.h: Delete.
* nlm/sparc32-ext.h: Delete.
2018-04-16 Alan Modra <amodra@gmail.com>
* opcode/tahoe.h: Delete.

View File

@ -1,127 +0,0 @@
2015-01-01 Alan Modra <amodra@gmail.com>
Update year range in copyright notice of all files.
2014-03-05 Alan Modra <amodra@gmail.com>
Update copyright years.
2010-04-15 Nick Clifton <nickc@redhat.com>
* alpha-ext.h: Update copyright notice to use GPLv3.
* common.h: Likewise.
* external.h: Likewise.
* i386-ext.h: Likewise.
* internal.h: Likewise.
* ppc-ext.h: Likewise.
* sparc32-ext.h: Likewise.
2005-05-10 Nick Clifton <nickc@redhat.com>
* Update the address and phone number of the FSF organization in
the GPL notices in the following files:
alpha-ext.h, common.h, external.h, i386-ext.h, internal.h,
ppc-ext.h, sparc32-ext.h
2003-08-07 Alan Modra <amodra@bigpond.net.au>
* internal.h (Nlm_Internal_Custom_Header): Replace PTR with void *.
2001-10-02 Alan Modra <amodra@bigpond.net.au>
* common.h (NLM_CAT, NLM_CAT3): Don't define.
(NLM_CAT4): Update conditions under which this is defined. Document
why CONCAT4 can't be used.
1994-05-06 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* external.h (nlmNAME(External_Custom_Header)): Add length,
dataOffset, and dataStamp field.
(nlmNAME(External_Cygnus_Ext_Header)): Remove.
* internal.h (Nlm_Internal_Custom_Header): Add hdrLength,
dataOffset, dataStamp and hdr fields.
1994-04-22 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* external.h (struct nlmNAME(external_cygnus_ext_header)): Rename
from nlmNAME(external_cygnus_section_header). Change stamp field
to 8 bytes. Add bytes field.
* internal.h (nlm_internal_cygnus_ext_header): Rename from
nlm_internal_cygnus_section_header. Change stamp field to 8
bytes.
1994-04-21 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* internal.h (struct nlm_internal_cygnus_section_header): Define.
* external.h (struct nlmNAME(external_cygnus_section_header):
Define.
1994-04-20 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* internal.h (struct nlm_internal_custom_header): Remove
debugRecOffset and debugRecLength fields. Add data field.
* external.h (struct nlmNAME(external_custom_header)): Remove
debugRecOffset and debugRecLength fields.
1994-02-07 Jim Kingdon (kingdon@lioth.cygnus.com)
* internal.h: Change HOST_64_BIT to BFD_HOST_64_BIT.
1993-12-02 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* alpha-ext.h: New file describing formats of information in Alpha
NetWare files.
* common.h: Define some non-external Alpha information.
1993-11-17 Sean Eric Fagan (sef@cygnus.com)
* external.h: Don't define external_fixed_header here.
* i386-ext.h, sparc32-ext.h: New header files to define
external_fixed_header for particular CPU's.
1993-10-27 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* internal.h (Nlm_Internal_Extended_Header): Added fields
sharedDebugRecordOffset and sharedDebugRecordCount.
* external.h (NlmNAME(External_Extended_Header)): Likewise.
* common.h (NLM_SIGNATURE): Do not define (it's different for each
backend).
1993-08-31 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* internal.h: Change length fields of type char to type unsigned
char.
1993-07-31 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* common.h (NLM_HIBIT, NLM_HEADER_VERSION): Define.
1993-07-22 Fred Fish (fnf@deneb.cygnus.com)
* common.h (NLM_CAT*, NLM_ARCH_SIZE, NLM_TARGET_LONG_SIZE,
NLM_TARGET_ADDRESS_SIZE, NLM_NAME, NlmNAME, nlmNAME): New
macros.
* external.h (TARGET_LONG_SIZE, TARGET_ADDRESS_SIZE): Remove
macros, convert usages to NLM_ equivalents.
* external.h: Use nlmNAME and NlmNAME macros to derive both
32 and 64 bit versions.
1993-07-20 Fred Fish (fnf@deneb.cygnus.com)
* (common.h, external.h, internal.h): New files for NLM/NetWare
support.
Copyright (C) 1993-2015 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
Local Variables:
mode: change-log
left-margin: 8
fill-column: 74
version-control: never
End:

View File

@ -1,167 +0,0 @@
/* Alpha NLM (NetWare Loadable Module) support for BFD.
Copyright (C) 1993-2018 Free Software Foundation, Inc.
By Ian Lance Taylor, Cygnus Support
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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
/* An Alpha NLM starts with an instance of this structure. */
struct nlm32_alpha_external_prefix_header
{
/* Magic number. Must be NLM32_ALPHA_MAGIC. */
unsigned char magic[4];
/* Format descriptor. Current value is 2. */
unsigned char format[4];
/* Size of prefix header. */
unsigned char size[4];
/* Padding. */
unsigned char pad1[4];
/* More fields may be added later, supposedly. */
};
/* The external format of an Alpha NLM reloc. This is the same as an
Alpha ECOFF reloc. */
struct nlm32_alpha_external_reloc
{
unsigned char r_vaddr[8];
unsigned char r_symndx[4];
unsigned char r_bits[4];
};
/* Constants to unpack the r_bits field of a reloc. */
#define RELOC_BITS0_TYPE_LITTLE 0xff
#define RELOC_BITS0_TYPE_SH_LITTLE 0
#define RELOC_BITS1_EXTERN_LITTLE 0x01
#define RELOC_BITS1_OFFSET_LITTLE 0x7e
#define RELOC_BITS1_OFFSET_SH_LITTLE 1
#define RELOC_BITS1_RESERVED_LITTLE 0x80
#define RELOC_BITS1_RESERVED_SH_LITTLE 7
#define RELOC_BITS2_RESERVED_LITTLE 0xff
#define RELOC_BITS2_RESERVED_SH_LEFT_LITTLE 1
#define RELOC_BITS3_RESERVED_LITTLE 0x03
#define RELOC_BITS3_RESERVED_SH_LEFT_LITTLE 9
#define RELOC_BITS3_SIZE_LITTLE 0xfc
#define RELOC_BITS3_SIZE_SH_LITTLE 2
/* The external format of the fixed header. */
typedef struct nlm32_alpha_external_fixed_header
{
/* The signature field identifies the file as an NLM. It must contain
the signature string, which depends upon the NLM target. */
unsigned char signature[24];
/* The version of the header. At this time, the highest version number
is 4. */
unsigned char version[4];
/* The name of the module, which must be a DOS name (1-8 characters followed
by a period and a 1-3 character extension). The first byte is the byte
length of the name and the last byte is a null terminator byte. This
field is fixed length, and any unused bytes should be null bytes. The
value is set by the OUTPUT keyword to NLMLINK. */
unsigned char moduleName[14];
/* Padding to make it come out correct. */
unsigned char pad1[2];
/* The byte offset of the code image from the start of the file. */
unsigned char codeImageOffset[4];
/* The size of the code image, in bytes. */
unsigned char codeImageSize[4];
/* The byte offset of the data image from the start of the file. */
unsigned char dataImageOffset[4];
/* The size of the data image, in bytes. */
unsigned char dataImageSize[4];
/* The size of the uninitialized data region that the loader is to be
allocated at load time. Uninitialized data follows the initialized
data in the NLM address space. */
unsigned char uninitializedDataSize[4];
/* The byte offset of the custom data from the start of the file. The
custom data is set by the CUSTOM keyword to NLMLINK. It is possible
for this to be EOF if there is no custom data. */
unsigned char customDataOffset[4];
/* The size of the custom data, in bytes. */
unsigned char customDataSize[4];
/* The byte offset of the module dependencies from the start of the file.
The module dependencies are determined by the MODULE keyword in
NLMLINK. */
unsigned char moduleDependencyOffset[4];
/* The number of module dependencies at the moduleDependencyOffset. */
unsigned char numberOfModuleDependencies[4];
/* The byte offset of the relocation fixup data from the start of the file */
unsigned char relocationFixupOffset[4];
unsigned char numberOfRelocationFixups[4];
unsigned char externalReferencesOffset[4];
unsigned char numberOfExternalReferences[4];
unsigned char publicsOffset[4];
unsigned char numberOfPublics[4];
/* The byte offset of the internal debug info from the start of the file.
It is possible for this to be EOF if there is no debug info. */
unsigned char debugInfoOffset[4];
unsigned char numberOfDebugRecords[4];
unsigned char codeStartOffset[4];
unsigned char exitProcedureOffset[4];
unsigned char checkUnloadProcedureOffset[4];
unsigned char moduleType[4];
unsigned char flags[4];
} Nlm32_alpha_External_Fixed_Header;

View File

@ -1,123 +0,0 @@
/* NLM (NetWare Loadable Module) support for BFD.
Copyright (C) 1993-2018 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support
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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
/* This file is part of NLM support for BFD, and contains the portions
that are common to both the internal and external representations. */
/* If NLM_ARCH_SIZE is not defined, default to 32. NLM_ARCH_SIZE is
optionally defined by the application. */
#ifndef NLM_ARCH_SIZE
# define NLM_ARCH_SIZE 32
#endif
/* Due to horrible details of ANSI macro expansion, we can't use CONCAT4
for NLM_NAME. CONCAT2 is used in BFD_JUMP_TABLE macros, and some of
them will expand to tokens that themselves are macros defined in terms
of NLM_NAME. If NLM_NAME were defined using CONCAT4 (which is itself
defined in bfd-in.h using CONCAT2), ANSI preprocessor rules say that
the CONCAT2 within NLM_NAME should not be expanded.
So use another name. */
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
#ifdef SABER
#define NLM_CAT4(a,b,c,d) a##b##c##d
#else
/* This hack is to avoid a problem with some strict ANSI C preprocessors.
The problem is, "32_" is not a valid preprocessing token, and we don't
want extra underscores (e.g., "nlm_32_"). The NLM_XCAT2 macro will
cause the inner CAT2 macros to be evaluated first, producing
still-valid pp-tokens. Then the final concatenation can be done. */
#define NLM_CAT2(a,b) a##b
#define NLM_XCAT2(a,b) NLM_CAT2(a,b)
#define NLM_CAT4(a,b,c,d) NLM_XCAT2(NLM_CAT2(a,b),NLM_CAT2(c,d))
#endif
#else
#define NLM_CAT4(a,b,c,d) a/**/b/**/c/**/d
#endif
#if NLM_ARCH_SIZE == 32
# define NLM_TARGET_LONG_SIZE 4
# define NLM_TARGET_ADDRESS_SIZE 4
# define NLM_NAME(x,y) NLM_CAT4(x,32,_,y)
# define NLM_HIBIT (((bfd_vma) 1) << 31)
#endif
#if NLM_ARCH_SIZE == 64
# define NLM_TARGET_LONG_SIZE 8
# define NLM_TARGET_ADDRESS_SIZE 8
# define NLM_NAME(x,y) NLM_CAT4(x,64,_,y)
# define NLM_HIBIT (((bfd_vma) 1) << 63)
#endif
#define NlmNAME(X) NLM_NAME(Nlm,X)
#define nlmNAME(X) NLM_NAME(nlm,X)
/* Give names to things that should not change. */
#define NLM_MAX_DESCRIPTION_LENGTH 127
#define NLM_MAX_SCREEN_NAME_LENGTH 71
#define NLM_MAX_THREAD_NAME_LENGTH 71
#define NLM_MAX_COPYRIGHT_MESSAGE_LENGTH 255
#define NLM_OTHER_DATA_LENGTH 400 /* FIXME */
#define NLM_OLD_THREAD_NAME_LENGTH 5
#define NLM_SIGNATURE_SIZE 24
#define NLM_HEADER_VERSION 4
#define NLM_MODULE_NAME_SIZE 14
#define NLM_DEFAULT_STACKSIZE (8 * 1024)
/* Alpha information. This should probably be in a separate Alpha
header file, but it can't go in alpha-ext.h because some of it is
needed by nlmconv.c. */
/* Magic number in Alpha prefix header. */
#define NLM32_ALPHA_MAGIC (0x83561840)
/* The r_type field in an Alpha reloc is one of the following values. */
#define ALPHA_R_IGNORE 0
#define ALPHA_R_REFLONG 1
#define ALPHA_R_REFQUAD 2
#define ALPHA_R_GPREL32 3
#define ALPHA_R_LITERAL 4
#define ALPHA_R_LITUSE 5
#define ALPHA_R_GPDISP 6
#define ALPHA_R_BRADDR 7
#define ALPHA_R_HINT 8
#define ALPHA_R_SREL16 9
#define ALPHA_R_SREL32 10
#define ALPHA_R_SREL64 11
#define ALPHA_R_OP_PUSH 12
#define ALPHA_R_OP_STORE 13
#define ALPHA_R_OP_PSUB 14
#define ALPHA_R_OP_PRSHIFT 15
#define ALPHA_R_GPVALUE 16
#define ALPHA_R_NW_RELOC 250
/* A local reloc, other than ALPHA_R_GPDISP or ALPHA_R_IGNORE, must be
against one of these symbol indices. */
#define ALPHA_RELOC_SECTION_TEXT 1
#define ALPHA_RELOC_SECTION_DATA 3
/* An ALPHA_R_NW_RELOC has one of these values in the size field. If
it is SETGP, the r_vaddr field holds the GP value to use. If it is
LITA, the r_vaddr field holds the address of the .lita section and
the r_symndx field holds the size of the .lita section. */
#define ALPHA_R_NW_RELOC_SETGP 1
#define ALPHA_R_NW_RELOC_LITA 2

View File

@ -1,172 +0,0 @@
/* NLM (NetWare Loadable Module) support for BFD.
Copyright (C) 1993-2018 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support
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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
/* This file is part of NLM support for BFD, and contains the portions
that describe how NLM is represented externally by the BFD library.
I.E. it describes the in-file representation of NLM. It requires
the nlm/common.h file which contains the portions that are common to
both the internal and external representations.
Note that an NLM header consists of three parts:
(1) A fixed length header that has specific fields of known length,
at specific offsets in the file.
(2) A variable length header that has specific fields in a specific
order, but some fields may be variable length.
(3) A auxiliary header that has various optional fields in no specific
order. There is no way to identify the end of the auxiliary headers
except by finding a header without a recognized 'stamp'.
The exact format of the fixed length header unfortunately varies
from one NLM target to another, due to padding. Each target
defines the correct external format in a separate header file. */
/* NLM Header. */
/* The version header is one of the optional auxiliary headers and
follows the fixed length and variable length NLM headers. */
typedef struct nlmNAME(external_version_header)
{
/* The header is recognized by "VeRsIoN#" in the stamp field. */
char stamp[8];
unsigned char majorVersion[NLM_TARGET_LONG_SIZE];
unsigned char minorVersion[NLM_TARGET_LONG_SIZE];
unsigned char revision[NLM_TARGET_LONG_SIZE];
unsigned char year[NLM_TARGET_LONG_SIZE];
unsigned char month[NLM_TARGET_LONG_SIZE];
unsigned char day[NLM_TARGET_LONG_SIZE];
} NlmNAME(External_Version_Header);
typedef struct nlmNAME(external_copyright_header)
{
/* The header is recognized by "CoPyRiGhT=" in the stamp field. */
char stamp[10];
unsigned char copyrightMessageLength[1];
/* There is a variable length field here called 'copyrightMessage'
that is the length specified by copyrightMessageLength. */
} NlmNAME(External_Copyright_Header);
typedef struct nlmNAME(external_extended_header)
{
/* The header is recognized by "MeSsAgEs" in the stamp field. */
char stamp[8];
unsigned char languageID[NLM_TARGET_LONG_SIZE];
unsigned char messageFileOffset[NLM_TARGET_LONG_SIZE];
unsigned char messageFileLength[NLM_TARGET_LONG_SIZE];
unsigned char messageCount[NLM_TARGET_LONG_SIZE];
unsigned char helpFileOffset[NLM_TARGET_LONG_SIZE];
unsigned char helpFileLength[NLM_TARGET_LONG_SIZE];
unsigned char RPCDataOffset[NLM_TARGET_LONG_SIZE];
unsigned char RPCDataLength[NLM_TARGET_LONG_SIZE];
unsigned char sharedCodeOffset[NLM_TARGET_LONG_SIZE];
unsigned char sharedCodeLength[NLM_TARGET_LONG_SIZE];
unsigned char sharedDataOffset[NLM_TARGET_LONG_SIZE];
unsigned char sharedDataLength[NLM_TARGET_LONG_SIZE];
unsigned char sharedRelocationFixupOffset[NLM_TARGET_LONG_SIZE];
unsigned char sharedRelocationFixupCount[NLM_TARGET_LONG_SIZE];
unsigned char sharedExternalReferenceOffset[NLM_TARGET_LONG_SIZE];
unsigned char sharedExternalReferenceCount[NLM_TARGET_LONG_SIZE];
unsigned char sharedPublicsOffset[NLM_TARGET_LONG_SIZE];
unsigned char sharedPublicsCount[NLM_TARGET_LONG_SIZE];
unsigned char sharedDebugRecordOffset[NLM_TARGET_LONG_SIZE];
unsigned char sharedDebugRecordCount[NLM_TARGET_LONG_SIZE];
unsigned char sharedInitializationOffset[NLM_TARGET_ADDRESS_SIZE];
unsigned char SharedExitProcedureOffset[NLM_TARGET_ADDRESS_SIZE];
unsigned char productID[NLM_TARGET_LONG_SIZE];
unsigned char reserved0[NLM_TARGET_LONG_SIZE];
unsigned char reserved1[NLM_TARGET_LONG_SIZE];
unsigned char reserved2[NLM_TARGET_LONG_SIZE];
unsigned char reserved3[NLM_TARGET_LONG_SIZE];
unsigned char reserved4[NLM_TARGET_LONG_SIZE];
unsigned char reserved5[NLM_TARGET_LONG_SIZE];
} NlmNAME(External_Extended_Header);
typedef struct nlmNAME(external_custom_header)
{
/* The header is recognized by "CuStHeAd" in the stamp field. */
char stamp[8];
/* Length of this header. */
unsigned char length[NLM_TARGET_LONG_SIZE];
/* Offset to data. */
unsigned char dataOffset[NLM_TARGET_LONG_SIZE];
/* Length of data. */
unsigned char dataLength[NLM_TARGET_LONG_SIZE];
/* Stamp for this customer header--we recognize "CyGnUsEx". */
char dataStamp[8];
} NlmNAME(External_Custom_Header);

View File

@ -1,117 +0,0 @@
/* i386 NLM (NetWare Loadable Module) support for BFD.
Copyright (C) 1993-2018 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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
/* The external format of the fixed header. */
typedef struct nlm32_i386_external_fixed_header
{
/* The signature field identifies the file as an NLM. It must contain
the signature string, which depends upon the NLM target. */
unsigned char signature[24];
/* The version of the header. At this time, the highest version number
is 4. */
unsigned char version[4];
/* The name of the module, which must be a DOS name (1-8 characters followed
by a period and a 1-3 character extension). The first byte is the byte
length of the name and the last byte is a null terminator byte. This
field is fixed length, and any unused bytes should be null bytes. The
value is set by the OUTPUT keyword to NLMLINK. */
unsigned char moduleName[14];
/* The byte offset of the code image from the start of the file. */
unsigned char codeImageOffset[4];
/* The size of the code image, in bytes. */
unsigned char codeImageSize[4];
/* The byte offset of the data image from the start of the file. */
unsigned char dataImageOffset[4];
/* The size of the data image, in bytes. */
unsigned char dataImageSize[4];
/* The size of the uninitialized data region that the loader is to be
allocated at load time. Uninitialized data follows the initialized
data in the NLM address space. */
unsigned char uninitializedDataSize[4];
/* The byte offset of the custom data from the start of the file. The
custom data is set by the CUSTOM keyword to NLMLINK. It is possible
for this to be EOF if there is no custom data. */
unsigned char customDataOffset[4];
/* The size of the custom data, in bytes. */
unsigned char customDataSize[4];
/* The byte offset of the module dependencies from the start of the file.
The module dependencies are determined by the MODULE keyword in
NLMLINK. */
unsigned char moduleDependencyOffset[4];
/* The number of module dependencies at the moduleDependencyOffset. */
unsigned char numberOfModuleDependencies[4];
/* The byte offset of the relocation fixup data from the start of the file */
unsigned char relocationFixupOffset[4];
unsigned char numberOfRelocationFixups[4];
unsigned char externalReferencesOffset[4];
unsigned char numberOfExternalReferences[4];
unsigned char publicsOffset[4];
unsigned char numberOfPublics[4];
/* The byte offset of the internal debug info from the start of the file.
It is possible for this to be EOF if there is no debug info. */
unsigned char debugInfoOffset[4];
unsigned char numberOfDebugRecords[4];
unsigned char codeStartOffset[4];
unsigned char exitProcedureOffset[4];
unsigned char checkUnloadProcedureOffset[4];
unsigned char moduleType[4];
unsigned char flags[4];
} Nlm32_i386_External_Fixed_Header;

View File

@ -1,309 +0,0 @@
/* NLM (NetWare Loadable Module) support for BFD.
Copyright (C) 1993-2018 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support.
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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
/* This file is part of NLM support for BFD, and contains the portions
that describe how NLM is represented internally in the BFD library.
I.E. it describes the in-memory representation of NLM. It requires
the nlm/common.h file which contains the portions that are common to
both the internal and external representations. */
#if 0
/* Types used by various structures, functions, etc. */
typedef unsigned long Nlm32_Addr; /* Unsigned program address */
typedef unsigned long Nlm32_Off; /* Unsigned file offset */
typedef long Nlm32_Sword; /* Signed large integer */
typedef unsigned long Nlm32_Word; /* Unsigned large integer */
typedef unsigned short Nlm32_Half; /* Unsigned medium integer */
typedef unsigned char Nlm32_Char; /* Unsigned tiny integer */
#ifdef BFD_HOST_64_BIT
typedef unsigned BFD_HOST_64_BIT Nlm64_Addr;
typedef unsigned BFD_HOST_64_BIT Nlm64_Off;
typedef BFD_HOST_64_BIT Nlm64_Sxword;
typedef unsigned BFD_HOST_64_BIT Nlm64_Xword;
#endif
typedef long Nlm64_Sword;
typedef unsigned long Nlm64_Word;
typedef unsigned short Nlm64_Half;
#endif /* 0 */
/* This structure contains the internal form of the portion of the NLM
header that is fixed length. */
typedef struct nlm_internal_fixed_header
{
/* The signature field identifies the file as an NLM. It must contain
the signature string, which depends upon the NLM target. */
char signature[NLM_SIGNATURE_SIZE];
/* The version of the header. At this time, the highest version number
is 4. */
long version;
/* The name of the module, which must be a DOS name (1-8 characters followed
by a period and a 1-3 character extension. The first byte is the byte
length of the name and the last byte is a null terminator byte. This
field is fixed length, and any unused bytes should be null bytes. The
value is set by the OUTPUT keyword to NLMLINK. */
char moduleName[NLM_MODULE_NAME_SIZE];
/* The byte offset of the code image from the start of the file. */
file_ptr codeImageOffset;
/* The size of the code image, in bytes. */
bfd_size_type codeImageSize;
/* The byte offset of the data image from the start of the file. */
file_ptr dataImageOffset;
/* The size of the data image, in bytes. */
bfd_size_type dataImageSize;
/* The size of the uninitialized data region that the loader is to be
allocated at load time. Uninitialized data follows the initialized
data in the NLM address space. */
bfd_size_type uninitializedDataSize;
/* The byte offset of the custom data from the start of the file. The
custom data is set by the CUSTOM keyword to NLMLINK. */
file_ptr customDataOffset;
/* The size of the custom data, in bytes. */
bfd_size_type customDataSize;
/* The byte offset of the module dependencies from the start of the file.
The module dependencies are determined by the MODULE keyword in
NLMLINK. */
file_ptr moduleDependencyOffset;
/* The number of module dependencies at the moduleDependencyOffset. */
long numberOfModuleDependencies;
/* The byte offset of the relocation fixup data from the start of the file */
file_ptr relocationFixupOffset;
long numberOfRelocationFixups;
file_ptr externalReferencesOffset;
long numberOfExternalReferences;
file_ptr publicsOffset;
long numberOfPublics;
file_ptr debugInfoOffset;
long numberOfDebugRecords;
file_ptr codeStartOffset;
file_ptr exitProcedureOffset;
file_ptr checkUnloadProcedureOffset;
long moduleType;
long flags;
} Nlm_Internal_Fixed_Header;
#define nlm32_internal_fixed_header nlm_internal_fixed_header
#define Nlm32_Internal_Fixed_Header Nlm_Internal_Fixed_Header
#define nlm64_internal_fixed_header nlm_internal_fixed_header
#define Nlm64_Internal_Fixed_Header Nlm_Internal_Fixed_Header
/* This structure contains the portions of the NLM header that are either
variable in size in the external representation, or else are not at a
fixed offset relative to the start of the NLM header due to preceding
variable sized fields.
Note that all the fields must exist in the external header, and in
the order used here (the same order is used in the internal form
for consistency, not out of necessity). */
typedef struct nlm_internal_variable_header
{
/* The descriptionLength field contains the length of the text in
descriptionText, excluding the null terminator. The descriptionText
field contains the NLM description obtained from the DESCRIPTION
keyword in NLMLINK plus the null byte terminator. The descriptionText
can be up to NLM_MAX_DESCRIPTION_LENGTH characters. */
unsigned char descriptionLength;
char descriptionText[NLM_MAX_DESCRIPTION_LENGTH + 1];
/* The stackSize field contains the size of the stack in bytes, as
specified by the STACK or STACKSIZE keyword in NLMLINK. If no size
is specified, the default is NLM_DEFAULT_STACKSIZE. */
long stackSize;
/* The reserved field is included only for completeness. It should contain
zero. */
long reserved;
/* This field is fixed length, should contain " LONG" (note leading
space), and is unused. */
char oldThreadName[NLM_OLD_THREAD_NAME_LENGTH];
/* The screenNameLength field contains the length of the actual text stored
in the screenName field, excluding the null byte terminator. The
screenName field contains the screen name as specified by the SCREENNAME
keyword in NLMLINK, and can be up to NLM_MAX_SCREEN_NAME_LENGTH
characters. */
unsigned char screenNameLength;
char screenName[NLM_MAX_SCREEN_NAME_LENGTH + 1];
/* The threadNameLength field contains the length of the actual text stored
in the threadName field, excluding the null byte terminator. The
threadName field contains the thread name as specified by the THREADNAME
keyword in NLMLINK, and can be up to NLM_MAX_THREAD_NAME_LENGTH
characters. */
unsigned char threadNameLength;
char threadName[NLM_MAX_THREAD_NAME_LENGTH + 1];
} Nlm_Internal_Variable_Header;
#define nlm32_internal_variable_header nlm_internal_variable_header
#define Nlm32_Internal_Variable_Header Nlm_Internal_Variable_Header
#define nlm64_internal_variable_header nlm_internal_variable_header
#define Nlm64_Internal_Variable_Header Nlm_Internal_Variable_Header
/* The version header is one of the optional auxiliary headers and
follows the fixed length and variable length NLM headers. */
typedef struct nlm_internal_version_header
{
/* The header is recognized by "VeRsIoN#" in the stamp field. */
char stamp[8];
long majorVersion;
long minorVersion;
long revision;
long year;
long month;
long day;
} Nlm_Internal_Version_Header;
#define nlm32_internal_version_header nlm_internal_version_header
#define Nlm32_Internal_Version_Header Nlm_Internal_Version_Header
#define nlm64_internal_version_header nlm_internal_version_header
#define Nlm64_Internal_Version_Header Nlm_Internal_Version_Header
typedef struct nlm_internal_copyright_header
{
/* The header is recognized by "CoPyRiGhT=" in the stamp field. */
char stamp[10];
unsigned char copyrightMessageLength;
char copyrightMessage[NLM_MAX_COPYRIGHT_MESSAGE_LENGTH];
} Nlm_Internal_Copyright_Header;
#define nlm32_internal_copyright_header nlm_internal_copyright_header
#define Nlm32_Internal_Copyright_Header Nlm_Internal_Copyright_Header
#define nlm64_internal_copyright_header nlm_internal_copyright_header
#define Nlm64_Internal_Copyright_Header Nlm_Internal_Copyright_Header
typedef struct nlm_internal_extended_header
{
/* The header is recognized by "MeSsAgEs" in the stamp field. */
char stamp[8];
long languageID;
file_ptr messageFileOffset;
bfd_size_type messageFileLength;
long messageCount;
file_ptr helpFileOffset;
bfd_size_type helpFileLength;
file_ptr RPCDataOffset;
bfd_size_type RPCDataLength;
file_ptr sharedCodeOffset;
bfd_size_type sharedCodeLength;
file_ptr sharedDataOffset;
bfd_size_type sharedDataLength;
file_ptr sharedRelocationFixupOffset;
long sharedRelocationFixupCount;
file_ptr sharedExternalReferenceOffset;
long sharedExternalReferenceCount;
file_ptr sharedPublicsOffset;
long sharedPublicsCount;
file_ptr sharedDebugRecordOffset;
long sharedDebugRecordCount;
bfd_vma SharedInitializationOffset;
bfd_vma SharedExitProcedureOffset;
long productID;
long reserved0;
long reserved1;
long reserved2;
long reserved3;
long reserved4;
long reserved5;
} Nlm_Internal_Extended_Header;
#define nlm32_internal_extended_header nlm_internal_extended_header
#define Nlm32_Internal_Extended_Header Nlm_Internal_Extended_Header
#define nlm64_internal_extended_header nlm_internal_extended_header
#define Nlm64_Internal_Extended_Header Nlm_Internal_Extended_Header
/* The format of a custom header as stored internally is different
from the external format. This is how we store a custom header
which we do not recognize. */
typedef struct nlm_internal_custom_header
{
/* The header is recognized by "CuStHeAd" in the stamp field. */
char stamp[8];
bfd_size_type hdrLength;
file_ptr dataOffset;
bfd_size_type dataLength;
char dataStamp[8];
void *hdr;
} Nlm_Internal_Custom_Header;
#define nlm32_internal_custom_header nlm_internal_custom_header
#define Nlm32_Internal_Custom_Header Nlm_Internal_Custom_Header
#define nlm64_internal_custom_header nlm_internal_custom_header
#define Nlm64_Internal_Custom_Header Nlm_Internal_Custom_Header
/* The internal Cygnus header is written out externally as a custom
header. We don't try to replicate that structure here. */
typedef struct nlm_internal_cygnus_ext_header
{
/* The header is recognized by "CyGnUsEx" in the stamp field. */
char stamp[8];
/* File location of debugging information. */
file_ptr offset;
/* Length of debugging information. */
bfd_size_type length;
} Nlm_Internal_Cygnus_Ext_Header;
#define nlm32_internal_cygnus_ext_header nlm_internal_cygnus_ext_header
#define Nlm32_Internal_Cygnus_Ext_Header Nlm_Internal_Cygnus_Ext_Header
#define nlm64_internal_cygnus_ext_header nlm_internal_cygnus_ext_header
#define Nlm64_Internal_Cygnus_Ext_Header Nlm_Internal_Cygnus_Ext_Header

View File

@ -1,164 +0,0 @@
/* PowerPC NLM (NetWare Loadable Module) support for BFD.
Copyright (C) 1994-2018 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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
#ifdef OLDFORMAT
/* The format of a PowerPC NLM changed. These structures are only
used in the old format. */
/* A PowerPC NLM starts with an instance of this structure. */
struct nlm32_powerpc_external_prefix_header
{
/* Signature. Must be "AppleNLM". */
char signature[8];
/* Version number. Current value is 1. */
unsigned char headerVersion[4];
/* ??. Should be set to 0. */
unsigned char origins[4];
/* File creation date in standard Unix time format (seconds since
1/1/70). */
unsigned char date[4];
};
#define NLM32_POWERPC_SIGNATURE "AppleNLM"
#define NLM32_POWERPC_HEADER_VERSION 1
/* The external format of a PowerPC NLM reloc. This is the same as an
XCOFF dynamic reloc. */
struct nlm32_powerpc_external_reloc
{
/* Address. */
unsigned char l_vaddr[4];
/* Symbol table index. This is 0 for .text and 1 for .data. 2
means .bss, but I don't know if it is used. In XCOFF, larger
numbers are indices into the dynamic symbol table, but they are
presumably not used in an NLM. */
unsigned char l_symndx[4];
/* Relocation type. */
unsigned char l_rtype[2];
/* Section number being relocated. */
unsigned char l_rsecnm[2];
};
#endif /* OLDFORMAT */
/* The external format of the fixed header. */
typedef struct nlm32_powerpc_external_fixed_header
{
/* The signature field identifies the file as an NLM. It must contain
the signature string, which depends upon the NLM target. */
unsigned char signature[24];
/* The version of the header. At this time, the highest version number
is 4. */
unsigned char version[4];
/* The name of the module, which must be a DOS name (1-8 characters followed
by a period and a 1-3 character extension). The first byte is the byte
length of the name and the last byte is a null terminator byte. This
field is fixed length, and any unused bytes should be null bytes. The
value is set by the OUTPUT keyword to NLMLINK. */
unsigned char moduleName[14];
/* Padding to make it come out correct. */
unsigned char pad1[2];
/* The byte offset of the code image from the start of the file. */
unsigned char codeImageOffset[4];
/* The size of the code image, in bytes. */
unsigned char codeImageSize[4];
/* The byte offset of the data image from the start of the file. */
unsigned char dataImageOffset[4];
/* The size of the data image, in bytes. */
unsigned char dataImageSize[4];
/* The size of the uninitialized data region that the loader is to be
allocated at load time. Uninitialized data follows the initialized
data in the NLM address space. */
unsigned char uninitializedDataSize[4];
/* The byte offset of the custom data from the start of the file. The
custom data is set by the CUSTOM keyword to NLMLINK. It is possible
for this to be EOF if there is no custom data. */
unsigned char customDataOffset[4];
/* The size of the custom data, in bytes. */
unsigned char customDataSize[4];
/* The byte offset of the module dependencies from the start of the file.
The module dependencies are determined by the MODULE keyword in
NLMLINK. */
unsigned char moduleDependencyOffset[4];
/* The number of module dependencies at the moduleDependencyOffset. */
unsigned char numberOfModuleDependencies[4];
/* The byte offset of the relocation fixup data from the start of the file */
unsigned char relocationFixupOffset[4];
unsigned char numberOfRelocationFixups[4];
unsigned char externalReferencesOffset[4];
unsigned char numberOfExternalReferences[4];
unsigned char publicsOffset[4];
unsigned char numberOfPublics[4];
/* The byte offset of the internal debug info from the start of the file.
It is possible for this to be EOF if there is no debug info. */
unsigned char debugInfoOffset[4];
unsigned char numberOfDebugRecords[4];
unsigned char codeStartOffset[4];
unsigned char exitProcedureOffset[4];
unsigned char checkUnloadProcedureOffset[4];
unsigned char moduleType[4];
unsigned char flags[4];
} Nlm32_powerpc_External_Fixed_Header;

View File

@ -1,121 +0,0 @@
/* SPARC NLM (NetWare Loadable Module) support for BFD.
Copyright (C) 1993-2018 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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
/* The external format of the fixed header. */
typedef struct nlm32_sparc_external_fixed_header
{
/* The signature field identifies the file as an NLM. It must contain
the signature string, which depends upon the NLM target. */
unsigned char signature[24];
/* The version of the header. At this time, the highest version number
is 4. */
unsigned char version[4];
/* The name of the module, which must be a DOS name (1-8 characters followed
by a period and a 1-3 character extension). The first byte is the byte
length of the name and the last byte is a null terminator byte. This
field is fixed length, and any unused bytes should be null bytes. The
value is set by the OUTPUT keyword to NLMLINK. */
unsigned char moduleName[14];
/* Padding to make it come out correct. */
unsigned char pad1[2];
/* The byte offset of the code image from the start of the file. */
unsigned char codeImageOffset[4];
/* The size of the code image, in bytes. */
unsigned char codeImageSize[4];
/* The byte offset of the data image from the start of the file. */
unsigned char dataImageOffset[4];
/* The size of the data image, in bytes. */
unsigned char dataImageSize[4];
/* The size of the uninitialized data region that the loader is to be
allocated at load time. Uninitialized data follows the initialized
data in the NLM address space. */
unsigned char uninitializedDataSize[4];
/* The byte offset of the custom data from the start of the file. The
custom data is set by the CUSTOM keyword to NLMLINK. It is possible
for this to be EOF if there is no custom data. */
unsigned char customDataOffset[4];
/* The size of the custom data, in bytes. */
unsigned char customDataSize[4];
/* The byte offset of the module dependencies from the start of the file.
The module dependencies are determined by the MODULE keyword in
NLMLINK. */
unsigned char moduleDependencyOffset[4];
/* The number of module dependencies at the moduleDependencyOffset. */
unsigned char numberOfModuleDependencies[4];
/* The byte offset of the relocation fixup data from the start of the file */
unsigned char relocationFixupOffset[4];
unsigned char numberOfRelocationFixups[4];
unsigned char externalReferencesOffset[4];
unsigned char numberOfExternalReferences[4];
unsigned char publicsOffset[4];
unsigned char numberOfPublics[4];
/* The byte offset of the internal debug info from the start of the file.
It is possible for this to be EOF if there is no debug info. */
unsigned char debugInfoOffset[4];
unsigned char numberOfDebugRecords[4];
unsigned char codeStartOffset[4];
unsigned char exitProcedureOffset[4];
unsigned char checkUnloadProcedureOffset[4];
unsigned char moduleType[4];
unsigned char flags[4];
} Nlm32_sparc_External_Fixed_Header;

View File

@ -1,3 +1,14 @@
2018-04-16 Alan Modra <amodra@gmail.com>
* Makefile.am: Remove netware support.
* configure.tgt: Likewise.
* testsuite/ld-powerpc/powerpc.exp: Likewise.
* emulparams/i386nw.sh: Delete.
* emulparams/ppcnw.sh: Delete.
* scripttempl/nw.sc: Delete.
* Makefile.in: Regenerate.
* po/BLD-POTFILES.in: Regenerate.
2018-04-14 Alan Modra <amodra@gmail.com>
* ldmain.c (main): Move config.maxpagesize and

View File

@ -335,7 +335,6 @@ ALL_EMULATION_SOURCES = \
ei386msdos.c \
ei386nbsd.c \
ei386nto.c \
ei386nw.c \
ei386pe.c \
ei386pe_posix.c \
em32relf.c \
@ -377,7 +376,6 @@ ALL_EMULATION_SOURCES = \
epjlelf.c \
eppclynx.c \
eppcmacos.c \
eppcnw.c \
eppcpe.c \
epruelf.c \
eriscix.c \
@ -1500,9 +1498,6 @@ ei386nbsd.c: $(srcdir)/emulparams/i386nbsd.sh \
ei386nto.c: $(srcdir)/emulparams/i386nto.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
ei386nw.c: $(srcdir)/emulparams/i386nw.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
ei386pe.c: $(srcdir)/emulparams/i386pe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
@ -1696,9 +1691,6 @@ eppclynx.c: $(srcdir)/emulparams/ppclynx.sh \
eppcmacos.c: $(srcdir)/emulparams/ppcmacos.sh \
$(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
eppcnw.c: $(srcdir)/emulparams/ppcnw.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
eppcpe.c: $(srcdir)/emulparams/ppcpe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/ppcpe.sc ${GEN_DEPENDS}

View File

@ -704,7 +704,6 @@ ALL_EMULATION_SOURCES = \
ei386msdos.c \
ei386nbsd.c \
ei386nto.c \
ei386nw.c \
ei386pe.c \
ei386pe_posix.c \
em32relf.c \
@ -746,7 +745,6 @@ ALL_EMULATION_SOURCES = \
epjlelf.c \
eppclynx.c \
eppcmacos.c \
eppcnw.c \
eppcpe.c \
epruelf.c \
eriscix.c \
@ -1366,7 +1364,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ei386msdos.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ei386nbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ei386nto.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ei386nw.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ei386pe.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ei386pe_posix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ei386pep.Po@am__quote@
@ -1411,7 +1408,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epjlelf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eppclynx.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eppcmacos.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eppcnw.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eppcpe.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epruelf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eriscix.Po@am__quote@
@ -3058,9 +3054,6 @@ ei386nbsd.c: $(srcdir)/emulparams/i386nbsd.sh \
ei386nto.c: $(srcdir)/emulparams/i386nto.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
ei386nw.c: $(srcdir)/emulparams/i386nw.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
ei386pe.c: $(srcdir)/emulparams/i386pe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
@ -3254,9 +3247,6 @@ eppclynx.c: $(srcdir)/emulparams/ppclynx.sh \
eppcmacos.c: $(srcdir)/emulparams/ppcmacos.sh \
$(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
eppcnw.c: $(srcdir)/emulparams/ppcnw.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
eppcpe.c: $(srcdir)/emulparams/ppcpe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/ppcpe.sc ${GEN_DEPENDS}

View File

@ -80,7 +80,6 @@ alpha*-*-linux-*) targ_emul=elf64alpha targ_extra_emuls=alpha
tdir_alpha=`echo ${targ_alias} | sed -e 's/linux\(-gnu\)*/linux\1ecoff/'` ;;
alpha*-*-osf*) targ_emul=alpha ;;
alpha*-*-gnu*) targ_emul=elf64alpha ;;
alpha*-*-netware*) targ_emul=alpha ;;
alpha*-*-netbsd*) targ_emul=elf64alpha_nbsd ;;
alpha*-*-openbsd*) targ_emul=elf64alpha ;;
alpha*-*-*vms*) targ_emul=alphavms
@ -328,7 +327,6 @@ x86_64-*-netbsd*) targ_emul=elf_x86_64
*) tdir_elf_i386=`echo ${tdir_elf_i386} | \
sed -e 's/netbsd/netbsdelf/'`;;
esac ;;
i[3-7]86-*-netware) targ_emul=i386nw ;;
i[3-7]86-*-elfiamcu) targ_emul=elf_iamcu
targ_extra_emuls=elf_i386 ;;
i[3-7]86-*-elf* | i[3-7]86-*-rtems*)
@ -680,7 +678,6 @@ powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \
powerpc-*-nto*) targ_emul=elf32ppcnto ;;
powerpcle-*-nto*) targ_emul=elf32lppcnto ;;
powerpc-*-macos*) targ_emul=ppcmacos ;;
powerpc-*-netware*) targ_emul=ppcnw ;;
powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*)
targ_emul=ppcpe
targ_extra_ofiles="deffilep.o pe-dll.o" ;;

View File

@ -1,8 +0,0 @@
SCRIPT_NAME=nw
OUTPUT_FORMAT="elf32-i386"
TEXT_START_ADDR=0x08000000
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=i386
NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes

View File

@ -1,6 +0,0 @@
SCRIPT_NAME=nw
OUTPUT_FORMAT="elf32-powerpc"
TEXT_START_ADDR=0x0400000
DATA_ADDR=0x10000000
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=powerpc

View File

@ -250,7 +250,6 @@ ei386moss.c
ei386msdos.c
ei386nbsd.c
ei386nto.c
ei386nw.c
ei386pe.c
ei386pe_posix.c
ei386pep.c
@ -295,7 +294,6 @@ epjelf.c
epjlelf.c
eppclynx.c
eppcmacos.c
eppcnw.c
eppcpe.c
epruelf.c
eriscix.c

View File

@ -1,143 +0,0 @@
# Copyright (C) 2014-2018 Free Software Foundation, Inc.
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
#
# Unusual variables checked by this code:
# NOP - four byte opcode for no-op (defaults to 0)
# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
# OTHER_READONLY_SECTIONS - other than .text .init .ctors .rodata ...
# (e.g., .PARISC.milli)
# OTHER_READWRITE_SECTIONS - other than .data .bss .sdata ...
# (e.g., .PARISC.global)
# OTHER_SECTIONS - at the end
# EXECUTABLE_SYMBOLS - symbols that must be defined for an
# executable (e.g., _DYNAMIC_LINK)
# TEXT_START_SYMBOLS - symbols that appear at the start of the
# .text section.
# DATA_START_SYMBOLS - symbols that appear at the start of the
# .data section.
# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
# .bss section besides __bss_start.
# DATA_PLT - .plt should be in data segment, not text segment.
#
# When adding sections, do note that the names of some sections are used
# when specifying the start address of the next.
#
test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test "$LD_FLAG" = "N" && DATA_ADDR=.
INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }"
cat <<EOF
/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
Copying and distribution of this script, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. */
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
${RELOCATING+${LIB_SEARCH_DIRS}}
${RELOCATING+/* Do we need any of these for elf?
__DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING- /* For some reason, the Solaris linker makes bad executables
if gld -r is used and the intermediate file has sections starting
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
bug. But for now assigning the zero vmas works. */}
SECTIONS
{
/* Read-only sections, merged into text segment: */
${CREATE_SHLIB-${RELOCATING+. = ${TEXT_START_ADDR} + SIZEOF_HEADERS;}}
${CREATE_SHLIB+${RELOCATING+. = SIZEOF_HEADERS;}}
${CREATE_SHLIB-${INTERP}}
.hash ${RELOCATING-0} : { *(.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) }
.rel.text ${RELOCATING-0} : { *(.rel.text) }
.rela.text ${RELOCATING-0} : { *(.rela.text) }
.rel.data ${RELOCATING-0} : { *(.rel.data) }
.rela.data ${RELOCATING-0} : { *(.rela.data) }
.rel.rodata ${RELOCATING-0} : { *(.rel.rodata) }
.rela.rodata ${RELOCATING-0} : { *(.rela.rodata) }
.rel.got ${RELOCATING-0} : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
.rel.bss ${RELOCATING-0} : { *(.rel.bss) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss) }
.rel.plt ${RELOCATING-0} : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) }
.init ${RELOCATING-0} : { *(.init) } =${NOP-0}
${DATA_PLT-${PLT}}
.text ${RELOCATING-0} :
{
${RELOCATING+${TEXT_START_SYMBOLS}}
*(.text)
${CONSTRUCTING+ __CTOR_LIST__ = .;}
${CONSTRUCTING+ LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)}
${CONSTRUCTING+ *(.ctors)}
${CONSTRUCTING+ LONG(0)}
${CONSTRUCTING+ __CTOR_END__ = .;}
${CONSTRUCTING+ __DTOR_LIST__ = .;}
${CONSTRUCTING+ LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)}
${CONSTRUCTING+ *(.dtors)}
${CONSTRUCTING+ LONG(0)}
${CONSTRUCTING+ __DTOR_END__ = .;}
}
${RELOCATING+_etext = .;}
${RELOCATING+PROVIDE (etext = .);}
.fini ${RELOCATING-0} : { *(.fini) } =${NOP-0}
.ctors ${RELOCATING-0} : { *(.ctors) }
.dtors ${RELOCATING-0} : { *(.dtors) }
.rodata ${RELOCATING-0} : { *(.rodata) }
.rodata1 ${RELOCATING-0} : { *(.rodata1) }
${OTHER_READONLY_SECTIONS}
/* Read-write section, merged into data segment: */
${RELOCATING+. = ${DATA_ADDR- ALIGN(8) + ${MAXPAGESIZE}};}
.data ${RELOCATING-0} :
{
${RELOCATING+${DATA_START_SYMBOLS}}
*(.data)
${CONSTRUCTING+CONSTRUCTORS}
}
.data1 ${RELOCATING-0} : { *(.data1) }
${OTHER_READWRITE_SECTIONS}
.got ${RELOCATING-0} : { *(.got.plt) *(.got) }
.dynamic ${RELOCATING-0} : { *(.dynamic) }
${DATA_PLT+${PLT}}
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
.sdata ${RELOCATING-0} : { *(.sdata) }
${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);}
${RELOCATING+__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
.sbss ${RELOCATING-0} : { *(.sbss) *(.scommon) }
.bss ${RELOCATING-0} :
{
*(.dynbss)
*(.bss)
*(COMMON)
}
${RELOCATING+_end = . ;}
${RELOCATING+PROVIDE (end = .);}
/* These are needed for ELF backends which have not yet been
converted to the new style linker. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
${OTHER_SECTIONS}
}
EOF

View File

@ -70,7 +70,7 @@ if {[istarget "*-*-vxworks"]} {
# is ELF, because we pass -melf32ppc to ld and powerpc-nto-ld wants
# -melf32ppcnto.
if { [istarget "*-*-macos*"] || [istarget "*-*-netware*"]
if { [istarget "*-*-macos*"]
|| [istarget "*-*-pe"] || [istarget "*-*-winnt*"]
|| [istarget "*-*-cygwin*"] || [istarget "*-*-aix*"]
|| [istarget "*-*-beos*"] || [istarget "*-*-lynxos*"]