is-strip.o: is-strip.c
is-ranlib.o: is-ranlib.c
not-strip.o: not-strip.c
-nlmheader.o: nlmheader.c nlmconv.h $(INCDIR)/nlm/common.h \
- $(INCDIR)/nlm/internal.h
-nlmconv.o: $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
- $(BFDDIR)/libnlm.h bucomm.h
+nlmheader.o: nlmheader.c ../bfd/bfd.h ../bfd/sysdep.h \
+ $(BFDDIR)/hosts/std-host.h $(INCDIR)/fopen-same.h bucomm.h \
+ $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h nlmconv.h
+nlmconv.o: nlmconv.c ../bfd/bfd.h $(INCDIR)/libiberty.h ../bfd/sysdep.h \
+ $(BFDDIR)/hosts/std-host.h $(INCDIR)/fopen-same.h bucomm.h \
+ $(BFDDIR)/libnlm.h $(INCDIR)/nlm/common.h \
+ $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmconv.h \
+ $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
stage1: force
- mkdir stage1
done; \
else true; fi
-# Use binutils.info as the target so that VPATH will DTRT.
-# (Use "$<*" in case the output is multiple files, though.)
+# This little path search is required because in the FSF net releases,
+# the info files are included in the source tree, and that may not be
+# the same as the build directory.
install-info: binutils.info
- for i in $<* ; do \
+ if [ -r binutils.info ]; then \
+ dir=. ; \
+ else \
+ dir=$(srcdir) ; \
+ fi ; \
+ for i in $$dir/binutils.info* ; do \
$(INSTALL_DATA) $$i $(infodir)/$$i ; \
done
#include <sys/file.h>
#include <assert.h>
#include <getopt.h>
-#include <bfd.h>
-#include <libiberty.h>
+#include "bfd.h"
+#include "libiberty.h"
#include "sysdep.h"
#include "bucomm.h"
/* Internal BFD NLM header. */
long *, char *,
bfd_size_type));
/* start-sanitize-powerpc-netware */
-static void powerpc_build_stubs PARAMS ((bfd *, asymbol ***, long *));
+static void powerpc_build_stubs PARAMS ((bfd *, bfd *, asymbol ***, long *));
static void powerpc_resolve_stubs PARAMS ((bfd *, bfd *));
static void powerpc_mangle_relocs PARAMS ((bfd *, asection *, arelent ***,
long *, char *,
section, we must do this before determining where the TOC section
goes in setup_sections. */
if (bfd_get_arch (inbfd) == bfd_arch_powerpc)
- powerpc_build_stubs (inbfd, &symbols, &symcount);
+ powerpc_build_stubs (inbfd, outbfd, &symbols, &symcount);
/* end-sanitize-powerpc-netware */
/* Set up the sections. */
build a stub for each one. */
static void
-powerpc_build_stubs (inbfd, symbols_ptr, symcount_ptr)
+powerpc_build_stubs (inbfd, outbfd, symbols_ptr, symcount_ptr)
bfd *inbfd;
+ bfd *outbfd;
asymbol ***symbols_ptr;
long *symcount_ptr;
{
* POWERPC_STUB_TOC_ENTRY_SIZE))))
bfd_fatal ("stub section sizes");
}
+
+ /* PowerPC NetWare requires a custom header. We create it here.
+ The first word is the header version number, currently 1. The
+ second word is the timestamp of the input file. */
+ memcpy (nlm_custom_header (outbfd)->stamp, "CuStHeAd", 8);
+ nlm_custom_header (outbfd)->dataLength = 8;
+ nlm_custom_header (outbfd)->data = xmalloc (8);
+ bfd_h_put_32 (outbfd, (bfd_vma) 1,
+ (bfd_byte *) nlm_custom_header (outbfd)->data);
+ {
+ struct stat s;
+
+ if (stat (bfd_get_filename (inbfd), &s) < 0)
+ s.st_mtime = 0;
+ bfd_h_put_32 (outbfd, (bfd_vma) s.st_mtime,
+ (bfd_byte *) nlm_custom_header (outbfd)->data + 4);
+ }
}
/* Resolve all the stubs for PowerPC NetWare. We fill in the contents