home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-04-14 | 233.8 KB | 7,584 lines |
- diff -rc --new-file binutils-2.5.2-base/Makefile.in binutils-2.5.2/Makefile.in
- *** binutils-2.5.2-base/Makefile.in Sat Oct 22 03:16:10 1994
- --- binutils-2.5.2/Makefile.in Mon Mar 27 11:15:50 1995
- ***************
- *** 603,609 ****
- # Installation targets.
-
- .PHONY: install uninstall vault-install
- ! install: $(INSTALL_TARGET)
-
- uninstall:
- @echo "the uninstall target is not supported in this tree"
- --- 603,613 ----
- # Installation targets.
-
- .PHONY: install uninstall vault-install
- ! # AmigaDOS hack - during transition to BFD based 2.5.X binutils
- ! # from 1.8.X binutils add individual install targets as they are
- ! # tested.
- ! #install: $(INSTALL_TARGET)
- ! install: install-gas install-binutils
-
- uninstall:
- @echo "the uninstall target is not supported in this tree"
- diff -rc --new-file binutils-2.5.2-base/Product-Info binutils-2.5.2/Product-Info
- *** binutils-2.5.2-base/Product-Info Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/Product-Info Tue Feb 14 18:26:18 1995
- ***************
- *** 0 ****
- --- 1,18 ----
- + .name
- + binutils
- + .fullname
- + GNU binutils
- + .type
- + Programmer Tools
- + .short
- + GNU binary utilities, Amiga source
- + .description
- + The GNU binary utilities.
- + .version
- + 2.5.2
- + .requirements
- + Amiga binaries require the ixemul.library.
- + .distribution
- + GNU Public License
- + .described-by
- + Fred Fish (fnf@amigalib.com)
- diff -rc --new-file binutils-2.5.2-base/bfd/Makefile.in binutils-2.5.2/bfd/Makefile.in
- *** binutils-2.5.2-base/bfd/Makefile.in Wed Oct 12 15:57:35 1994
- --- binutils-2.5.2/bfd/Makefile.in Tue Feb 14 18:29:00 1995
- ***************
- *** 118,123 ****
- --- 118,126 ----
- aout-ns32k.o \
- aout0.o \
- aout32.o \
- + aout-amiga.o\
- + amigados.o \
- + amigadoslink.o \
- bout.o \
- cf-i386lynx.o \
- cf-m68klynx.o \
- ***************
- *** 233,239 ****
- # C source files that correspond to .o's.
- CFILES = libbfd.c opncls.c bfd.c archive.c targets.c cache.c \
- archures.c coff-i386.c coff-go32.c aout64.c aout32.c sunos.c demo64.c \
- ! coff-i960.c srec.c tekhex.c oasys.c ieee.c aout0.c \
- ecoff.c ecofflink.c coff-m68k.c coff-u68k.c coff-apollo.c \
- coff-a29k.c coff-rs6000.c coff-sparc.c coffgen.c format.c \
- section.c core.c syms.c stab-syms.c reloc.c init.c \
- --- 236,242 ----
- # C source files that correspond to .o's.
- CFILES = libbfd.c opncls.c bfd.c archive.c targets.c cache.c \
- archures.c coff-i386.c coff-go32.c aout64.c aout32.c sunos.c demo64.c \
- ! coff-i960.c srec.c tekhex.c oasys.c ieee.c aout0.c aout-amiga.c \
- ecoff.c ecofflink.c coff-m68k.c coff-u68k.c coff-apollo.c \
- coff-a29k.c coff-rs6000.c coff-sparc.c coffgen.c format.c \
- section.c core.c syms.c stab-syms.c reloc.c init.c \
- ***************
- *** 253,263 ****
- i386lynx.c cf-i386lynx.c m68klynx.c cf-m68klynx.c \
- sparclynx.c cf-sparclynx.c aix386-core.c hpux-core.c \
- irix-core.c lynx-core.c osf-core.c hash.c linker.c cofflink.c \
- ! ns32knetbsd.c sparcnetbsd.c
-
- HFILES = aout-target.h aoutf1.h aoutx.h coffcode.h \
- coffswap.h ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \
- ! elfcode.h hppa_stubs.h libaout.h libbfd.h \
- libcoff.h libecoff.h libelf.h libhppa.h libieee.h libnlm.h \
- liboasys.h nlm-target.h nlmcode.h som.h genlink.h
-
- --- 256,266 ----
- i386lynx.c cf-i386lynx.c m68klynx.c cf-m68klynx.c \
- sparclynx.c cf-sparclynx.c aix386-core.c hpux-core.c \
- irix-core.c lynx-core.c osf-core.c hash.c linker.c cofflink.c \
- ! ns32knetbsd.c sparcnetbsd.c amigados.c amigadoslink.c
-
- HFILES = aout-target.h aoutf1.h aoutx.h coffcode.h \
- coffswap.h ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \
- ! elfcode.h hppa_stubs.h libamiga.h libaout.h libbfd.h \
- libcoff.h libecoff.h libelf.h libhppa.h libieee.h libnlm.h \
- liboasys.h nlm-target.h nlmcode.h som.h genlink.h
-
- ***************
- *** 525,530 ****
- --- 528,537 ----
-
- bfd.ps:
- (cd $(docdir); $(MAKE) bfd.ps $(FLAGS_TO_PASS))
- +
- + amigados.o: amigados.c libamiga.h bfd.h
- + amigadoslink.o: bfd.h libamiga.h amigadoslink.c
- + aout-amiga.o: aout-amiga.c aoutf1.h bfd.h
-
- # What appears below is generated by a hacked mkdep using gcc -MM.
-
- diff -rc --new-file binutils-2.5.2-base/bfd/amigados.c binutils-2.5.2/bfd/amigados.c
- *** binutils-2.5.2-base/bfd/amigados.c Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/bfd/amigados.c Sun Feb 12 21:59:42 1995
- ***************
- *** 0 ****
- --- 1,2594 ----
- + /* BFD back-end for Commodore-Amiga AmigaDOS binaries.
- + Copyright (C) 1990-1994 Free Software Foundation, Inc.
- + Contributed by Leonard Norrgard. Partially based on the bout
- + and ieee BFD backends and Markus Wild's tool hunk2gcc.
- + Revised and updated by Stephan Thesing
- +
- + This file is part of BFD, the Binary File Descriptor library.
- +
- + This program is free software; you can redistribute it and/or modify
- + it under the terms of the GNU General Public License as published by
- + the Free Software Foundation; either version 2 of the License, or
- + (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., 675 Mass Ave, Cambridge, MA 02139, USA. */
- +
- + /*
- + SECTION
- + amiga back end
- +
- + This section describes the overall structure of the Amiga BFD back end.
- + The linker stuff can be found in @xref{amigalink}.
- + @menu
- + @* implementation::
- + @* amigalink::
- + @end menu
- +
- + INODE
- + implementation, amigalink, amiga, amiga
- +
- +
- + SECTION
- + implementation
- +
- +
- + The need for a port of the bfd library for Amiga style object (hunk) files
- + arose by the desire to port the GNU debugger gdb to the Amiga.
- + Also, the linker ld should be updated to the current version (2.5.2).
- + @@*
- + This port bases on the work done by Leonard Norrgard, who started porting
- + gdb. Raphael Luebbert, who supports the ixemul.library, has also worked on
- + implementing the needed @code{ptrace()} system call and gas2.5.
- +
- + @menu
- + @* not supported::
- + @* Does it work ?::
- + @* TODO::
- + @end menu
- +
- + INODE
- + not supported, Does it work ?,implementation,implementation
- + SUBSECTION
- + not supported
- +
- + Currently, the implementation does not support Amiga link library files, like
- + e.g. amiga.lib. This may be added in a later version, if anyone starts work
- + on it, or I find some time for it.
- +
- + The handling of the symbols in hunk files is a little bit broken:
- + o The symbols in a load file are totally ignored at the moment, so gdb and gprof
- + do not work.
- + o The symbols of a object module (Hunk file, starting with HUNK_UNIT) are read in
- + correctly, but HUNK_SYMBOL hunks are also ignored.
- +
- + The reason for this is the following:
- + Amiga symbol hunks do not allow for much information. Only a name and a value are allowed.
- + On the other hand, a.out format carries along much more information (see, e.g. the
- + entry on set symbols in the ld manual). The old linker copied this information into
- + a HUNK_DEBUG hunk. Now there is the choice:
- + o ignoring the debug hunk, read in only HUNK_SYMBOL definitions => extra info is lost.
- + o read in the debug hunk and use the information therein => How can clashs between the
- + information in the debug hunk and HUNK_SYMBOL or HUNK_EXT hunks be avoided ?
- + I haven't decided yet, what to do about this.
- +
- +
- + Although bfd allows to link together object modules of different flavours,
- + producing a.out style executables does not work on Amiga :-)
- + It should, however, be possible to create a.out files with the -r option of ld
- + (incremental link).
- +
- + INODE
- + Does it work ?,TODO ,not supported , implementation
- + SUBSECTION
- + Does it work ?
- +
- + Currently, the following utillities work:
- + o objdump
- + o objcopy
- + o strip
- + o nm
- + o ar
- + o gas
- +
- +
- + INODE
- + TODO, , Does it work ?, implementation
- + SUBSECTION
- + TODO
- +
- + o fix fixme:s
- +
- + @*
- + BFD:
- + o add flag to say if the format allows multiple sections with the
- + same name. Fix bfd_get_section_by_name() and bfd_make_section()
- + accordingly.
- +
- + o dumpobj.c: the disassembler: use relocation record data to find symbolic
- + names of addresses, when available. Needs new routine where one can
- + specify the source section of the symbol to be printed as well as some
- + rewrite of the disassemble functions.
- +
- + */
- +
- + #include "bfd.h"
- + #include "bfdlink.h"
- + #include "sysdep.h"
- + #include "libbfd.h"
- + #include "libamiga.h"
- + #include <a.out.h>
- +
- + #define GL(x) bfd_get_32 (abfd, (bfd_byte *) (x))
- +
- + #define DEBUG_AMIGA 10000
- +
- + #if DEBUG_AMIGA
- + #include <varargs.h>
- + static void error_print(va_alist)
- + va_dcl
- + {
- + va_list args;
- + char *fmt;
- +
- + va_start(args);
- + fmt=va_arg(args,char *);
- +
- + (void)vfprintf(stderr,fmt,args);
- + va_end(args);
- + }
- +
- + #define DPRINT(L,x) if (L>=DEBUG_AMIGA) error_print x
- + #else
- + #define DPRINT(L,x)
- + #endif
- +
- + static boolean amiga_digest_file ();
- + static boolean amiga_mkobject ();
- +
- + reloc_howto_type howto_hunk_reloc8 =
- + {
- + HUNK_RELOC8, /* type */
- + 0, /* rightshift */
- + 0, /* size */
- + 8, /* bitsize */
- + true, /* pc_relative */
- + 0, /* bitpos */
- + complain_overflow_bitfield, /* complain_on_overflow */
- + 0, /* special_function */
- + "reloc8", /* textual name */
- + false, /* partial_inplace? */
- + 0x000000ff, /* src_mask */
- + 0x000000ff, /* dst_mask */
- + true /* pcrel_offset */
- + };
- +
- + reloc_howto_type howto_hunk_reloc16 =
- + {HUNK_RELOC16,0,1,16,true,0,complain_overflow_bitfield,0,"reloc16",false,0x0000ffff,0x0000ffff,true};
- +
- + reloc_howto_type howto_hunk_reloc32 =
- + {HUNK_RELOC32,0,2,32,true,0,complain_overflow_bitfield,0,"reloc32",false,0xffffffff,0xffffffff,true};
- +
- + reloc_howto_type howto_hunk_drel8 =
- + {HUNK_DREL8,0,0,8,false,0,complain_overflow_bitfield,0,"drel8",false,0x000000ff,0x000000ff,false};
- +
- + reloc_howto_type howto_hunk_drel16 =
- + {HUNK_DREL16,0,1,16,false,0,complain_overflow_bitfield,0,"drel16",false,0x0000ffff,0x0000ffff,false};
- +
- + reloc_howto_type howto_hunk_drel32 =
- + {HUNK_DREL32,0,2,32,false,0,complain_overflow_bitfield,0,"drel32",false,0xffffffff,0xffffffff,false};
- +
- + reloc_howto_type *amiga_howto_array[2][3] =
- + {
- + { &howto_hunk_reloc8, &howto_hunk_reloc16, &howto_hunk_reloc32 },
- + { &howto_hunk_drel8, &howto_hunk_drel16, &howto_hunk_drel32 }
- + };
- +
- +
- + /* This one is used by the linker and tells us, if a debug hunk should be written out*/
- + int write_debug_hunk=0;
- + /* This is also used by the linker to set the attribute of sections */
- + int amiga_attribute=0;
- +
- + static const struct bfd_target *
- + amiga_object_p (abfd)
- + bfd *abfd;
- + {
- + char buf[8];
- + unsigned int x;
- + struct stat stat_buffer;
- +
- + /* An Amiga object file must be at least 8 bytes long. */
- + if (bfd_read ((PTR) buf, 1, 8, abfd) != 8)
- + {
- + bfd_set_error(bfd_error_wrong_format);
- + return 0;
- + }
- +
- + /* Does it look like an Amiga object file? */
- + x = GL(buf);
- + if ((x != HUNK_UNIT) && (x != HUNK_HEADER))
- + {
- + /* Not an Amiga file. */
- + bfd_set_error(bfd_error_wrong_format);
- + return 0;
- + }
- +
- + /* So far it seems to be an Amiga file. Now slurp it
- + in and examine it closer. */
- + stat_buffer.st_size=0;
- + if ((-1 == fstat (fileno ((FILE *) abfd->iostream), &stat_buffer))||(stat_buffer.st_size%4!=0))
- + { /* Error during system call or file length is not multiple of longword size */
- + bfd_set_error((stat_buffer.st_size%4==0)?bfd_error_system_call:bfd_error_wrong_format);
- + return 0;
- + }
- +
- + /* Can't fail and return (but must be declared boolean to suit
- + other bfd requirements). */
- + (void) amiga_mkobject (abfd);
- +
- +
- + AMIGA_DATA(abfd)->first_byte = (unsigned long *) bfd_alloc (abfd, stat_buffer.st_size);
- + bfd_seek (abfd, 0, SEEK_SET);
- +
- + if (bfd_read (AMIGA_DATA(abfd)->first_byte, 1, stat_buffer.st_size, abfd)!=stat_buffer.st_size)
- + {
- + /* Error, reading file */
- + return (const struct bfd_target *)0;
- + }
- +
- + AMIGA_DATA(abfd)->file_pointer = AMIGA_DATA(abfd)->first_byte;
- + AMIGA_DATA(abfd)->file_end = (unsigned long *)((unsigned char *)AMIGA_DATA(abfd)->first_byte + stat_buffer.st_size);
- +
- + if (!amiga_digest_file (abfd))
- + {
- + /* Something went wrong. */
- + return (const struct bfd_target *) 0;
- + }
- +
- + /* Set default architecture to m68k:68000. */
- + /* So we can link on 68000 AMIGAs..... */
- + abfd->arch_info = bfd_scan_arch ("m68k:68000");
- +
- + return (abfd->xvec);
- + }
- +
- + /* Skip over the hunk length longword + the number of longwords given there. */
- + #define next_hunk(abfd) \
- + { AMIGA_DATA(abfd)->file_pointer += 1 + GL(AMIGA_DATA(abfd)->file_pointer); }
- +
- + static asection *
- + amiga_get_section_by_hunk_number (abfd, hunk_number)
- + bfd *abfd;
- + long hunk_number;
- + {
- + /* A cache, so we don't have to search the entire list every time. */
- + static asection *last_reference;
- + asection *p;
- +
- + switch(hunk_number)
- + {
- + case -1:
- + return bfd_abs_section_ptr;
- + break;
- + case -2:
- + return bfd_und_section_ptr;
- + break;
- + case -3:
- + return bfd_com_section_ptr;
- + break;
- + default:
- + if (last_reference)
- + if (last_reference->target_index == hunk_number)
- + return last_reference;
- + for (p = abfd->sections; p != NULL; p = p->next)
- + if (p->target_index == hunk_number)
- + {
- + last_reference = p;
- + return p;
- + }
- + BFD_FAIL();
- + return (asection *) 0;
- + }
- + return NULL;
- + }
- +
- + static boolean
- + amiga_add_reloc (abfd, section, offset, symbol, howto, target_hunk)
- + bfd *abfd;
- + asection *section;
- + bfd_size_type offset;
- + amiga_symbol_type * symbol;
- + reloc_howto_type *howto;
- + long target_hunk;
- + {
- + amiga_reloc_type *reloc;
- +
- + reloc = (amiga_reloc_type *) bfd_zalloc (abfd, sizeof (amiga_reloc_type));
- + reloc->next = 0;
- +
- + if (!reloc)
- + {
- + bfd_set_error(bfd_error_no_memory);
- + return(false);
- + }
- +
- +
- + abfd -> flags |= HAS_RELOC;
- + section -> flags |= SEC_RELOC;
- +
- + if (amiga_per_section(section)->reloc_tail)
- + amiga_per_section(section)->reloc_tail->next = reloc;
- + else
- + section->relocation = (struct reloc_cache_entry *) reloc;
- + amiga_per_section(section)->reloc_tail = reloc;
- + amiga_per_section(section)->reloc_tail->next = NULL;
- + reloc->relent.address = offset;
- + reloc->relent.addend = 0;
- + reloc->relent.howto = howto;
- +
- + if (symbol==NULL) /* relative to section */
- + reloc->symbol=(amiga_symbol_type *)(amiga_get_section_by_hunk_number(abfd,target_hunk)->symbol);
- + else
- + reloc->symbol = symbol;
- + reloc->relent.sym_ptr_ptr=(asymbol **)(&(reloc->symbol));
- + reloc->target_hunk = target_hunk;
- +
- + return true;
- + }
- +
- + /* BFD doesn't currently allow multiple sections with the same
- + name, so we try a little harder to get a unique name. */
- + asection *
- + amiga_make_unique_section (abfd, name)
- + bfd *abfd;
- + CONST char *name;
- + {
- + asection *section;
- +
- +
- + section = bfd_make_section (abfd, name);
- + if (!section)
- + {
- + int i = 1;
- + char *new_name;
- +
- + new_name = bfd_alloc (abfd, strlen(name) + 3);
- +
- + /* We try to come up with an original name (since BFD
- + currently requires all sections to have different names). */
- + while (!section && (i<=99))
- + {
- + sprintf (new_name, "%s_%u", name, i);
- + section = bfd_make_section (abfd, new_name);
- + }
- +
- + if (!section)
- + {
- + /* Complain about the given name. */
- + bfd_set_error(bfd_error_bad_value);
- + return 0;
- + }
- + }
- +
- +
- + return section;
- + }
- +
- +
- +
- + #if DEBUG_AMIGA
- + #define DPRINTHUNK(x) fprintf (stderr,"Processing %s hunk (0x%x)...",\
- + (x) == HUNK_UNIT ? "HUNK_UNIT" :\
- + (x) == HUNK_NAME ? "HUNK_NAME" :\
- + (x) == HUNK_DEBUG ? "HUNK_DEBUG" :\
- + (x) == HUNK_OVERLAY ? "HUNK_OVERLAY" :\
- + (x) == HUNK_BREAK ? "HUNK_BREAK" :\
- + (x) == HUNK_HEADER ? "HUNK_HEADER" :\
- + (x) == HUNK_CODE ? "HUNK_CODE" :\
- + (x) == HUNK_DATA ? "HUNK_DATA" :\
- + (x) == HUNK_BSS ? "HUNK_BSS" :\
- + (x) == HUNK_RELOC8 ? "HUNK_RELOC8" :\
- + (x) == HUNK_RELOC16 ? "HUNK_RELOC16" :\
- + (x) == HUNK_RELOC32 ? "HUNK_RELOC32" :\
- + (x) == HUNK_DREL8 ? "HUNK_DREL8" :\
- + (x) == HUNK_DREL16 ? "HUNK_DREL16" :\
- + (x) == HUNK_DREL32 ? "HUNK_DREL32" :\
- + (x) == HUNK_SYMBOL ? "HUNK_SYMBOL" :\
- + (x) == HUNK_EXT ? "HUNK_EXT" :\
- + (x) == HUNK_END ? "HUNK_END" :\
- + (x) == HUNK_LIB ? "HUNK_LIB" :\
- + (x) == HUNK_INDEX ? "HUNK_INDEX" :\
- + "*unknown*",(x))
- + #define DPRINTHUNKEND fprintf(stderr,"...done\n")
- + #else
- + #define DPRINTHUNK(x)
- + #define DPRINTHUNKEND
- + #endif
- +
- + static boolean amiga_read_unit(bfd *abfd);
- + static boolean amiga_read_load(bfd *abfd);
- + static boolean amiga_handle_cdb_hunk(bfd *abfd, int ht,int hn,int ha,int hs);
- + static boolean amiga_handle_rest(bfd *abfd,asection *cs,boolean isload);
- +
- + static boolean
- + amiga_digest_file (abfd)
- + bfd *abfd;
- + {
- + amiga_data_type *amiga_data = AMIGA_DATA(abfd);
- + int hunk_type;
- +
- +
- + hunk_type = HUNK_VALUE(GL(amiga_data->file_pointer++));
- +
- +
- + switch (hunk_type)
- + {
- + case HUNK_UNIT:
- +
- + /* Read in the unit */
- + if (!amiga_read_unit(abfd)) /* Error */
- + return(false);
- + break;
- +
- + case HUNK_HEADER:
- + /* This is a load file, well it should not be used with linking,
- + but it is possible to do so, so always allow it. */
- +
- + /* Read in the load file */
- + if (!amiga_read_load(abfd)) /* Error */
- + {
- + return(false);
- + }
- + break;
- + } /* of switch hunk_type */
- +
- +
- +
- + /* If there is any trailing garbage, i.e. we are not at EOF, then
- + complain and reject the file... */
- + if (amiga_data->file_pointer!=amiga_data->file_end) /* ooops */
- + {
- + bfd_set_error(bfd_error_wrong_format);
- + return(false);
- + }
- +
- + /* Success, all went well... */
- + return(true);
- +
- + }/* of amiga_digest_file */
- +
- +
- + /* If we read over the end of file, error */
- + #define TOO_LARGE_P if (amiga_data->file_pointer>=amiga_data->file_end)\
- + {DPRINT(10,("Overflow of file pointer\n"));bfd_set_error(bfd_error_wrong_format);return false;}
- +
- +
- + /* Read in Unit file */
- + /* file pointer is located after the HUNK_UNIT LW */
- + static boolean amiga_read_unit(bfd *abfd)
- + {
- +
- + amiga_data_type *amiga_data = AMIGA_DATA(abfd);
- + int hunk_type;
- + int hunk_number=0;
- + int hunk_attribute=0;
- +
- + /* The unit name, if given, has no meaning to us,
- + since we are not in an archive.
- + We could set the name of abfd to the name, but that
- + may cause confusion...
- + So just ignore the unit name
- + ST 121194 */
- + amiga_data->file_pointer+=GL(amiga_data->file_pointer)+1;
- +
- + TOO_LARGE_P;
- +
- +
- + while (true)
- + {
- +
- + /* Now there may be CODE, DATA, BSS, SYMBOL, DEBUG, RELOC Hunks */
- +
- + hunk_type=HUNK_VALUE(GL(amiga_data->file_pointer)); /* Type of next hunk */
- + hunk_attribute=HUNK_ATTRIBUTE(GL(amiga_data->file_pointer++));
- + hunk_attribute=(hunk_attribute==HUNK_ATTR_CHIP)?
- + MEMF_CHIP:(hunk_attribute==HUNK_ATTR_FAST)?MEMF_FAST:0;
- +
- +
- + switch(hunk_type)
- + {
- + case HUNK_DEBUG:
- + /* We ignore debug hunks in UNITS, for now, because gnu's debug hunks
- + are only added by the linker to LOAD files.....
- + And anyhow, a.out format can keep much more information for units...
- + */
- + amiga_data->file_pointer+=1+GL(amiga_data->file_pointer);
- + TOO_LARGE_P;
- +
- + break;
- +
- + case HUNK_NAME:
- + case HUNK_CODE:
- + case HUNK_DATA:
- + case HUNK_BSS:
- + /* Handle this hunk, including relocs, etc.
- + The finishing HUNK_END is consumed by the routine
- + */
- + if (!amiga_handle_cdb_hunk(abfd,hunk_type,hunk_number++,hunk_attribute,-1))
- + return(false);
- +
- + break;
- +
- + default:
- + /* Something very nasty happened:
- + Illegal Hunk occured....
- + */
- + bfd_set_error(bfd_error_wrong_format);
- + return(false);
- + break;
- +
- + }/* Of switch hunk_type */
- +
- +
- + /* Last HUNK ?*/
- + if (amiga_data->file_pointer==amiga_data->file_end)
- + return true;
- +
- + TOO_LARGE_P; /* Sanity check */
- +
- + /* Next hunk */
- + }/* Of while */
- +
- + }/* Of amiga_read_unit */
- +
- +
- + #define MAX_HUNKS 200 /* Max # of hunks. we can read in.. */
- +
- + /* Read a load file */
- + static boolean amiga_read_load(bfd *abfd)
- + {
- + amiga_data_type *amiga_data = AMIGA_DATA(abfd);
- + int hunk_sizes[MAX_HUNKS]; /* If there are more hunks than this, we are in trouble...*/
- + int hunk_attributes[MAX_HUNKS];
- + int hunk_number=0;
- + int hunk_type;
- + int max_hunk_number=0;
- + int i,n;
- +
- + TOO_LARGE_P; /* Sanity */
- +
- + /* Read hunk lengths (and memory attributes...) */
- + /* Read in each hunk */
- +
- + /* If there are resident libs: abort (obsolete feature) */
- + if (GL(amiga_data->file_pointer++)!=0)
- + {
- + bfd_set_error(bfd_error_wrong_format);
- + return(false);
- + }
- +
- + TOO_LARGE_P;
- +
- + max_hunk_number=GL(amiga_data->file_pointer++);
- +
- + if (max_hunk_number>MAX_HUNKS) /* Ooops... too much hunks */
- + {
- + fprintf(stderr,"File %s has too many hunks (%d), aborting\n",abfd->filename,max_hunk_number);
- + bfd_set_error(bfd_error_wrong_format);
- + return(false);
- + }
- +
- + /* Sanity */
- + if ((max_hunk_number<1)||
- + (amiga_data->file_pointer+max_hunk_number+2>=amiga_data->file_end))
- + {
- + bfd_set_error(bfd_error_wrong_format);
- + return(false);
- + }
- +
- + /* Num of root hunk must be 0 */
- + if (GL(amiga_data->file_pointer++)!=0)
- + {
- + bfd_set_error(bfd_error_wrong_format);
- + return(false);
- + }
- +
- + /* Num of last hunk must be mhn-1 */
- + if (GL(amiga_data->file_pointer++)!=max_hunk_number-1)
- + {
- + bfd_set_error(bfd_error_wrong_format);
- + return(false);
- + }
- +
- + /* Now, read in sizes and memory attributes */
- +
- + for (i=0;i<max_hunk_number;i++)
- + {
- + n=HUNK_VALUE(GL(amiga_data->file_pointer));
- + hunk_sizes[i]=n<<2;
- + n=HUNK_ATTRIBUTE(GL(amiga_data->file_pointer++));
- + if (n==HUNK_ATTR_FOLLOWS) /* Attribute is in next long */
- + hunk_attributes[i]=GL(amiga_data->file_pointer++);
- + else
- + hunk_attributes[i]= (n==HUNK_ATTR_CHIP)?MEMF_CHIP:
- + (n==HUNK_ATTR_FAST)?MEMF_FAST:0;
- + }
- +
- + TOO_LARGE_P; /* Sanity */
- +
- + /* We can now read in all the hunks */
- +
- + for (hunk_number=0;hunk_number<max_hunk_number;hunk_number++)
- + {
- + hunk_type=HUNK_VALUE(GL(amiga_data->file_pointer++));
- +
- +
- + /* This may be HUNK_NAME, CODE, BSS, DEBUG, DATA */
- +
- + switch(hunk_type)
- + {
- + case HUNK_NAME:
- + case HUNK_CODE:
- + case HUNK_DATA:
- + case HUNK_BSS:
- + case HUNK_DEBUG:
- + if (
- + !amiga_handle_cdb_hunk(abfd,hunk_type,hunk_number,hunk_attributes[hunk_number],
- + hunk_sizes[hunk_number]))
- + {
- + bfd_set_error(bfd_error_wrong_format);
- + return(false);
- + }
- + break;
- +
- + default:
- + /* illegal hunk */
- + bfd_set_error(bfd_error_wrong_format);
- + return(false);
- + break;
- + }/* Of switch */
- +
- +
- + }
- +
- + if (amiga_data->file_pointer!=amiga_data->file_end)
- + {
- + bfd_set_error(bfd_error_wrong_format);
- + return(false);
- + }
- +
- + return(true);
- +
- + }/* Of amiga_read_load */
- +
- +
- + /* Handle NAME, CODE, DATA, BSS, DEBUG Hunks */
- + static boolean
- + amiga_handle_cdb_hunk(bfd *abfd,
- + int hunk_type,
- + int hunk_number,
- + int hunk_attribute, /* MEMF_CHIP, etc. */
- + int hunk_size)
- + /* If hunk_size==-1, then we are digesting a HUNK_UNIT */
- + {
- + amiga_data_type *amiga_data = AMIGA_DATA(abfd);
- + char *current_name=NULL;
- + int len;
- + asection *current_section=NULL;
- +
- + if (hunk_type==HUNK_NAME) /* get name */
- + {
- + len=HUNK_VALUE(GL(amiga_data->file_pointer))<<2; /* Length */
- + /* DIRTY: We move the name 4 bytes towards the beginning of the file,
- + overwriting the length,
- + and end it with a '\0' */
- + strncpy((char *)amiga_data->file_pointer,(char *)(amiga_data->file_pointer+1),len);
- + *(((char *)amiga_data->file_pointer)+len)='\0';
- + current_name=(char *)amiga_data->file_pointer;
- + amiga_data->file_pointer+=1+(len>>2); /* Advance */
- +
- + TOO_LARGE_P;
- +
- + hunk_type=HUNK_VALUE(GL(amiga_data->file_pointer++)); /* Next hunk */
- + if (hunk_size==-1) /* In a unit ==> Get attribute from file */
- + {
- + hunk_attribute=HUNK_ATTRIBUTE(GL(amiga_data->file_pointer-1));
- + hunk_attribute=(hunk_attribute==HUNK_ATTR_CHIP)?MEMF_CHIP:
- + (hunk_attribute==HUNK_ATTR_FAST)?MEMF_FAST:0;
- + }
- + }
- + else /* Set curent name to something appropriate */
- + current_name=(hunk_type==HUNK_CODE)?".text":
- + (hunk_type==HUNK_BSS)?".bss":".data";
- +
- +
- +
- + /* file_pointer is now at hunk_type */
- +
- + switch (hunk_type)
- + {
- + case HUNK_CODE:
- + /* Handle code hunk */
- +
- + len=HUNK_VALUE(GL(amiga_data->file_pointer++))<<2; /* Length of section */
- + if (len>hunk_size) /* len may be shorter than hunk_size... */
- + if (hunk_size==-1)
- + hunk_size=len;
- + else
- + {
- + bfd_set_error(bfd_error_wrong_format);
- + return false;
- + }
- +
- + /* Make new section */
- + current_section=amiga_make_unique_section(abfd,current_name);
- + if (!current_section)
- + return false;
- +
- + current_section->filepos=(char *)(amiga_data->file_pointer)-(char *)amiga_data->first_byte;
- + current_section->_raw_size=hunk_size;
- + current_section->_cooked_size=hunk_size;
- + current_section->target_index=hunk_number;
- + bfd_set_section_flags(abfd,current_section,
- + SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS);
- +
- + amiga_per_section(current_section)->real_length=len; /* real size */
- + amiga_per_section(current_section)->attribute=hunk_attribute;
- +
- + amiga_data->file_pointer+=(len>>2); /* next hunk */
- +
- + if (!amiga_handle_rest(abfd,current_section,hunk_size!=-1))
- + return false;
- +
- + break;
- +
- + case HUNK_DATA:
- + /* Handle data hunk */
- +
- + len=HUNK_VALUE(GL(amiga_data->file_pointer++))<<2; /* Length of section */
- + if (len>hunk_size) /* len may be shorter than hunk_size... */
- + if (hunk_size==-1)
- + hunk_size=len;
- + else
- + {
- + bfd_set_error(bfd_error_wrong_format);
- + return false;
- + }
- +
- + current_section=amiga_make_unique_section(abfd,current_name);
- + if (!current_section)
- + return false;
- +
- + current_section->filepos=(char *)amiga_data->file_pointer-(char *)amiga_data->first_byte;
- + current_section->_raw_size=hunk_size;
- + current_section->_cooked_size=hunk_size;
- + current_section->target_index=hunk_number;
- + bfd_set_section_flags(abfd,current_section,
- + SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS);
- +
- + amiga_per_section(current_section)->real_length=len; /* real size */
- + amiga_per_section(current_section)->attribute=hunk_attribute;
- +
- + amiga_data->file_pointer+=(len>>2); /* next hunk */
- + if (!amiga_handle_rest(abfd,current_section,hunk_size!=-1))
- + return false;
- + break;
- +
- + case HUNK_BSS:
- + /* Handle bss hunk */
- +
- + len=HUNK_VALUE(GL(amiga_data->file_pointer++))<<2; /* Length of section */
- + if (len>hunk_size) /* len may be shorter than hunk_size... */
- + if (hunk_size==-1)
- + hunk_size=len;
- + else
- + {
- + bfd_set_error(bfd_error_wrong_format);
- + return false;
- + }
- +
- + current_section=amiga_make_unique_section(abfd,current_name);
- + if (!current_section)
- + return false;
- +
- + current_section->filepos=(file_ptr)-1;
- + current_section->_raw_size=hunk_size;
- + current_section->_cooked_size=hunk_size;
- + current_section->target_index=hunk_number;
- +
- + bfd_set_section_flags(abfd,current_section, SEC_ALLOC );
- +
- + amiga_per_section(current_section)->real_length=len; /* real size */
- + amiga_per_section(current_section)->attribute=hunk_attribute;
- +
- + if (!amiga_handle_rest(abfd,current_section,hunk_size!=-1))
- + return false;
- + break;
- +
- + case HUNK_DEBUG:
- + if (hunk_size==-1) /* We are digesting a unit ==> ignore debug hunks */
- + {
- + amiga_data->file_pointer+=1+GL(amiga_data->file_pointer);
- + return(true);
- + }
- + /* We are digesting a load file, so check for gnu debug hunk, else ignore it */
- + /* format of gnu debug hunk is:
- + HUNK_DEBUG
- + N
- + 0413.L Magic number
- + symtabsize
- + strtabsize
- + symtabdata [length=symtabsize]
- + strtabdata [length=strtabsize]
- + [pad bytes]
- + */
- +
- + if (GL(amiga_data->file_pointer+1)==0413) /* GNU DEBUG HUNK */
- + {
- + /*FIXME: we should add the symbols in the debug hunk to symtab... */
- +
- + amiga_data->symtab_size=GL(amiga_data->file_pointer+2);
- + amiga_data->stringtab_size=GL(amiga_data->file_pointer+3);
- + adata(abfd).sym_filepos=
- + (file_ptr)((char *)(amiga_data->file_pointer +4)-(char *)amiga_data->first_byte);
- + adata(abfd).str_filepos=adata(abfd).sym_filepos+amiga_data->symtab_size;
- + amiga_data->file_pointer+=1+GL(amiga_data->file_pointer);
- + }
- + else /* NOT GNU DEBUG HUNK... */
- + {
- + /* ignore it */
- + amiga_data->file_pointer+=1+GL(amiga_data->file_pointer);
- + }
- +
- + /* there has to be an HUNK_END here... */
- + if (GL(amiga_data->file_pointer++)!=HUNK_END)
- + {
- + bfd_set_error(bfd_error_wrong_format);
- + return(false);
- + }
- + break;
- +
- + default:
- + bfd_set_error(bfd_error_wrong_format);
- + return false;
- + break;
- + }/* of switch hunk_type */
- +
- +
- + return(true);
- +
- + }/* Of amiga_handle_cdb_hunk */
- +
- +
- + /* Handle rest of a hunk
- + I.e.: Relocs, EXT, SYMBOLS... */
- + static boolean amiga_handle_rest(bfd *abfd, asection *current_section, boolean isload)
- + {
- + amiga_data_type *amiga_data = AMIGA_DATA(abfd);
- + int hunk_type;
- + int type;
- + int len;
- + int n;
- + unsigned long **p;
- + struct amiga_raw_symbol *sp=NULL;
- +
- +
- + while (1)/* loop */
- + {
- + hunk_type=GL(amiga_data->file_pointer++);
- +
- +
- + switch (hunk_type)
- + {
- + case HUNK_END: /* Reached end */
- + return(true); /* Done */
- + break;
- +
- + /* Relocs.... */
- + case HUNK_RELOC8:
- + case HUNK_RELOC16:
- + case HUNK_RELOC32:
- + case HUNK_DREL8:
- + case HUNK_DREL16:
- + case HUNK_DREL32:
- + /* We leave them alone, but attach them to the section,
- + so we can read them in later.....*/
- +
- + /* But we already set the flags HAS_RELOC, SEC_RELOC */
- + /* We also maintain the reloc count */
- + /* This is simply done by adding all addresses of relocs to an array in the section */
- + p=amiga_per_section(current_section)->raw_relocs;
- + if (amiga_per_section(current_section)->max_raw_relocs<=
- + amiga_per_section(current_section)->num_raw_relocs) /* allocate more space */
- + {
- + if (p==NULL)
- + {
- + p=(unsigned long **)malloc(sizeof(unsigned long *)*10); /* initial */
- + amiga_per_section(current_section)->max_raw_relocs=10;
- + amiga_per_section(current_section)->num_raw_relocs=0;
- + }
- + else /* More space */
- + {
- + p=(unsigned long **)realloc((void *)p,
- + sizeof(unsigned long *)*(amiga_per_section(current_section)->max_raw_relocs+30));
- + amiga_per_section(current_section)->max_raw_relocs+=30;
- + }
- +
- + if (p==NULL)
- + {
- + bfd_set_error(bfd_error_no_memory);
- + return(false);
- + }
- + amiga_per_section(current_section)->raw_relocs=p;
- + }
- + p[amiga_per_section(current_section)->num_raw_relocs++]=amiga_data->file_pointer-1;
- +
- + abfd->flags|=HAS_RELOC;
- + current_section->flags|=SEC_RELOC;
- +
- + /* Advance file_pointer */
- + while ((n=GL(amiga_data->file_pointer++)))
- + {
- + amiga_data->file_pointer+=1+n;
- + current_section->reloc_count+=n;
- + }
- +
- + break;
- +
- + /* Symbol definition */
- + case HUNK_SYMBOL:
- + /* In a unit, we ignore these, since all symbol information comes with HUNK_EXT,
- + in a load file, these are added */
- + if (!isload)
- + {
- + int foo;
- +
- + while ((foo=GL(amiga_data->file_pointer))!=0)
- + amiga_data->file_pointer+=foo+2;
- + amiga_data->file_pointer++;
- + break;
- + }
- + /* We add these, by falling through... */
- +
- + case HUNK_EXT:
- + /* We leave these alone, until they are requested by the user */
- + sp=amiga_per_section(current_section)->last;
- +
- + if (sp==NULL) /* First one added */
- + {
- + amiga_per_section(current_section)->last=amiga_per_section(current_section)->first=
- + (struct amiga_raw_symbol *)(amiga_data->file_pointer-1);
- + *(amiga_data->file_pointer-1)=0;
- + }
- + else
- + {
- + sp->next=(struct amiga_raw_symbol *)(amiga_data->file_pointer-1);
- + *(amiga_data->file_pointer-1)=0;
- + amiga_per_section(current_section)->last=sp->next;
- + }
- + /* skip these */
- +
- + while ((n=GL(amiga_data->file_pointer)))
- + {
- + amiga_data->file_pointer++;
- +
- + type=(n>>24)&0xff;
- + len=n&0xffffff;
- +
- + amiga_data->file_pointer+=len; /* skip name */
- +
- + switch(type)
- + {
- + case EXT_SYMB: /* Symbol hunks are relative to hunk start... */
- + case EXT_DEF: /* def relative to hunk */
- + case EXT_ABS: /* def absolute */
- + abfd->flags|=HAS_SYMS; /* We have symbols */
- + abfd->symcount++;
- + amiga_data->file_pointer++;
- + break;
- +
- + case EXT_REF8: /* 8 bit ref */
- + case EXT_REF16: /* 16 bit ref */
- + case EXT_REF32: /* 32 bit ref */
- + case EXT_DEXT8: /* 8 bit base relative ref */
- + case EXT_DEXT16: /* 16 bit " "*/
- + case EXT_DEXT32: /* 32 bit " " */
- + abfd->flags|=HAS_SYMS;
- + n=GL(amiga_data->file_pointer);
- + if (n)
- + {
- + abfd->flags|=HAS_RELOC;
- + current_section->flags|=SEC_RELOC;
- + }
- + current_section->reloc_count+=n;
- + amiga_data->file_pointer+=1+n;
- + break;
- +
- + case EXT_COMMON: /* Common ref/def */
- + abfd->flags|=HAS_SYMS;
- + abfd->symcount++;
- + n=GL(amiga_data->file_pointer+1);
- + if (n)
- + {
- + abfd->flags|=HAS_RELOC;
- + current_section->flags|=SEC_RELOC;
- + }
- +
- + current_section->reloc_count+=n;
- + amiga_data->file_pointer+=2+n;
- + break;
- +
- + default: /* error */
- +
- + bfd_set_error(bfd_error_wrong_format);
- + return false;
- + break;
- + }/* of switch type */
- +
- + }/* Of while */
- + amiga_data->file_pointer++;
- +
- + break;
- +
- +
- + default: /* error */
- +
- + bfd_set_error(bfd_error_wrong_format);
- + return(false);
- + break;
- + }/* Of switch */
- +
- + }/* of while */
- +
- + return(true);
- +
- + }/* of amiga_handle_rest*/
- +
- +
- +
- + static boolean
- + amiga_mkobject (abfd)
- + bfd *abfd;
- + {
- + struct amiga_data_struct *rawptr;
- +
- + rawptr = (struct amiga_data_struct *) bfd_zalloc (abfd, sizeof (struct amiga_data_struct));
- + abfd->tdata.amiga_data = rawptr;
- +
- + return true;
- + }
- +
- +
- + static boolean amiga_write_section_contents(bfd *, asection *);
- + static boolean amiga_write_symbols(bfd *, asection *);
- +
- + /* used with base relative linking */
- + extern int amiga_base_relative;
- +
- + /* Write out the contents of a bfd */
- + static boolean
- + amiga_write_object_contents (abfd)
- + bfd *abfd;
- + {
- + struct amiga_data_struct *amiga_data=AMIGA_DATA(abfd);
- + sec_ptr p;
- + unsigned long n[5];
- + int i;
- + char b[3];
- +
- + /* Distinguish UNITS, LOAD Files
- + Write out hunks+relocs+HUNK_EXT+HUNK_DEBUG (GNU format)*/
- + DPRINT(5,("Entering write_object_conts\n"));
- +
- + abfd->output_has_begun=true; /* Output has begun */
- +
- +
- + /* Distinguish Load files and Unit files */
- + if (amiga_data->IsLoadFile)
- + {
- + DPRINT(5,("Writing Load file\n"));
- +
- + /* Write out load file header */
- + n[0]=HUNK_HEADER;
- + n[1]=0;
- + n[2]=abfd->section_count;
- + /* If amiga_base_relative is set, we write out one hunk less */
- + if (amiga_base_relative)
- + {
- + n[2]=abfd->section_count-1;
- + BFD_ASSERT(abfd->section_count==3); /* Or we are in big trouble */
- + }
- +
- + n[3]=0;
- + n[4]=n[2]-1;
- + if (bfd_write((PTR)(n),sizeof(unsigned long),5,abfd)!=5*sizeof(unsigned long))
- + return false;
- + /* Write out sizes and memory specifiers... */
- + /* We have to traverse the section list again, bad but no other way... */
- + for (p=abfd->sections;p!=NULL;p=p->next)
- + {
- + if (amiga_base_relative && (strcmp(p->name,".bss")==0)) /* skip */
- + continue;
- +
- + /* Get size for header*/
- + if (amiga_per_section(p)->real_length!=0)
- + n[0]=(amiga_per_section(p)->real_length)>>2;
- + else
- + n[0]=(p->_raw_size)>>2;
- + i=amiga_per_section(p)->attribute;
- + switch (i)
- + {
- + case MEMF_CHIP:
- + n[0]|=0x40000000;
- + i=1;
- + break;
- + case MEMF_FAST:
- + n[0]|=0x80000000;
- + i=1;
- + break;
- + case 0: /* nothing*/
- + i=1;
- + break;
- + default: /* Special one */
- + n[0]|=0xc0000000;
- + n[1]=i;
- + i=2;
- + break;
- + }/* Of switch */
- +
- + if (bfd_write((PTR)(n),sizeof(unsigned long),i,abfd)!=i*sizeof(unsigned long))
- + return false;
- + }/* Of for */
- + }
- + else
- + {/* Unit , no base-relative linking here.... */
- + /* Write out unit header */
- + DPRINT(5,("Writing Unit\n"));
- +
- + n[0]=HUNK_UNIT;
- + if (bfd_write((PTR)(n),sizeof(unsigned long),1,abfd)!=sizeof(unsigned long))
- + return false;
- +
- + i=(strlen(abfd->filename)+3)>>2; /* longword size of name */
- + if (bfd_write((PTR)(&i),sizeof(unsigned long),1,abfd)!=sizeof(unsigned long))
- + return false;
- + if (bfd_write((PTR)(abfd->filename),sizeof(char),strlen(abfd->filename),abfd)!=strlen(abfd->filename))
- + return false;
- + /* Pad to lw boundary */
- + b[0]=b[1]=b[2]='\0';
- + i=(i<<2)-strlen(abfd->filename);
- + if (i)
- + if (bfd_write((PTR)(b),sizeof(char),i,abfd)!=i)
- + return false;
- + /* That's all... for units :-)*/
- + }
- +
- + /* Write out every section */
- + for (p=abfd->sections;p!=NULL;p=p->next)
- + {
- + if (!amiga_write_section_contents(abfd,p)) /* Write out section data + relocs */
- + return false;
- +
- + if (!amiga_write_symbols(abfd,p)) /* Write out symbols, incl HUNK_END */
- + return false;
- +
- + }/* of for sections */
- +
- + /* Write out debug hunk, if requested */
- + if (amiga_data->IsLoadFile && write_debug_hunk)
- + {
- + struct external_nlist {
- + bfd_byte e_strx[BYTES_IN_WORD]; /* index into string table of name */
- + bfd_byte e_type[1]; /* type of symbol */
- + bfd_byte e_other[1]; /* misc info (usually empty) */
- + bfd_byte e_desc[2]; /* description field */
- + bfd_byte e_value[BYTES_IN_WORD]; /* value of symbol */
- + };
- +
- + extern boolean
- + translate_to_native_sym_flags(bfd *, asymbol *, struct external_nlist *);
- +
- + /* We have to convert all the symbols in abfd to a.out style.... */
- + struct external_nlist *data,*p; /* Were to put the data */
- + char *strtab; /* string table */
- + int str_size;
- + int max_str_size;
- + asymbol *sym;
- + asection *s;
- +
- + if (abfd->symcount)
- + {
- + if ((data=(struct external_nlist *)malloc(sizeof(struct external_nlist)*abfd->symcount))==NULL)
- + {
- + hunk_no_mem:
- + fprintf(stderr,"No memory for debug hunk, hunk not written\n");
- + return true;
- + }
- +
- + str_size=4; /* At least*/
- + max_str_size=400; /* initial value */
- + if ((strtab=(char *)malloc(max_str_size))==NULL)
- + {
- + free((void *)data);
- + goto hunk_no_mem;
- + }
- + /* Now, set the .text, .data and .bss fields in the tdata struct (because
- + translate_to_native_sym_flags needs them... */
- + for (i=0,s=abfd->sections;s!=NULL;s=s->next)
- + if (strcmp(s->name,".text")==0)
- + {
- + i|=1;
- + adata(abfd).textsec=s;
- + }
- + else if (strcmp(s->name,".data")==0)
- + {
- + i|=2;
- + adata(abfd).datasec=s;
- + }
- + else if (strcmp(s->name,".bss")==0)
- + {
- + i|=4;
- + adata(abfd).bsssec=s;
- + }
- +
- + if (i!=7) /* One section missing... */
- + {
- + free_all:
- + free(strtab);
- + free(data);
- + goto hunk_no_mem;
- + }
- +
- +
- + for (p=data,i=0;i<abfd->symcount;i++) /* Translate every symbol */
- + {
- + sym=abfd->outsymbols[i];
- + if (sym!=NULL) /* NULL entries have been written already.... */
- + {
- + char *q;
- +
- + if (!translate_to_native_sym_flags(abfd,sym,p))
- + goto free_all;
- + /* Now, add the name of sym to the stringtab */
- + while (max_str_size<=strlen(sym->name)+1+str_size)
- + { /* Realloc space */
- + if ((strtab=(char *)realloc(strtab, max_str_size+1024))==NULL)
- + {
- + free(data);
- + goto hunk_no_mem;
- + }
- + max_str_size+=1024;
- + }
- + PUT_WORD(abfd,str_size,&(p->e_strx[0])); /* Store index */
- + for (q=sym->name;strtab[str_size++]=*q++;)
- + ;
- + p++;
- + }
- + }
- +
- +
- +
- + /* Write out HUNK_DEBUG, size, 0413.... */
- + n[0]=HUNK_DEBUG;
- + n[1]=3+(((p-data)*sizeof(struct nlist)+str_size+3)>>2);
- + n[2]=0413L; /* Magic number */
- + n[3]=(p-data)*sizeof(struct nlist);
- + n[4]=str_size;
- + if (bfd_write((PTR)(n),sizeof(unsigned long),5,abfd)!=5*sizeof(unsigned long))
- + return false;
- +
- + /* Write out symbols */
- + if (bfd_write((PTR)(data),sizeof(struct nlist),(p-data),abfd)!=(p-data)*sizeof(struct nlist))
- + return false;
- + /* Write string tab */
- + if (bfd_write((PTR)(strtab),sizeof(char),(str_size+3)&(~3),abfd)!=(str_size+3)&(~3))
- + return false;
- + }/* Of if abfd->symcount */
- + }/* Of write out debug hunk */
- +
- + return true;
- + }
- +
- +
- + /* Write out section contents, including relocs */
- + static boolean
- + amiga_write_section_contents(bfd *abfd, asection * section)
- + {
- + unsigned long n[2];
- + int i,j;
- + unsigned int k;
- + char b[3];
- + struct reloc_cache_entry *r;
- + asection *osection,*sec,*insection;
- + asymbol *sym_p;
- + unsigned long *reloc_data=NULL;
- + int reloc_count=0;
- + unsigned long *reloc_out=NULL;
- + unsigned long reloc_types[6]={HUNK_RELOC32, HUNK_RELOC16, HUNK_RELOC8,
- + HUNK_DREL32,HUNK_DREL16, HUNK_DREL8};
- + int reloc_counts[6]={0,0,0,0,0,0};
- + int out_size=0;
- + int max_hunk=-1;
- + int size=0;
- + char *c_p;
- + unsigned char *values;
- +
- + DPRINT(5,("Entered Write-section-conts\n"));
- +
- + /* If we are base-relative linking and the section is .bss and abfd is a load file, then return */
- + if (AMIGA_DATA(abfd)->IsLoadFile && amiga_base_relative && (strcmp(section->name,".bss")==0))
- + return true; /* Nothing 2 do */
- +
- + /* WRITE out HUNK_NAME + section name */
- + n[0]=HUNK_NAME;
- + j=strlen(section->name);
- + i=(j+3)>>2; /* LW len of name */
- + n[1]=i;
- + if (bfd_write((PTR)(n),sizeof(unsigned long),2,abfd)!=2*sizeof(unsigned long))
- + return false;
- + if (bfd_write((PTR)(section->name),sizeof(char),j,abfd)!=j)
- + return false;
- + b[0]=b[1]=b[2]='\0';
- + if ((i<<2)-j!=0) /* Pad */
- + if(bfd_write((PTR)(b),sizeof(char),(i<<2)-j,abfd)!=((i<<2)-j))
- + return false;
- +
- + /* Depending on the type of the section, write out HUNK_{CODE|DATA|BSS} */
- + if (section->flags&SEC_CODE) /* Code section */
- + n[0]=HUNK_CODE;
- + else if (section->flags&SEC_DATA) /* data section */
- + n[0]=HUNK_DATA;
- + else if (section->flags&SEC_ALLOC) /* BSS */
- + n[0]=HUNK_BSS;
- + else /* Error */
- + {
- + bfd_set_error(bfd_error_nonrepresentable_section);
- + return(false);
- + }
- +
- + DPRINT(10,("Section type is %lx\n",n[0]));
- +
- + /* Get attribute for section */
- + switch (amiga_per_section(section)->attribute)
- + {
- + case MEMF_CHIP:
- + n[0]|=HUNKF_CHIP;
- + break;
- + case MEMF_FAST:
- + n[0]|=HUNKF_FAST;
- + break;
- + case 0:
- + break;
- + default: /* error , can't represent this */
- + bfd_set_error(bfd_error_nonrepresentable_section);
- + return(false);
- + break;
- + }/* Of switch */
- +
- + DPRINT(10,("Section attribute is %lx\n",n[0]));
- +
- + /* Get real size in n[1], this may be shorter than the size in the header */
- + n[1]=section->_cooked_size>>2;
- + if(n[1]==0)
- + n[1]=section->_raw_size>>2;
- + if (bfd_write((PTR)(n),sizeof(unsigned long),2,abfd)!=2*sizeof(unsigned long))
- + return false;
- +
- + DPRINT(5,("Wrote code and size=%lx\n",n[1]));
- +
- + /* If a BSS hunk, we're done, else write out section contents */
- + if (HUNK_VALUE(n[0])==HUNK_BSS)
- + return true;
- +
- + DPRINT(5,("Non bss hunk...\n"));
- +
- + /* Traverse through the relocs, sample them in reloc_data, adjust section data to get 0 addend
- + Then compactify reloc_data
- + Set the entry in the section for the reloc to NULL */
- +
- + /* Get memory for relocs, we use upper bound */
- + if ((reloc_data=(unsigned long *)malloc(5*sizeof(unsigned long)*section->reloc_count))==NULL)
- + {
- + bfd_set_error(bfd_error_no_memory);
- + return(false);
- + }
- +
- + BFD_ASSERT((section->flags&SEC_IN_MEMORY)!=0);
- +
- + DPRINT(5,("Section has %d relocs\n",section->reloc_count));
- +
- + for (i=0;i<section->reloc_count;i++)
- + {
- + r=section->orelocation[i];
- +
- + DPRINT(5,("Doing reloc %d=%lx(%d)\n",i,r,r?r->howto->type:-1));
- +
- + sym_p=*(r->sym_ptr_ptr); /* The symbol for this section */
- +
- + insection=sym_p->section;
- +
- + DPRINT(5,("Sec for reloc is %lx(%s)\n",insection,insection->name));
- + DPRINT(5,("Symbol for this reloc is %lx(%s)\n",sym_p, sym_p->name));
- + /* Is reloc relative to a special section ? */
- + if ((insection==bfd_abs_section_ptr)||(insection==bfd_com_section_ptr)||
- + (insection==bfd_und_section_ptr)||(insection==bfd_ind_section_ptr))
- + continue; /* Nothing to do, since this translates to HUNK_EXT */
- +
- + r->addend+=sym_p->value; /* Add offset of symbol from section start */
- + /* Address of reloc has been unchanged since original reloc, or has been adjusted by
- + get_relocated_section_contents */
- + /* For relocs, the vma of the target section is in the data, the addend is
- + -vma of that section =>No need to add vma*/
- + /* Add in offset */
- + r->addend+=insection->output_offset;
- + osection=insection->output_section; /* target section */
- +
- + /* Determine which hunk to write, and index of target */
- + reloc_data[5*reloc_count+1]=1; /* 1 reloc ==> Waste of space */
- + for (j=0,sec=abfd->sections;sec!=NULL;sec=sec->next,j++)
- + {
- + if (sec==osection)
- + break;
- + }
- +
- + BFD_ASSERT(sec!=NULL);
- +
- + if (j>max_hunk) /* Maximum number used */
- + max_hunk=j;
- +
- + reloc_data[5*reloc_count+2]=j;
- + reloc_data[5*reloc_count+3]=r->address;
- + reloc_data[5*reloc_count+4]=0;
- +
- + switch(r->howto->type) /* FIXME: Is this sufficient to distinguish them ?*/
- + {
- + /* AMIGA specific */
- + case HUNK_RELOC8:
- + case HUNK_RELOC16:
- + case HUNK_RELOC32:
- + case HUNK_DREL8:
- + case HUNK_DREL16:
- + case HUNK_DREL32:
- + reloc_data[5*reloc_count+1]=r->howto->type;
- + if (r->howto->type>=HUNK_DREL32)
- + {
- + size=2-(r->howto->type-HUNK_DREL32);
- + reloc_counts[3+r->howto->type-HUNK_DREL32]++;
- + }
- + else
- + {
- + size=2-(r->howto->type-HUNK_RELOC32); /* 0:8bit, 1:16bit, 2:32 bit */
- + reloc_counts[r->howto->type-HUNK_RELOC32]++;
- + }
- +
- + break;
- +
- + /* Now, these may occur, if a.out was used as input */
- + case 0: /* 8 bit ref */
- + reloc_data[5*reloc_count]=HUNK_RELOC8;
- + reloc_counts[2]++;
- + size=0;
- + break;
- + case 1: /* 16 bit relative */
- + reloc_data[5*reloc_count]=HUNK_RELOC16;
- + reloc_counts[1]++;
- + size=1;
- + break;
- + case 2: /* 32 bit relative */
- + reloc_data[5*reloc_count]=HUNK_RELOC32;
- + reloc_counts[0]++;
- + size=2;
- + break;
- +
- + case 9: /* 16 bit base rel */
- + reloc_data[5*reloc_count+1]=HUNK_DREL16;
- + reloc_counts[4]++;
- + size=1;
- + break;
- +
- + case 10: /* 32 bit baserel */
- + reloc_data[5*reloc_count+1]=HUNK_DREL32;
- + reloc_counts[3]++;
- + size=2;
- + break;
- +
- + /* FIXME: There are other (pc relative) displacements left */
- + default: /* Error, can't represent this */
- + bfd_set_error(bfd_error_nonrepresentable_section);
- + free((void *)reloc_data);
- + return false;
- + break;
- + }/* Of switch */
- +
- + section->orelocation[i]=NULL;
- +
- + c_p=((char*)(section->contents))+r->address;
- + DPRINT(5,("reloc address=%lx,addend=%lx\n",r->address,r->addend));
- +
- + /* There is no error checking with these.. */
- + values=(unsigned char *)c_p;
- + switch (size)
- + {
- + case 0: /* adjust byte */
- + j=(int)(*c_p);
- + DPRINT(5,("content(b):%x\n",j));
- + j+=r->addend;
- + *c_p=(signed char)j;
- + break;
- + case 1: /* Adjust word */
- + k=values[0]|(values[1]<<8);
- + j=(int)k;
- + DPRINT(5,("content(w):%x\n",j));
- + j+=r->addend;
- + values[0]=j&0xff;
- + values[1]=(j&0xff00)>>8;
- + break;
- + case 2: /* adjust long */
- + k=values[3]|(values[2]<<8)|(values[1]<<16)|(values[0]<<24);
- + j=k;
- + DPRINT(5,("content(l):%x\n",j));
- + DPRINT(5,("[3,2,1,0]=%x,%x,%x,%x\n",values[3],values[2],values[1],values[0]));
- + j+=r->addend;
- + values[3]=j&0xff;
- + values[2]=(j&0xff00)>>8;
- + values[1]=(j&0xff0000)>>16;
- + values[0]=(j&0xff000000)>>24;
- + break;
- + }/* of switch */
- + r->addend=0;
- + DPRINT(5,("Did adjusting\n"));
- +
- + reloc_count++;
- + }/* of for i */
- +
- + DPRINT(5,("Did all relocs\n"));
- +
- + /* We applied all the relocs, as far as possible to obtain 0 addend fields */
- + /* Write the section contents */
- + if(bfd_write((PTR)(section->contents),sizeof(char),section->_raw_size,abfd)!=section->_raw_size)
- + return false;
- +
- + DPRINT(10,("Wrote contents, writing relocs now\n"));
- +
- + /* We gathered all the relocs, now compactify them */
- + if (!reloc_count) /* No reloc found ==> We are done */
- + {
- + free((void *)reloc_data);
- + return true;
- + }
- +
- + /* There are some relocs.... */
- + /* Get mem for output array */
- + if ((reloc_out=(unsigned long *)malloc(5*sizeof(unsigned long)*reloc_count))==NULL)
- + {
- + bfd_set_error(bfd_error_no_memory);
- + free((void *)reloc_data);
- + return false;
- + }
- +
- + /* Sample every reloc type */
- + for (i=0,out_size=0;i<6;i++)
- + if (reloc_counts[i]!=0) /* there are some relocs of these */
- + {
- + int k,num;
- +
- + reloc_out[out_size++]=reloc_types[i];
- + /* sample all of these, for every hunk */
- + for (j=0;j<=max_hunk;j++) /* For every hunk */
- + { /* Walk through reloc_data, */
- + num=0; /* # relocs to hunk j */
- + for (k=0;k<reloc_count;k++)
- + if (reloc_data[5*k+2]==j) /* Reloc to this hunk */
- + {
- + if (!(num++)) /* one more and was first one */
- + {
- + reloc_out[out_size+1]=j; /* write hunk number */
- + }
- + reloc_out[out_size+1+num]=reloc_data[5*k+3]; /* offset */
- + }
- + if (num) /* There was at least one ref to this hunk */
- + {
- + reloc_out[out_size]=num; /* number of refs */
- + out_size+=2+num; /* adjust */
- + }
- + } /* sampled all hunks */
- + reloc_out[out_size++]=0; /* End of this reloc type */
- + }/* Of if there is one reloc */
- +
- +
- + DPRINT(10,("Sampled relocs, write them now\n"));
- +
- + /* Write out the relocs */
- +
- + if (bfd_write((PTR)reloc_out,sizeof(unsigned long),out_size,abfd)!=sizeof(unsigned long)*out_size)
- + {
- + free((void *)reloc_out);
- + free((void *)reloc_data);
- + return (false);
- + }
- +
- + free ((void *)reloc_out);
- + free ((void *)reloc_data);
- +
- + DPRINT(5,("Leaving write_section...\n"));
- +
- + return true;
- +
- + }
- +
- +
- + /* Write out symbol information, including HUNK_EXT, DEFS, ABS */
- + /* In the case, we were linking base relative, the symbols of the .bss hunk have been converted already
- + to belong to the .data hunk */
- + static boolean amiga_write_symbols(bfd *abfd, asection *section)
- + {
- +
- + int i,j;
- + struct reloc_cache_entry *r;
- + asection *osection;
- + asymbol *sym_p;
- + char b[3]="\0\0\0";
- + unsigned long n[3];
- + int symbol_count;
- + unsigned int symbol_header;
- + unsigned long type;
- + int len;
- +
- + /* If base rel linking and section is .bss ==> exit */
- + if (amiga_base_relative && (strcmp(section->name,".bss")==0))
- + return true;
- +
- + if (section->reloc_count==0 && abfd->symcount==0)
- + {/* Write HUNK_END */
- + alldone:
- + DPRINT(5,("Leaving write_symbols\n"));
- + n[0]=HUNK_END;
- + return(bfd_write((PTR)n,sizeof(unsigned long),1,abfd)==sizeof(unsigned long));
- + }
- +
- + symbol_count=0;
- + symbol_header=HUNK_EXT;
- +
- + /* If this is Loadfile, then do not write HUNK_EXT, but rather HUNK_SYMB*/
- +
- + /* Write out all the symbol definitions, then HUNK_END
- +
- + Now, first traverse the relocs, all entries that are non NULL
- + have to be taken into account */
- + /* Determine the type of HUNK_EXT to issue and build a single HUNK_EXT subtype */
- +
- +
- + /*FIXME: We write out many HUNK_EXT's entries for references to the same symbol.. */
- + for (i=0;i<section->reloc_count;i++)
- + {
- + r=section->orelocation[i];
- +
- + if (r==NULL) /* Empty entry */
- + continue;
- +
- + sym_p=*(r->sym_ptr_ptr); /* The symbol for this section */
- +
- + osection=sym_p->section; /* The section the symbol belongs to */
- + /* this section MUST be a special section */
- +
- + DPRINT(5,("Symbol is %s, section is %lx(%s)\n",sym_p->name,osection,osection->name));
- +
- + if (osection!=bfd_com_section_ptr) /* Not common symbol */
- + {
- + DPRINT(5,("Non common ref\n"));
- + /* Add a reference to this HUNK */
- + if ((symbol_count++)==0) /* First write out the HUNK_EXT */
- + {
- + j=HUNK_EXT;
- + if(bfd_write((PTR)(&j),sizeof(int),1,abfd)!=sizeof(int))
- + return false;
- + }
- +
- + /* Determine type of ref */
- + switch(r->howto->type) /* FIXME: Is this sufficient to distinguish them ?*/
- + {
- + /* AMIGA specific */
- + case 0:
- + case HUNK_RELOC8:
- + type=EXT_REF8;
- + break;
- +
- + case 1:
- + case HUNK_RELOC16:
- + type=EXT_REF16;
- + break;
- +
- + case 2:
- + case HUNK_RELOC32:
- + type=EXT_REF32;
- + break;
- + case HUNK_DREL8:
- + type=EXT_DEXT8;
- + break;
- +
- + case 9:
- + case HUNK_DREL16:
- + type=EXT_DEXT16;
- + break;
- +
- + case 10:
- + case HUNK_DREL32:
- + type=EXT_DEXT32;
- + break;
- +
- + /* FIXME: There are other (pc relative) displacements left */
- + default: /* Error, can't represent this */
- + bfd_set_error(bfd_error_nonrepresentable_section);
- + return false;
- + break;
- + }/* Of switch */
- + DPRINT(5,("Type is %x\n",type));
- +
- + type<<=24;
- + type&=0xff000000;
- +
- + j=strlen(sym_p->name);
- + len=(j+3)>>2; /* LW Len of name */
- +
- + type|=(len & 0xffffff);
- + if (bfd_write((PTR)(&type),sizeof(unsigned long),1,abfd)!=sizeof(unsigned long))
- + return false;
- +
- + if (bfd_write((PTR)(sym_p->name),sizeof(char),j,abfd)!=j)
- + return false;
- +
- + if ((len<<2)-j!=0) /* Pad name */
- + if (bfd_write((PTR)(b),sizeof(char),(len<<2)-j,abfd)!=((len<<2)-j))
- + return false;
- +
- + n[0]=1; /* 1 ref at address... */
- + n[1]=r->address;
- +
- + if (bfd_write((PTR)(n),sizeof(unsigned long),2,abfd)!=2*sizeof(long))
- + return false;
- +
- + continue; /* Next relocation */
- + }/* Of is ref to undefined or abs symbol */
- +
- +
- + if (osection==bfd_com_section_ptr) /* ref to common symbol */
- + {
- + DPRINT(5,("Common ref\n"));
- +
- + /* If the reference is NOT 32 bit wide absolute , then issue warning */
- + if ((r->howto->type!=2)&&(r->howto->type!=HUNK_RELOC32))
- + fprintf(stderr,"Warning: Non 32 bit wide reference to common symbol %s\n",
- + sym_p->name);
- +
- + if ((symbol_count++)==0) /* First write out the HUNK_EXT */
- + {
- + j=HUNK_EXT;
- + if(bfd_write((PTR)(&j),sizeof(int),1,abfd)!=sizeof(int))
- + return false;
- + }
- +
- + type=(EXT_COMMON<<24)&0xff000000;
- +
- + j=strlen(sym_p->name);
- +
- + len=(j+3)>>2;
- + type|=(len&0xffffff);
- +
- + if (bfd_write((PTR)(&type),sizeof(unsigned long),1,abfd)!=sizeof(unsigned long))
- + return false;
- + if (bfd_write((PTR)(sym_p->name),sizeof(char),j,abfd)!=j)
- + return false;
- +
- + if ((len<<2)-j!=0) /* Pad name */
- + if (bfd_write((PTR)(b),sizeof(char),(len<<2)-j,abfd)!=((len<<2)-j))
- + return false;
- + n[0]=sym_p->value; /* Size of common block */
- + n[1]=1;
- + n[2]=r->address;
- +
- + if (bfd_write((PTR)(n),sizeof(unsigned long),3,abfd)!=3*sizeof(long))
- + return false;
- +
- + continue;
- + }/* Of is common section */
- +
- + DPRINT(10,("Failing...\n"));
- + BFD_FAIL();
- + }/* Of traverse relocs */
- +
- +
- + /* Now traverse the symbol table and write out all definitions, that are relative
- + to this hunk */
- + /* Absolute defs are always only written out with the first hunk */
- + /* Don't write out COMMON symbols
- + local symbols
- + undefined symbols
- + indirect symbols
- + warning symbols
- + debugging symbols
- + warning symbols
- + constructor symbols, since they are unrepresentable in HUNK format..*/
- +
- + DPRINT(10,("Traversing symbol table\n"));
- + symbol_header=(AMIGA_DATA(abfd)->IsLoadFile)?HUNK_SYMBOL:HUNK_EXT;
- + for (i=0;i<abfd->symcount;i++)
- + {
- + sym_p=abfd->outsymbols[i];
- + osection=sym_p->section;
- +
- + DPRINT(5,("%d. symbol(%s), osec=%x(%s)\n",i,sym_p->name,osection,osection->name));
- +
- + if ((osection==bfd_und_section_ptr)||(osection==bfd_com_section_ptr)||
- + (osection==bfd_ind_section_ptr))
- + continue; /* Don't write these */
- +
- + /* Only write abs defs, if not writing A Loadfile */
- + if ((osection==bfd_abs_section_ptr)&&(section->index==0)&&!AMIGA_DATA(abfd)->IsLoadFile) /* Write out abs defs */
- + {
- + DPRINT(5,("Abs symbol\n"));
- + if ((symbol_count++)==0) /* First write out the HUNK_EXT */
- + {
- + if(bfd_write((PTR)(&symbol_header),sizeof(int),1,abfd)!=sizeof(int))
- + return false;
- + }
- + type=(EXT_ABS<<24)&0xff000000;
- +
- + j=strlen(sym_p->name);
- +
- + len=(j+3)>>2;
- +
- + type|=(len & 0xffffff);
- +
- + if (bfd_write((PTR)(&type),sizeof(unsigned long),1,abfd)!=sizeof(unsigned long))
- + return false;
- + if (bfd_write((PTR)(sym_p->name),sizeof(char),j,abfd)!=j)
- + return false;
- +
- + if ((len<<2)-j!=0) /* Pad name */
- + if (bfd_write((PTR)(b),sizeof(char),(len<<2)-j,abfd)!=((len<<2)-j))
- + return false;
- +
- + n[0]=sym_p->value;
- + if (bfd_write((PTR)n,sizeof(unsigned long),1,abfd)!=sizeof(unsigned long))
- + return false;
- + continue;
- + }/* Of abs def */
- + if (osection==bfd_abs_section_ptr) /* Not first hunk. Already written */
- + continue;
- +
- + /* If it is a warning symbol, or a constructor symbol or a debugging or a local symbol,
- + don't write it */
- + if (sym_p->flags & (BSF_WARNING|BSF_CONSTRUCTOR|BSF_DEBUGGING|BSF_LOCAL))
- + continue;
- +
- + /* Now, if osection==section, write it out */
- + if (osection->output_section==section)
- + {
- + DPRINT(5,("Writing it out\n"));
- +
- + if ((symbol_count++)==0) /* First write out the header */
- + {
- + if(bfd_write((PTR)(&symbol_header),sizeof(int),1,abfd)!=sizeof(int))
- + return false;
- + }
- + type=((symbol_header==HUNK_EXT?EXT_DEF:0)<<24)&0xff000000;
- +
- + j=strlen(sym_p->name);
- +
- + len=(j+3)>>2;
- +
- + type|=(len & 0xffffff);
- +
- + if (bfd_write((PTR)(&type),sizeof(unsigned long),1,abfd)!=sizeof(unsigned long))
- + return false;
- + if (bfd_write((PTR)(sym_p->name),sizeof(char),j,abfd)!=j)
- + return false;
- +
- + if ((len<<2)-j!=0) /* Pad name */
- + if (bfd_write((PTR)(b),sizeof(char),(len<<2)-j,abfd)!=((len<<2)-j))
- + return false;
- +
- + n[0]=sym_p->value+sym_p->section->output_offset;
- + if (bfd_write((PTR)n,sizeof(unsigned long),1,abfd)!=sizeof(unsigned long))
- + return false;
- + }/* Of this section */
- + }/* Of for */
- +
- + DPRINT(10,("Did traversing\n"));
- + if (symbol_count) /* terminate HUNK_EXT, HUNK_SYMBOL */
- + {
- + n[0]=0;
- + if (bfd_write((PTR)n,sizeof(unsigned long),1,abfd)!=sizeof(unsigned long))
- + return false;
- + }
- + DPRINT(5,("Leaving\n"));
- + goto alldone; /* Write HUNK_END, return */
- +
- + }
- +
- +
- + static boolean
- + amiga_get_section_contents (abfd, section, location, offset, count)
- + bfd *abfd;
- + sec_ptr section;
- + PTR location;
- + file_ptr offset;
- + bfd_size_type count;
- + {
- + memmove ((void *) location,
- + (void *) (((int) AMIGA_DATA(abfd)->first_byte)
- + + (int) section->filepos
- + + (int) offset),
- + count);
- + return true;
- + }
- +
- + boolean
- + amiga_new_section_hook (abfd, newsect)
- + bfd *abfd;
- + asection *newsect;
- + {
- + newsect->used_by_bfd = (PTR) bfd_zalloc (abfd, sizeof (amiga_per_section_type));
- + newsect->alignment_power = 2;
- + amiga_per_section(newsect)->reloc_tail = NULL;
- + return true;
- + }
- +
- +
- + /* This reads the symbol table, by following various pointers,
- + set up by amiga_digest_file */
- + static boolean
- + amiga_slurp_symbol_table (abfd)
- + bfd *abfd;
- + {
- + /* slurp in symbols, associated with this bfd */
- + amiga_data_type *amiga_data=AMIGA_DATA(abfd);
- + asection *section;
- + struct amiga_raw_symbol *sp;
- + amiga_symbol_type *asp=NULL;
- + unsigned long *lp;
- + int len;
- + int type;
- +
- + if (amiga_data->symbols)
- + return true; /* already read */
- +
- + /* Symbols are associated with every section */
- + for (section=abfd->sections;section!=NULL;section=section->next)
- + {
- + for (sp=amiga_per_section(section)->first;sp!=NULL;sp=sp->next)
- + {
- + lp=&(sp->data[0]);
- + while (*lp)
- + {
- + type =(*lp)>>24; /* type of entry */
- + len=(*lp++)&0xffffff; /* namelength */
- +
- + switch(type)
- + {
- + case EXT_COMMON: /* Common reference/definition*/
- + case EXT_ABS: /* Absolute */
- + case EXT_DEF: /* Relative Definition */
- + case EXT_SYMB: /* Same as EXT_DEF for load files */
- + /* Add symbol to section.... */
- + /* We don't have to increase symcount, this has already been done */
- +
- + asp=(amiga_symbol_type *)bfd_zalloc(abfd,sizeof(amiga_symbol_type));
- + if (!asp) /* No mem */
- + {
- + bfd_set_error(bfd_error_no_memory);
- + return(false);
- + }
- +
- + /* Add symbol to list of all symbols */
- + asp->next=NULL;
- + if (!amiga_data->symbols) /* first one */
- + {
- + amiga_data->symbols=amiga_data->symbol_tail=asp;
- + }
- + else
- + {
- + amiga_data->symbol_tail->next=asp;
- + amiga_data->symbol_tail=asp;
- + }
- +
- + asp->symbol.section=((type==EXT_DEF)||(type==EXT_SYMB))?section:(type==EXT_COMMON)?
- + bfd_com_section_ptr:bfd_abs_section_ptr;
- + asp->symbol.flags=BSF_GLOBAL;
- + asp->symbol.value=lp[len];
- + asp->symbol.the_bfd=abfd;
- + asp->type=type;
- + asp->hunk_number=((type==EXT_DEF)||(type==EXT_SYMB))?section->target_index:
- + (type==EXT_ABS)?-1:-3;
- + if ((asp->symbol.name=bfd_alloc(abfd,(len<<2)+1))==NULL)
- + {
- + bfd_set_error(bfd_error_no_memory);
- + return(false);
- + }
- + strncpy((char *)(asp->symbol.name),(char *)lp,len<<2);
- + ((char*)(asp->symbol.name))[(len<<2)]='\0';
- +
- + /* Now store the symbol in the first name longword */
- + *lp=(unsigned long)asp;
- +
- + lp+=len+1;
- +
- + if (type==EXT_COMMON) /* skip refs */
- + lp+=(*lp)+1;
- +
- + break;
- +
- + default: /* References to an undefined symbol */
- + /* Problem is that this symbol may be defined in another hunk WITHIN this bfd */
- + /* To avoid conflicts with bfd, we simply scan through the list of already defined symbols
- + and add a symbol only, if we did not find it */
- +
- + for (asp=amiga_data->symbols;asp!=NULL;asp=asp->next)
- + {
- + if (strncmp((char *)lp,asp->symbol.name,len<<2)==0)
- + break; /* Found symbol */
- + }
- +
- + if (asp==NULL) /* Symbol not defined */
- + {
- + asp=(amiga_symbol_type *)bfd_zalloc(abfd,sizeof(amiga_symbol_type));
- + if (!asp) /* No mem */
- + {
- + bfd_set_error(bfd_error_no_memory);
- + return(false);
- + }
- +
- + /* Add symbol to list of all symbols */
- + asp->next=NULL;
- + if (!amiga_data->symbols) /* first one */
- + {
- + amiga_data->symbols=amiga_data->symbol_tail=asp;
- + }
- + else
- + {
- + amiga_data->symbol_tail->next=asp;
- + amiga_data->symbol_tail=asp;
- + }
- + if ((asp->symbol.name=bfd_alloc(abfd,(len<<2)+1))==NULL)
- + {
- + bfd_set_error(bfd_error_no_memory);
- + return(false);
- + }
- + strncpy((char *)(asp->symbol.name),(const char *)lp,len<<2);
- + ((char *)(asp->symbol.name))[(len<<2)]='\0';
- +
- + asp->symbol.section=bfd_und_section_ptr;
- + asp->symbol.flags=0;
- + asp->symbol.the_bfd=abfd;
- + asp->hunk_number=-2;
- + asp->type=type;
- + abfd->symcount++;
- +
- + }
- +
- + /* Store symbol in 1st LW of name */
- + *lp=(unsigned long)asp;
- + lp+=len;
- + lp+=1+(*lp); /* skip refs */
- + break;
- + }/* Of switch type */
- + }/* Of while *lp */
- + }/* of for sp */
- + }/* Of for section */
- +
- +
- + return true;
- + }
- +
- +
- + /* Get size of symtab */
- + long
- + amiga_get_symtab_upper_bound (abfd)
- + bfd *abfd;
- + {
- + /* We read in the symbol table first */
- + if (!amiga_slurp_symbol_table (abfd))
- + return -1;
- +
- + return (abfd->symcount != 0) ?
- + (abfd->symcount+1) * (sizeof (amiga_symbol_type *)) : 0;
- + }
- +
- + long
- + amiga_get_symtab (abfd, location)
- + bfd *abfd;
- + asymbol **location;
- + {
- + amiga_symbol_type *symp;
- +
- + if(!amiga_slurp_symbol_table(abfd))
- + return -1;
- +
- + if (abfd->symcount)
- + {
- + int i = 0;
- +
- + for (symp = AMIGA_DATA(abfd)->symbols;
- + symp != (amiga_symbol_type *) NULL;
- + symp = symp->next)
- + {
- + location[i++] = &symp->symbol;
- + }
- + }
- + return abfd->symcount;
- + }
- +
- + asymbol *
- + amiga_make_empty_symbol (abfd)
- + bfd *abfd;
- + {
- + amiga_symbol_type *new =
- + (amiga_symbol_type *) bfd_zalloc (abfd, sizeof (amiga_symbol_type));
- + new->symbol.the_bfd = abfd;
- + return &new->symbol;
- + }
- +
- +
- +
- + void
- + amiga_get_symbol_info (ignore_abfd, symbol, ret)
- + bfd *ignore_abfd;
- + asymbol *symbol;
- + symbol_info *ret;
- + {
- + bfd_symbol_info (symbol, ret);
- + if (symbol->name[0] == ' ')
- + ret->name = "* empty table entry ";
- + if (symbol->section==bfd_abs_section_ptr)
- + ret->type = (symbol->flags & BSF_LOCAL) ? 'a' : 'A';
- + }
- +
- +
- +
- + void
- + amiga_print_symbol (ignore_abfd, afile, symbol, how)
- + bfd *ignore_abfd;
- + PTR afile;
- + asymbol *symbol;
- + bfd_print_symbol_type how;
- + {
- + FILE *file = (FILE *)afile;
- +
- + switch (how) {
- + case bfd_print_symbol_name:
- + fprintf(file, "%s", symbol->name);
- + break;
- + case bfd_print_symbol_more:
- + fprintf(stderr,"%4x %2x %2x",
- + (unsigned int)((amiga_symbol(symbol)->hunk_number)&0xffff),0,amiga_symbol(symbol)->type);
- + break;
- + case bfd_print_symbol_all:
- + {
- + CONST char *section_name = symbol->section->name;
- + if (symbol->name[0] == ' ')
- + {
- + fprintf(file, "* empty table entry ");
- + }
- + else
- + {
- + bfd_print_symbol_vandf ((PTR)file, symbol);
- +
- + fprintf(file," %-5s %04x %02x %s",
- + section_name,
- + (unsigned int)((amiga_symbol(symbol)->hunk_number)&0xffff), /* ->desc */
- + (unsigned) 0, /* ->other */
- + /* type */
- + symbol->name); /* ->name */
- + }
- + }
- + break;
- + }
- + }
- +
- + long
- + amiga_get_reloc_upper_bound (abfd, asect)
- + bfd *abfd;
- + sec_ptr asect;
- + {
- + if (bfd_get_format (abfd) != bfd_object)
- + {
- + bfd_set_error(bfd_error_invalid_operation);
- + return 0;
- + }
- + return sizeof (arelent *) * (asect->reloc_count + 1);
- + }
- +
- +
- + /* slurp in relocs , amiga_digest_file left various pointers for us*/
- + static boolean
- + amiga_slurp_relocs(bfd *abfd, sec_ptr section, asymbol **symbols)
- + {
- + struct amiga_raw_symbol *sp;
- + amiga_symbol_type *asp;
- + long *lp;
- +
- + int i,n,br,j;
- + int index;
- + long hunk_number;
- + int type;
- +
- + /* First browse through raw_relocs */
- + for (i=0;i<amiga_per_section(section)->num_raw_relocs;i++)
- + {
- + lp=amiga_per_section(section)->raw_relocs[i];
- +
- + /* lp points to RELOC ID */
- + /* first determine type of reloc */
- + switch (*lp)
- + {
- + case HUNK_RELOC32: /* 32 bit ref */
- + case HUNK_RELOC16: /* 16 bit ref */
- + case HUNK_RELOC8: /* 8 bit ref */
- + case HUNK_DREL32: /* 32 bit ref baserel */
- + case HUNK_DREL16: /* 16 bit baserel */
- + case HUNK_DREL8: /* 8 bit baserel */
- + if (*lp<HUNK_DREL32)
- + { /*0:8bit, 1: 16bit, 2:32bit */
- + index=2-((*lp)-HUNK_RELOC32);
- + br=0; /* not base relative */
- + }
- + else
- + {
- + index=2-((*lp)-HUNK_DREL32);
- + br=1; /* base relative */
- + }
- +
- + lp++;
- + while ((n=*lp++)) /* read offsets and hunk number */
- + {
- + hunk_number=(long)(*lp++);
- + for (j=0;j<n;j++)
- + { /* add relocs */
- +
- + if (!amiga_add_reloc(abfd,section,lp[j],NULL,
- + amiga_howto_array[br][index],hunk_number))
- + return false;
- + }/* of for */
- + lp+=n;
- + }/* of while */
- + break;
- +
- + default: /* error */
- + bfd_set_error(bfd_error_wrong_format);
- + return (false);
- + break;
- + }/* of switch */
- +
- + }/* of for i */
- +
- +
- + /* Now step through the raw_symbols and add all relocs in them */
- + for (sp=amiga_per_section(section)->first;sp!=NULL;sp=sp->next)
- + {
- + lp=&(sp->data[0]);
- + /* points to id */
- +
- + while (*lp) /* until end is reached */
- + {
- + type=((*lp)>>24)&0xff;
- + n=(*lp++)&0xffffff;
- +
- + /* lp points to symbol pointer (former 1st LW of name )*/
- + asp=(amiga_symbol_type *)(*lp);
- +
- + switch (type)
- + {
- + case EXT_SYMB:
- + case EXT_DEF:
- + case EXT_ABS: /* no relocs here, just advance the pointer */
- + lp+=1+n;
- + break;
- +
- + case EXT_COMMON: /* same as below, but advance lp by one to skip common size */
- + lp++;
- + /* Fall through */
- + default: /* reference to something */
- + /* skip name first */
- + lp+=n;
- +
- + /* points to num of refs to hunk */
- + n=*lp++;
- +
- + for (i=0;i<n;i++) /* refs follow */
- + {
- + /* Add relocs to this section, relative to asp, offset is lp[i] */
- + /* determine howto first */
- + if (type==EXT_COMMON) /* 32 bit ref */
- + {
- + index=2;
- + br=0;
- + }
- + else
- + {
- + if (type>EXT_REF32)
- + type--; /* skip EXT_COMMON gap */
- +
- + type-=EXT_REF32;
- + br=0;
- +
- + if (type>2) /* base relative */
- + {
- + type-=3;
- + br=1;
- + }
- + index=2-type;
- + }/* of else */
- +
- + if (!amiga_add_reloc(abfd,section,lp[i],asp,amiga_howto_array[br][index],-4))
- + return false;
- + }
- +
- + lp+=n;
- +
- + break;
- + }/* of switch */
- + }/* of while *lp */
- + }/* Of for sp*/
- +
- + return true;
- +
- + }/* Of slurp_relocs */
- +
- +
- + long
- + amiga_canonicalize_reloc (abfd, section, relptr, symbols)
- + bfd *abfd;
- + sec_ptr section;
- + arelent **relptr;
- + asymbol **symbols;
- + {
- +
- + amiga_reloc_type *src = NULL;
- +
- + if (!amiga_slurp_relocs(abfd,section,symbols))
- + return -1;
- +
- + src=(amiga_reloc_type *)section->relocation;
- + while (src != (amiga_reloc_type *) 0)
- + {
- + *relptr++ = &src->relent;
- + src = src->next;
- + }
- + *relptr = (arelent *) 0;
- +
- + return section->reloc_count;
- + }
- +
- +
- + /* Set section contents */
- + /* We do it the following way:
- + if this is a bss setion ==> error
- + otherwise, we try to allocate space for this section,
- + if this has not already been done
- + Then we set the memory area to the contents */
- + static boolean
- + amiga_set_section_contents (abfd, section, location, offset, count)
- + bfd *abfd;
- + sec_ptr section;
- + unsigned char *location;
- + file_ptr offset;
- + int count;
- + {
- + unsigned char *contents;
- +
- + if ((section->flags&SEC_HAS_CONTENTS)==0) /* BSS */
- + {
- + bfd_set_error(bfd_error_invalid_operation);
- + return false;
- + }
- +
- + if ((section->flags&SEC_IN_MEMORY)==0) /* Not in memory, so alloc space */
- + {
- + contents=bfd_zalloc(abfd,section->_raw_size);
- + if (!contents)
- + {
- + bfd_set_error(bfd_error_no_memory);
- + return false;
- + }
- +
- + DPRINT(5,("Allocated %lx bytes at %lx\n",section->_raw_size,contents));
- +
- + section->contents=contents;
- + section->flags|=SEC_IN_MEMORY;
- + }
- + else /* In memory */
- + contents=section->contents;
- +
- + /* Copy mem */
- + memmove(contents+offset,location,count);
- +
- + return(true);
- +
- + }/* Of section_set_contents */
- +
- +
- + /* FIXME: Is this everything ? */
- + static boolean
- + amiga_set_arch_mach (abfd, arch, machine)
- + bfd *abfd;
- + enum bfd_architecture arch;
- + unsigned long machine;
- + {
- + bfd_default_set_arch_mach(abfd, arch, machine);
- +
- + if (arch == bfd_arch_m68k)
- + {
- + switch (machine)
- + {
- + case 68000:
- + case 68008:
- + case 68010:
- + case 68020:
- + case 68030:
- + case 68040:
- + case 68070:
- + case 0:
- + return true;
- + default:
- + return false;
- + }
- + }
- + return false;
- + }
- +
- + static int
- + DEFUN(amiga_sizeof_headers,(ignore_abfd, ignore),
- + bfd *ignore_abfd AND
- + boolean ignore)
- + {
- + /* The amiga hunk format doesn't have headers.*/
- + return 0;
- + }
- +
- + /* Provided a BFD, a section and an offset into the section, calculate
- + and return the name of the source file and the line nearest to the
- + wanted location. */
- + boolean
- + amiga_find_nearest_line(abfd, section, symbols, offset, filename_ptr,
- + functionname_ptr, line_ptr)
- + bfd *abfd;
- + asection *section;
- + asymbol **symbols;
- + bfd_vma offset;
- + char **filename_ptr;
- + char **functionname_ptr;
- + int *line_ptr;
- + {
- + /* FIXME (see aoutx.h, for example) */
- + return false;
- + }
- +
- + static const struct reloc_howto_struct *
- + amiga_bfd_reloc_type_lookup (abfd, code)
- + bfd *abfd;
- + bfd_reloc_code_real_type code;
- + {
- + switch (code)
- + {
- + case BFD_RELOC_8_PCREL: return &howto_hunk_reloc8;
- + case BFD_RELOC_16_PCREL: return &howto_hunk_reloc16;
- + case BFD_RELOC_32_PCREL: return &howto_hunk_reloc32;
- + case BFD_RELOC_8: return &howto_hunk_drel8;
- + case BFD_RELOC_16: return &howto_hunk_drel16;
- + case BFD_RELOC_CTOR: /* FIXME - assumes 32 bits */
- + case BFD_RELOC_32: return &howto_hunk_drel32;
- + /* FIXME: Add more cases here for base relative relocs*/
- + default: return 0;
- + }
- + }
- +
- +
- + /* We don't have core files. */
- + #define amiga_core_file_failing_command _bfd_dummy_core_file_failing_command
- + #define amiga_core_file_failing_signal _bfd_dummy_core_file_failing_signal
- + #define amiga_core_file_matches_executable_p _bfd_dummy_core_file_matches_executable_p
- +
- + /* 101194: We do not use archive files, AMIGA Hunk load libs will be supported someday... ST */
- + #define amiga_openr_next_archived_file (bfd * (*)(bfd *, bfd*))bfd_nullvoidptr
- + #define amiga_generic_stat_arch_elt (int (*)(bfd *, struct stat *))_bfd_n1
- + #define amiga_slurp_armap (boolean (*)(bfd *))bfd_false
- + #define amiga_slurp_extended_name_table (boolean (*)(bfd *))bfd_false
- + #define amiga_update_armap_timestamp (boolean (*)(bfd *))bfd_false
- + #define amiga_write_armap (boolean (*)(bfd *,unsigned int, struct orl*,\
- + unsigned int,int))bfd_false
- + #define amiga_truncate_arname (void (*)(bfd *,const char *, char*))bfd_void
- + #define amiga_construct_extended_name_table (boolean (*)(bfd *,char **, bfd_size_type *,\
- + const char **))bfd_false
- +
- + #define amiga_bfd_debug_info_start bfd_void
- + #define amiga_bfd_debug_info_end bfd_void
- + #define amiga_bfd_debug_info_accumulate (PROTO(void,(*),(bfd*, struct sec *))) bfd_void
- +
- + /* NOTE: We use a special get_relocated_section_contents both in amiga AND in a.out files.
- + In addition, we use an own final_link routine, which is nearly identical to _bfd_generic_final_link */
- + extern bfd_byte *get_relocated_section_contents(bfd*, struct bfd_link_info *,
- + struct bfd_link_order *, bfd_byte *,
- + boolean, asymbol **);
- + #define amiga_bfd_get_relocated_section_contents get_relocated_section_contents
- + #define amiga_bfd_relax_section bfd_generic_relax_section
- + #define amiga_get_lineno (struct lineno_cache_entry *(*)())bfd_nullvoidptr
- + #define amiga_close_and_cleanup _bfd_generic_close_and_cleanup
- + #define amiga_bfd_make_debug_symbol \
- + (asymbol * (*)(bfd *, void *, unsigned long)) bfd_nullvoidptr
- + #define amiga_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
- + #define amiga_bfd_link_add_symbols _bfd_generic_link_add_symbols
- + extern boolean amiga_final_link(bfd *, struct bfd_link_info *);
- + #define amiga_bfd_final_link amiga_final_link
- + #define amiga_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
- + #define amiga_bfd_is_local_label bfd_generic_is_local_label
- + #define amiga_bfd_copy_private_section_data (boolean (*)(bfd *,sec_ptr,bfd *,sec_ptr))bfd_true
- + #define amiga_bfd_copy_private_bfd_data (boolean (*)(bfd *,bfd *))bfd_true
- +
- + #if defined (amiga)
- + /* So that the JUMP_TABLE() macro below can work. */
- + #undef amiga
- + #endif
- +
- + bfd_target amiga_vec =
- + {
- + "amiga", /* name */
- + bfd_target_amiga_flavour,
- + true, /* data byte order is little */
- + true, /* header byte order is little */
- + HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | WP_TEXT, /* object flags */
- + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC, /* section flags */
- + '_', /* symbol leading char */
- + ' ', /* ar_pad_char */
- + 31, /* ar_max_namelen */
- + 2, /* minimum align */
- + bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32,
- + bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
- + bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32,
- + bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
- + {
- + /* bfd_check_format */
- + _bfd_dummy_target,
- + amiga_object_p,
- + _bfd_dummy_target, /* AMIGA style like archives are not yet supported
- + archives are supported by a.out backend (ar) */
- + _bfd_dummy_target
- + },
- + {
- + /* bfd_set_format */
- + bfd_false,
- + amiga_mkobject,
- + bfd_false, /* Archives not supported yet */
- + bfd_false
- + },
- + {
- + /* bfd_write_contents */
- + bfd_false,
- + amiga_write_object_contents,
- + bfd_false, /*Archives not supported yet */
- + bfd_false
- + },
- + BFD_JUMP_TABLE_GENERIC (amiga),
- + BFD_JUMP_TABLE_COPY (amiga),
- + BFD_JUMP_TABLE_CORE (_bfd_nocore),
- + BFD_JUMP_TABLE_ARCHIVE (amiga),
- + BFD_JUMP_TABLE_SYMBOLS (amiga),
- + BFD_JUMP_TABLE_RELOCS (amiga),
- + BFD_JUMP_TABLE_WRITE (amiga),
- + BFD_JUMP_TABLE_LINK (amiga),
- + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- + (PTR) 0
- + #if 0
- + /* fixme: no longer in use? */
- + /* How applications can find out about amiga relocation types (see
- + documentation on reloc types). */
- + amiga_reloc_type_lookup
- + #endif
- + };
- +
- diff -rc --new-file binutils-2.5.2-base/bfd/amigadoslink.c binutils-2.5.2/bfd/amigadoslink.c
- *** binutils-2.5.2-base/bfd/amigadoslink.c Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/bfd/amigadoslink.c Fri Feb 10 14:29:08 1995
- ***************
- *** 0 ****
- --- 1,994 ----
- + /* BFD back-end for Commodore-Amiga AmigaDOS binaries. Linker routines.
- + Copyright (C) 1990-1994 Free Software Foundation, Inc.
- + Contributed by Stephan Thesing
- +
- + This file is part of BFD, the Binary File Descriptor library.
- +
- + This program is free software; you can redistribute it and/or modify
- + it under the terms of the GNU General Public License as published by
- + the Free Software Foundation; either version 2 of the License, or
- + (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., 675 Mass Ave, Cambridge, MA 02139, USA. */
- +
- + /*
- + INODE
- + amigalink, , implementation, amiga
- + SECTION
- + amigalink
- +
- + This is the description of the linker routines for the amiga.
- + In fact, this includes a description of the changes made to the
- + a.out code, in order to build a working linker for the Amiga.
- + @menu
- + @* alterations::
- + @end menu
- +
- + INODE
- + alterations, , , amigalink
- + SUBSECTION
- + alterations
- +
- + The file @file{aout-amiga.c} defines the amiga a.out backend. It differs from
- + the sun3 backend only in these details:
- + o The @code{final_link} routine is @code{amiga_final_link}.
- + o The routine to get the relocated section contents is
- + @code{aout_bfd_get_relocated_section_contents}.
- +
- + This ensures that the link is performed properly, but has the side effect of loosing
- + performance.
- +
- +
- + The amiga bfd code uses the same @code{amiga_final_link} routine, but with a
- + different <<get_relocated_section_contents>> entry: <<amiga_bfd_get_relocated_section_contents>>.
- + The latter differs from the routine of the a.out backend only in the application of relocs
- + to the section contents.
- + @@*
- +
- + The usage of a special linker code has one reason:
- + The bfd library assumes that a program is always loaded at a known memory
- + address. This is not a case on an Amiga. So the Amiga format has to take over
- + some relocs to an executable output file.
- + This is not the case with a.out formats, so there relocations can be applied at link time,
- + not at run time, like on the Amiga.
- + The special routines compensate this: instead of applying the relocations, they are
- + copied to the output file, if neccessary.
- + As as consequence, the @code{final_link} and @code{get_relocated_section_contents} are nearly identical to
- + the original routines from @file{linker.c} and @file{reloc.c}.
- + */
- +
- + #include "bfd.h"
- + #include "bfdlink.h"
- + #include "genlink.h"
- + #include "sysdep.h"
- + #include "libbfd.h"
- +
- + #include "libamiga.h"
- + #undef GET_SWORD
- + #define aadata ((bfd)->tdata.amiga_data->a)
- + #undef adata
- + #include "libaout.h"
- +
- +
- + #define max(x,y) (((x)<=(y))?(y):(x))
- +
- + #define DEBUG_AMIGA 10000
- +
- + #if DEBUG_AMIGA
- + #include <varargs.h>
- + static void error_print(va_alist)
- + va_dcl
- + {
- + va_list args;
- + char *fmt;
- +
- + va_start(args);
- + fmt=va_arg(args,char *);
- +
- + (void)vfprintf(stderr,fmt,args);
- + va_end(args);
- + }
- +
- + #define DPRINT(L,x) if (L>=DEBUG_AMIGA) error_print x
- + #else
- + #define DPRINT(L,x)
- + #endif
- +
- + /* This one is used to indicate base-relative (and maybe later residentable) linking */
- + int amiga_base_relative=0;
- +
- + extern boolean default_indirect_link_order
- + PARAMS ((bfd *, struct bfd_link_info *, asection *,
- + struct bfd_link_order *, boolean));
- +
- +
- +
- + bfd_byte *
- + get_relocated_section_contents(bfd *, struct bfd_link_info *,
- + struct bfd_link_order *, bfd_byte *,
- + boolean , asymbol **);
- + static bfd_reloc_status_type
- + amiga_perform_reloc(bfd *, arelent *, PTR, asection *, bfd *, char **);
- + static bfd_reloc_status_type
- + aout_perform_reloc(bfd *, arelent *, PTR, asection *, bfd *, char **);
- + static boolean
- + amiga_reloc_link_order (bfd *, struct bfd_link_info *,asection *,struct bfd_link_order *);
- +
- +
- + /* This one is nearly identical to bfd_generic_get_relocated_section_contents from reloc.c */
- + bfd_byte *
- + get_relocated_section_contents (abfd, link_info, link_order, data,
- + relocateable, symbols)
- + bfd *abfd;
- + struct bfd_link_info *link_info;
- + struct bfd_link_order *link_order;
- + bfd_byte *data;
- + boolean relocateable;
- + asymbol **symbols;
- + {
- + bfd *input_bfd = link_order->u.indirect.section->owner;
- + asection *input_section = link_order->u.indirect.section;
- +
- + long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
- + arelent **reloc_vector = NULL;
- + long reloc_count;
- + bfd_reloc_status_type (*reloc_func)(bfd *, arelent *, PTR, asection *, bfd *, char **);
- +
- + DPRINT(5,("Entering get_rel_sec_cont\n"));
- + if (reloc_size < 0)
- + goto error_return;
- +
- + if (input_bfd->xvec->flavour==bfd_target_amiga_flavour)
- + reloc_func=amiga_perform_reloc;
- + else if (input_bfd->xvec->flavour==bfd_target_aout_flavour)
- + reloc_func=aout_perform_reloc;
- + else
- + {
- + bfd_set_error(bfd_error_bad_value);
- + goto error_return;
- + }
- +
- + reloc_vector = (arelent **) malloc (reloc_size);
- + if (reloc_vector == NULL && reloc_size != 0)
- + {
- + bfd_set_error (bfd_error_no_memory);
- + goto error_return;
- + }
- +
- + DPRINT(5,("GRSC: GetSecCont()\n"));
- + /* read in the section */
- + if (!bfd_get_section_contents (input_bfd,
- + input_section,
- + (PTR) data,
- + 0,
- + input_section->_raw_size))
- + goto error_return;
- +
- + /* We're not relaxing the section, so just copy the size info */
- + input_section->_cooked_size = input_section->_raw_size;
- + input_section->reloc_done = true;
- +
- + DPRINT(5,("GRSC: CanReloc\n"));
- + reloc_count = bfd_canonicalize_reloc (input_bfd,
- + input_section,
- + reloc_vector,
- + symbols);
- + if (reloc_count < 0)
- + goto error_return;
- +
- + if (reloc_count > 0)
- + {
- + arelent **parent;
- +
- + DPRINT(5,("reloc_count=%d\n",reloc_count));
- +
- + for (parent = reloc_vector; *parent != (arelent *) NULL;
- + parent++)
- + {
- + char *error_message = (char *) NULL;
- + bfd_reloc_status_type r ;
- +
- + DPRINT(5,("Applying a reloc\nparent=%lx, reloc_vector=%lx, *parent=%lx\n",parent,reloc_vector,*parent));
- + r=(*reloc_func) (input_bfd,
- + *parent,
- + (PTR) data,
- + input_section,
- + relocateable ? abfd : (bfd *) NULL,
- + &error_message);
- +
- + if (relocateable)
- + {
- + asection *os = input_section->output_section;
- +
- + DPRINT(5,("Keeping reloc\n"));
- + /* A partial link, so keep the relocs */
- + os->orelocation[os->reloc_count] = *parent;
- + os->reloc_count++;
- + }
- +
- + if (r != bfd_reloc_ok)
- + {
- + switch (r)
- + {
- + case bfd_reloc_undefined:
- + if (!((*link_info->callbacks->undefined_symbol)
- + (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
- + input_bfd, input_section, (*parent)->address)))
- + goto error_return;
- + break;
- + case bfd_reloc_dangerous:
- + BFD_ASSERT (error_message != (char *) NULL);
- + if (!((*link_info->callbacks->reloc_dangerous)
- + (link_info, error_message, input_bfd, input_section,
- + (*parent)->address)))
- + goto error_return;
- + break;
- + case bfd_reloc_overflow:
- + if (!((*link_info->callbacks->reloc_overflow)
- + (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
- + (*parent)->howto->name, (*parent)->addend,
- + input_bfd, input_section, (*parent)->address)))
- + goto error_return;
- + break;
- + case bfd_reloc_outofrange:
- + default:
- + DPRINT(10,("get_rel_sec_cont fails, perform reloc returned $%x\n",r));
- + abort ();
- + break;
- + }
- +
- + }
- + }
- + }
- + if (reloc_vector != NULL)
- + free (reloc_vector);
- + DPRINT(5,("GRSC: Returning ok\n"));
- + return data;
- +
- + error_return:
- + DPRINT(5,("GRSC: Error_return\n"));
- + if (reloc_vector != NULL)
- + free (reloc_vector);
- + return NULL;
- + }
- +
- +
- + /* Add a value to a location */
- + static bfd_reloc_status_type
- + my_add_to(PTR data, int offset, int size, int add)
- + {
- + signed char *p;
- + int val;
- + bfd_reloc_status_type ret;
- +
- + DPRINT(5,("Entering add_value\n"));
- +
- + ret=bfd_reloc_ok;
- + p=((signed char*)data)+offset;
- +
- + switch (size)
- + {
- + case 0: /* byte size */
- + val=(int)(p[0]);
- + val+=add;
- + if ((val&0xffffff00)!=0 && (val&0xffffff00)!=0xffffff00) /* Overflow */
- + {
- + ret=bfd_reloc_overflow;
- + }
- + p[0]=val&0xff;
- + break;
- +
- + case 1: /* word size */
- + val=(int)(p[1]|(p[0]<<8));
- + val+=add;
- + if ((val&0xffff0000)!=0 && (val&0xffff0000)!=0xffff0000) /* Overflow */
- + {
- + ret=bfd_reloc_overflow;
- + }
- + p[1]=val&0xff;
- + p[0]=((val&0xff00)>>8)&0xff;
- + break;
- +
- + case 2: /* long word */
- + val=p[3]|((int)(p[2]<<8))|((int)(p[1]<<16))|((int)(p[0]<<24));
- + val=+add;
- + p[3]=val&0xff;
- + p[2]=((val&0xff00)>>8)&0xff;
- + p[1]=((val&0xff0000)>>16)&0xff;
- + p[0]=((val&0xff000000)>>24)&0xff;
- + break;
- +
- + default: /* Error */
- + ret=bfd_reloc_notsupported;
- + break;
- + }/* Of switch */
- +
- + DPRINT(5,("Leaving add_value\n"));
- + return (ret);
- + }
- +
- +
- + /* Get the value of ___a4_init */
- + static asymbol *
- + mygeta4(bfd *abfd)
- + {
- + asymbol *s;
- + int i;
- +
- + for (i=0;i<abfd->symcount;i++)
- + {
- + s=abfd->outsymbols[i];
- + if (strcmp(s->name,"___a4_init")==0)
- + return s;
- + }
- +
- + return (NULL); /* Not found */
- + }
- +
- + /* Perform an Amiga relocation */
- + static bfd_reloc_status_type
- + amiga_perform_reloc(bfd *abfd, arelent *r, PTR data, asection *sec, bfd *obfd, char **error_message)
- + {
- + asymbol *sym; /* Reloc is relative to sym */
- + asymbol *a4init; /* This symbol is used with baserelative relocs */
- + asection *target_section; /* reloc is relative to this section */
- + int relocation;
- + boolean copy;
- + bfd_reloc_status_type ret;
- + int size;
- +
- + DPRINT(5,("Entering APR\nflavour is %d (aflavour=%d, aout_flavour=%d)\n",sec->owner->xvec->flavour,
- + bfd_target_amiga_flavour, bfd_target_aout_flavour));
- +
- + /* If obfd==NULL: Apply the reloc, if possible. */
- + /* Else: Modify it and return */
- +
- + if (obfd!=NULL) /* Only modify the reloc */
- + {
- + r->address+=sec->output_offset;
- + sec->output_section->flags|=SEC_RELOC;
- + DPRINT(5,("Leaving APR, modified case \n"));
- + return bfd_reloc_ok;
- + }
- +
- + /* Try to apply the reloc */
- +
- + sym=*(r->sym_ptr_ptr);
- + target_section=sym->section;
- +
- + if (target_section==bfd_und_section_ptr) /* Error */
- + {
- + DPRINT(10,("perform_reloc: Target is undefined section\n"));
- + return bfd_reloc_undefined;
- + }
- +
- + relocation=0; copy=false; ret=bfd_reloc_ok;
- +
- + switch(r->howto->type)
- + {
- + case HUNK_RELOC32: /* 32 bit reloc */
- + DPRINT(5,("RELOC32\n"));
- + size=2;
- + if (target_section==bfd_abs_section_ptr) /* Ref to absolute hunk */
- + relocation=sym->value;
- + else if (target_section==bfd_com_section_ptr) /* ref to common */
- + {
- + relocation=0;
- + copy=true;
- + }
- + else
- + {
- + /* If we access a symbol in the .bss section, we have to convert this to an access to .data section*/
- + /* This is done through a change to the symbol... */
- + if (amiga_base_relative && (strcmp(sym->section->output_section->name,".bss")==0))
- + {
- + /* get value for .data section */
- + bfd *ibfd;
- + asection *s;
- +
- + ibfd=target_section->output_section->owner;
- + for (s=ibfd->sections;s!=NULL;s=s->next)
- + if (strcmp(s->name,".data")==0)
- + {
- + sym->section->output_offset=s->_raw_size;
- + sym->section->output_section=s;
- + }
- + }
- +
- + relocation=0;
- + copy=true;
- + }
- + break;
- +
- + case HUNK_RELOC8:
- + case HUNK_RELOC16:
- + DPRINT(5,("RELOC16/8\n"));
- + size=(r->howto->type==HUNK_RELOC8)?0:1;
- + if (target_section==bfd_abs_section_ptr) /* Ref to absolute hunk */
- + relocation=sym->value;
- + if (target_section==bfd_com_section_ptr) /* Error.. */
- + {
- + relocation=0;
- + copy=false;
- + ret=bfd_reloc_undefined;
- + }
- + else
- + {
- + DPRINT(5,("PC relative\n"));
- + /* This is a pc relative hunk... */
- + if (sec->output_section!=target_section->output_section) /* Error */
- + {
- + DPRINT(10,("pc relative, but out of range I\n"));
- + relocation=0;
- + copy =false;
- + ret=bfd_reloc_outofrange;
- + }
- + else
- + { /* Same section */
- + relocation=-(r->address+sec->output_offset);
- + copy=false;
- + }
- + }
- + break;
- +
- + case HUNK_DREL32: /* baserel relocs */
- + case HUNK_DREL16:
- + case HUNK_DREL8:
- + DPRINT(5,("HUNK_BASEREL relocs\n"));
- + /* Relocs are always relative to the symbol ___a4_init */
- + /* Relocs to .bss section are converted to a reloc to .data section, since
- + .bss section contains only COMMON sections...... and should be following .data section.. */
- +
- + size=(r->howto->type==HUNK_DREL32)?2:((r->howto->type==HUNK_DREL16)?1:0);
- +
- + if (target_section==bfd_abs_section_ptr) /* Hmmmm, this should have been baserel, but we allow
- + this */
- + {
- + fprintf(stderr,"Warning: Baserel reloc to symbol %s converted to absolut in section %s\n",
- + sym->name,sec->name);
- + relocation=sym->value;
- + }
- + else
- + {
- + /* Get value for ___a4init */
- + if ((a4init=mygeta4(target_section->output_section->owner))==NULL)
- + {
- + fprintf(stderr,"Base symbol for base relative reloc not defined, section %s, reloc to symbol"
- + "%s\n",sec->name,sym->name);
- + copy=false;
- + ret=bfd_reloc_notsupported;
- + break;
- + }
- +
- + /* If target->out is .bss, add the value of the .data section to sym->value and
- + set output_section new to .data section.... */
- + if (strcmp(target_section->output_section->name,".bss")==0)
- + {
- + bfd *ibfd;
- + asection *s;
- +
- + ibfd=target_section->output_section->owner;
- + for (s=ibfd->sections;s!=NULL;s=s->next)
- + if (strcmp(s->name,".data")==0)
- + {
- + sym->section->output_section=s;
- + sym->section->output_offset=s->_raw_size;
- + }
- + }
- +
- + relocation=sym->value+sym->section->output_offset-a4init->value+r->addend;
- +
- + copy=false;
- + }
- + break;
- +
- + default:
- + fprintf(stderr,"Error:Not supported reloc type:%d\n",r->howto->type);
- + copy=false;
- + relocation=0;
- + ret=bfd_reloc_notsupported;
- + break;
- + } /* Of switch */
- +
- + /* Add in relocation */
- + if (relocation!=0)
- + ret=my_add_to(data,r->address,2,relocation);
- +
- + if (copy)/* Copy reloc to output section */
- + {
- + DPRINT(5,("Copying reloc\n"));
- + target_section=sec->output_section;
- + r->address+=sec->output_offset;
- + target_section->orelocation[target_section->reloc_count++]=r;
- + sec->output_section->flags|=SEC_RELOC;
- + }
- + DPRINT(5,("Leaving a_perform_reloc\n"));
- + return ret;
- + }
- +
- +
- + /* Perform an a.out reloc */
- + static bfd_reloc_status_type
- + aout_perform_reloc(bfd *abfd, arelent *r, PTR data, asection *sec, bfd *obfd, char **error_message)
- + {
- + asymbol *sym; /* Reloc is relative to this */
- + asymbol *a4init;
- + asection *target_section; /* reloc is relative to this section */
- + int relocation;
- + boolean copy;
- + bfd_reloc_status_type ret;
- + int size;
- +
- + /* If obfd==NULL: Apply the reloc, if possible. */
- + /* Else: Modify it and return */
- + DPRINT(5,("Entering aout_perf_reloc\n"));
- +
- + if (obfd!=NULL) /* Only modify the reloc */
- + {
- + r->address+=sec->output_offset;
- + DPRINT(5,("Leaving aout_perf_reloc, modified\n"));
- + return bfd_reloc_ok;
- + }
- +
- + sym=*(r->sym_ptr_ptr);
- + target_section=sym->section;
- +
- + if (target_section==bfd_und_section_ptr) /* Error */
- + {
- + DPRINT(10,("target_sec=UND, aout_perf_rel\n"));
- + return bfd_reloc_undefined;
- + }
- +
- + relocation=0; copy=false; ret=bfd_reloc_ok;
- +
- + switch (r->howto->type)
- + {
- + case 0: /* 8 bit reloc, pc relative or absolut */
- + case 1: /* 16 bit reloc */
- + DPRINT(10,("16/8 bit relative\n"));
- + size=r->howto->type;
- + if (target_section==bfd_abs_section_ptr) /* Ref to absolute hunk */
- + relocation=sym->value;
- + else if (target_section==bfd_com_section_ptr) /* Error.. */
- + {
- + relocation=0;
- + copy=false;
- + ret=bfd_reloc_undefined;
- + fprintf(stderr,"Pc relative relocation to common symbol \"%s\" in section %s\n",
- + sym->name,sec->name);
- + DPRINT(10,("Ref to common symbol...aout_perf_reloc\n"));
- + }
- + else
- + {
- + /* This is a pc relative hunk... or a baserel... */
- + if (sec->output_section!=target_section->output_section) /* Error or baserel */
- + {
- + if (target_section->output_section->flags&SEC_DATA!=0) /* Baserel reloc */
- + {
- + goto baserel; /* Dirty, but no code doubling.. */
- + }/* Of is baserel */
- +
- + relocation=0;
- + copy =false;
- + ret=bfd_reloc_outofrange;
- + fprintf(stderr,"pc relative relocation out of range in section %s. Relocation was to"
- + "symbol %s\n",sec->name,sym->name);
- +
- + DPRINT(10,("Section%s, target %s: Reloc out of range...not same section, aout_perf\n"
- + "sec->out=%s, target->out=%s, offset=%lx\n",sec->name, target_section->name,
- + sec->output_section->name,target_section->output_section->name,r->address));
- + }
- + else
- + { /* Same section */
- + relocation=-(r->address+sec->output_offset);
- + copy=false;
- + DPRINT(5,("Reloc to same section...\n"));
- + }
- + }
- + break;
- + case 2: /* 32 bit reloc, abs. or relative */
- + DPRINT(10,("32 bit\n"));
- + size=2;
- + if (target_section==bfd_abs_section_ptr) /* Ref to absolute hunk */
- + relocation=sym->value;
- + else if (target_section==bfd_com_section_ptr) /* ref to common */
- + {
- + relocation=0;
- + copy=true;
- + }
- + else
- + {
- + /* If we access a symbol in the .bss section, we have to convert this to an access to .data section*/
- + /* This is done through a change to the output section of the symbol... */
- + if (amiga_base_relative && (strcmp(sym->section->output_section->name,".bss")==0))
- + {
- + /* get value for .data section */
- + bfd *ibfd;
- + asection *s;
- +
- + ibfd=target_section->output_section->owner;
- + for (s=ibfd->sections;s!=NULL;s=s->next)
- + if (strcmp(s->name,".data")==0)
- + {
- + sym->section->output_section=s;
- + sym->section->output_offset=s->_raw_size;
- + }
- + }
- + relocation=0;
- + copy=true;
- + }
- + DPRINT(10,("target->out=%s(%lx), sec->out=%s(%lx), symbol=%s\n",
- + target_section->output_section->name,
- + target_section->output_section,sec->output_section->name,
- + sec->output_section,sym->name));
- +
- + break;
- + case 9: /* 16 bit base relative */
- + case 10: /* 32 bit base relative */
- + DPRINT(10,("32/16 bit baserel\n"));
- + /* We use the symbol ___a4_init as base */
- +
- + size=r->howto->type-8;
- +
- + baserel:
- + if (target_section==bfd_abs_section_ptr) /* Hmmmm, this should have been baserel, but we allow
- + this */
- + {
- + fprintf(stderr,"Warning: Baserel reloc to symbol %s converted to absolut in section %s\n",
- + sym->name,sec->name);
- + relocation=sym->value;
- + }
- + else if (target_section==bfd_com_section_ptr) /* Error.. */
- + {
- + relocation=0;
- + copy=false;
- + ret=bfd_reloc_undefined;
- + fprintf(stderr,"Baserelative relocation to common \"%s\"\n", sym->name);
- +
- + DPRINT(10,("Ref to common symbol...aout_perf_reloc\n"));
- + }
- + else /* Target section and sec need not be the same... */
- + {
- + /* Get value for ___a4init */
- + if ((a4init=mygeta4(target_section->output_section->owner))==NULL)
- + {
- + fprintf(stderr,"Base symbol for base relative reloc not defined, section %s, reloc to symbol"
- + "%s\n",sec->name,sym->name);
- + copy=false;
- + ret=bfd_reloc_notsupported;
- + DPRINT(10,("target->out=%s(%lx), sec->out=%s(%lx), symbol=%s\n",
- + target_section->output_section->name,
- + target_section->output_section,sec->output_section->name,
- + sec->output_section,sym->name));
- +
- + break;
- + }
- +
- + /* If target->out is .bss, add the value of the .data section....to sym, set new output_section */
- + if (strcmp(target_section->output_section->name,".bss")==0)
- + {
- + bfd *ibfd;
- + asection *s;
- +
- + ibfd=target_section->output_section->owner;
- + for (s=ibfd->sections;s!=NULL;s=s->next)
- + if (strcmp(s->name,".data")==0)
- + {
- + sym->section->output_offset=s->_raw_size;
- + sym->section->output_section=s;
- + }
- + }
- +
- + relocation=sym->value+sym->section->output_offset-a4init->value+r->addend;
- + copy=false; /* Nothing to do, since write_section_contents adds output_offset.. */
- + }
- + DPRINT(10,("target->out=%s(%lx), sec->out=%s(%lx), symbol=%s\n",
- + target_section->output_section->name,
- + target_section->output_section,sec->output_section->name,
- + sec->output_section,sym->name));
- + break;
- +
- + default:
- + copy=false;
- + relocation=0;
- + ret=bfd_reloc_notsupported;
- + DPRINT(10,("Unsupported reloc:%d\n",r->howto->type));
- + break;
- +
- + }/* Of switch */
- +
- + /* Add in relocation */
- + if (relocation!=0)
- + ret=my_add_to(data,r->address,2,relocation);
- +
- + if (copy)/* Copy reloc to output section */
- + {
- + DPRINT(5,("Copying reloc\n"));
- + target_section=sec->output_section;
- + r->address+=sec->output_offset;
- + target_section->orelocation[target_section->reloc_count++]=r;
- + }
- + DPRINT(5,("Leaving aout_perf_reloc with %d (OK=%d)\n",ret,bfd_reloc_ok));
- + return ret;
- + }
- +
- +
- + /* The final link routine, used both by Amiga and a.out backend*/
- + /* This is nearly a copy of _bfd_generic_final_link */
- + boolean
- + amiga_final_link (abfd, info)
- + bfd *abfd;
- + struct bfd_link_info *info;
- + {
- + bfd *sub;
- + asection *o,*act_sec;
- + struct bfd_link_order *p;
- + size_t outsymalloc;
- + struct generic_write_global_symbol_info wginfo;
- +
- + DPRINT(5,("Entering final_link\n"));
- +
- + abfd->outsymbols = (asymbol **) NULL;
- + abfd->symcount = 0;
- + outsymalloc = 0;
- +
- + /* Build the output symbol table. */
- + for (sub = info->input_bfds; sub != (bfd *) NULL; sub = sub->link_next)
- + if (! _bfd_generic_link_output_symbols (abfd, sub, info, &outsymalloc))
- + return false;
- +
- + DPRINT(10,("Did build output symbol table\n"));
- +
- + /* Accumulate the global symbols. */
- + wginfo.info = info;
- + wginfo.output_bfd = abfd;
- + wginfo.psymalloc = &outsymalloc;
- + _bfd_generic_link_hash_traverse (_bfd_generic_hash_table (info),
- + _bfd_generic_link_write_global_symbol,
- + (PTR) &wginfo);
- +
- + DPRINT(10,("Accumulated global symbols\n"));
- +
- + DPRINT(10,("Output bfd is %s(%lx)\n",abfd->filename,abfd));
- +
- + /* Allocate space for the output relocs for each section. */
- + /* We also handle base-relative linking special, by setting the .data sections real length to
- + it's length + .bss length */
- + /* This is different to bfd_generic_final_link: We ALWAYS alloc space for the relocs,
- + because we may need it anyway */
- + for (o = abfd->sections;
- + o != (asection *) NULL;
- + o = o->next)
- + {
- + /* If section is .data, find .bss and add that length */
- + if (!info->relocateable && amiga_base_relative && (strcmp(o->name,".data")==0))
- + {
- + if (abfd->xvec->flavour!=bfd_target_amiga_flavour) /* oops */
- + {
- + fprintf(stderr,"You can't use base relative linking with partial links.\n");
- + }
- + else
- + {
- + for (act_sec=abfd->sections; act_sec!=NULL;act_sec=act_sec->next)
- + if (strcmp(act_sec->name,".bss")==0)
- + amiga_per_section(o)->real_length=o->_raw_size+act_sec->_raw_size;
- + }
- + }/* Of base-relative linking */
- +
- + DPRINT(10,("Section in output bfd is %s (%lx)\n",o->name,o));
- +
- + o->reloc_count = 0;
- + for (p = o->link_order_head;
- + p != (struct bfd_link_order *) NULL;
- + p = p->next)
- + {
- + if (p->type == bfd_section_reloc_link_order
- + || p->type == bfd_symbol_reloc_link_order)
- + ++o->reloc_count;
- + else if (p->type == bfd_indirect_link_order)
- + {
- + asection *input_section;
- + bfd *input_bfd;
- + long relsize;
- + arelent **relocs;
- + asymbol **symbols;
- + long reloc_count;
- +
- + input_section = p->u.indirect.section;
- + input_bfd = input_section->owner;
- +
- + DPRINT(10,("\tIndirect section from bfd %s, section is %s(%lx) (COM=%lx)\n",
- + input_bfd->filename,input_section->name,input_section,
- + bfd_com_section_ptr));
- +
- + relsize = bfd_get_reloc_upper_bound (input_bfd,
- + input_section);
- + if (relsize < 0)
- + {
- + DPRINT(10,("Relsize<0.I..in bfd %s, sec %s\n",input_bfd->filename,
- + input_section->name));
- + return false;
- + }
- +
- + relocs = (arelent **) malloc ((size_t) relsize);
- + if (!relocs && relsize != 0)
- + {
- + bfd_set_error (bfd_error_no_memory);
- + return false;
- + }
- + symbols = _bfd_generic_link_get_symbols (input_bfd);
- + reloc_count = bfd_canonicalize_reloc (input_bfd,
- + input_section,
- + relocs,
- + symbols);
- + if (reloc_count < 0)
- + {
- + DPRINT(10,("Relsize<0.II..in bfd %s, sec %s\n",input_bfd->filename,
- + input_section->name));
- + return false;
- + }
- +
- + BFD_ASSERT (reloc_count == input_section->reloc_count);
- + o->reloc_count += reloc_count;
- + free (relocs);
- + }
- + }
- + if (o->reloc_count > 0)
- + {
- + o->orelocation = ((arelent **)
- + bfd_alloc (abfd,
- + (o->reloc_count
- + * sizeof (arelent *))));
- + if (!o->orelocation)
- + {
- + bfd_set_error (bfd_error_no_memory);
- + return false;
- + }
- + /* o->flags |= SEC_RELOC; There may be no relocs. This can be determined only later */
- + /* Reset the count so that it can be used as an index
- + when putting in the output relocs. */
- + o->reloc_count = 0;
- + }
- + }
- +
- + DPRINT(10,("Got all relocs\n"));
- +
- + /* Handle all the link order information for the sections. */
- + for (o = abfd->sections;
- + o != (asection *) NULL;
- + o = o->next)
- + {
- + for (p = o->link_order_head;
- + p != (struct bfd_link_order *) NULL;
- + p = p->next)
- + {
- + switch (p->type)
- + {
- + case bfd_section_reloc_link_order:
- + case bfd_symbol_reloc_link_order:
- + if (! amiga_reloc_link_order (abfd, info, o, p)) /* We use an own routine */
- + return false;
- + break;
- + case bfd_indirect_link_order:
- + if (! default_indirect_link_order (abfd, info, o, p, true))
- + /* Calls our get_relocated_section_contents*/
- + return false;
- + break;
- + default:
- + if (! _bfd_default_link_order (abfd, info, o, p))
- + return false;
- + break;
- + }
- + }
- + }
- + if (abfd->xvec->flavour==bfd_target_amiga_flavour&&!info->relocateable)
- + AMIGA_DATA(abfd)->IsLoadFile=true;
- +
- + DPRINT(10,("Leaving final_link\n"));
- + return true;
- + }
- +
- +
- + /* Handle reloc link order . This is nearly a copy from gneric_reloc_link_order in linker.c*/
- + static boolean
- + amiga_reloc_link_order(bfd *abfd,struct bfd_link_info *info , asection *sec, struct bfd_link_order *link_order)
- + {
- + amiga_reloc_type *r;
- +
- + DPRINT(5,("Entering amiga_reloc_link_order\n"));
- + /* We generate a new AMIGA style reloc */
- + BFD_ASSERT(sec->orelocation!=NULL);
- +
- + if (sec->orelocation == (arelent **) NULL)
- + {
- + DPRINT(10,("aborting, since orelocation==NULL\n"));
- + abort ();
- + }
- +
- + r = (amiga_reloc_type *) bfd_zalloc (abfd, sizeof (amiga_reloc_type));
- + if (r == NULL)
- + {
- + bfd_set_error (bfd_error_no_memory);
- + DPRINT(5,("Leaving amiga_reloc_link, no mem\n"));
- + return false;
- + }
- +
- + r->relent.address = link_order->offset;
- + r->relent.howto = bfd_reloc_type_lookup (abfd, link_order->u.reloc.p->reloc);
- + if (r->relent.howto == NULL)
- + {
- + bfd_set_error (bfd_error_bad_value);
- + DPRINT(5,("Leaving amiga_reloc_link, bad value\n"));
- + return false;
- + }
- +
- + /* Get the symbol to use for the relocation. */
- + if (link_order->type == bfd_section_reloc_link_order)
- + r->relent.sym_ptr_ptr = link_order->u.reloc.p->u.section->symbol_ptr_ptr;
- + else
- + {
- + struct generic_link_hash_entry *h;
- +
- + h = _bfd_generic_link_hash_lookup (_bfd_generic_hash_table (info),
- + link_order->u.reloc.p->u.name,
- + false, false, true);
- + if (h == (struct generic_link_hash_entry *) NULL
- + || ! h->written)
- + {
- + if (! ((*info->callbacks->unattached_reloc)
- + (info, link_order->u.reloc.p->u.name,
- + (bfd *) NULL, (asection *) NULL, (bfd_vma) 0)))
- + return false;
- + bfd_set_error (bfd_error_bad_value);
- + DPRINT(5,("Leaving amiga_reloc_link, bad value in hash lookup\n"));
- + return false;
- + }
- + r->relent.sym_ptr_ptr = &h->sym;
- + }
- + DPRINT(5,("Got symbol for relocation\n"));
- + /* Store the addend */
- + r->relent.addend = link_order->u.reloc.p->addend;
- +
- +
- + /* If we are generating relocateable output, just add the reloc */
- + if (info->relocateable)
- + {
- + DPRINT(5,("Adding reloc\n"));
- + sec->orelocation[sec->reloc_count] = (arelent *)r;
- + ++sec->reloc_count;
- + sec->flags|=SEC_RELOC;
- + }
- + else
- + { /* Try to apply the reloc */
- + char *em="";
- + PTR data;
- + bfd_reloc_status_type ret;
- +
- + DPRINT(5,("Apply link_order_reloc\n"));
- + /*FIXME: Maybe, we have to get the section contents, before we use them, if they have not been
- + set by now.. */
- +
- + BFD_ASSERT(sec->contents!=NULL);
- + data=(PTR)(sec->contents);
- +
- + if (bfd_get_flavour(abfd)==bfd_target_amiga_flavour)
- + ret=amiga_perform_reloc(abfd,(arelent *)r,data,sec,NULL,&em);
- + else
- + ret=aout_perform_reloc(abfd,(arelent *)r,data,sec,NULL,&em);
- +
- + if (ret!=bfd_reloc_ok)
- + {
- + DPRINT(5,("Leaving amiga_reloc_link, value false\n"));
- + return false;
- + }
- + }
- + DPRINT(5,("Leaving amiga_reloc_link\n"));
- + return true;
- + }
- diff -rc --new-file binutils-2.5.2-base/bfd/aout-amiga.c binutils-2.5.2/bfd/aout-amiga.c
- *** binutils-2.5.2-base/bfd/aout-amiga.c Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/bfd/aout-amiga.c Fri Feb 10 14:29:10 1995
- ***************
- *** 0 ****
- --- 1,39 ----
- + /* BFD backend for Amiga style a.out with flags set to 0
- + Copyright (C) 1990, 91, 92, 93, 1994 Free Software Foundation, Inc.
- + Written by Stephan Thesing.
- +
- + This file is part of BFD, the Binary File Descriptor library.
- +
- + This program is free software; you can redistribute it and/or modify
- + it under the terms of the GNU General Public License as published by
- + the Free Software Foundation; either version 2 of the License, or
- + (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., 675 Mass Ave, Cambridge, MA 02139, USA. */
- +
- + #define TARGETNAME "a.out-amiga"
- + #define MY(OP) CAT(aout_amiga_,OP)
- +
- + #include "bfd.h"
- +
- + #define MY_exec_hdr_flags 0
- +
- + extern boolean
- + amiga_final_link(bfd *,struct bfd_link_info *);
- + #define MY_bfd_final_link amiga_final_link
- +
- + extern bfd_byte *
- + get_relocated_section_contents(bfd *, struct bfd_link_info *,
- + struct bfd_link_order *, bfd_byte *,
- + boolean , asymbol **);
- + #define MY_bfd_get_relocated_section_contents get_relocated_section_contents
- +
- + /* Include the usual a.out support. */
- + #include "aoutf1.h"
- diff -rc --new-file binutils-2.5.2-base/bfd/aoutx.h binutils-2.5.2/bfd/aoutx.h
- *** binutils-2.5.2-base/bfd/aoutx.h Mon Oct 31 07:00:21 1994
- --- binutils-2.5.2/bfd/aoutx.h Tue Feb 14 20:11:24 1995
- ***************
- *** 134,140 ****
- static boolean aout_get_external_symbols PARAMS ((bfd *));
- static boolean translate_from_native_sym_flags
- PARAMS ((bfd *, aout_symbol_type *));
- ! static boolean translate_to_native_sym_flags
- PARAMS ((bfd *, asymbol *, struct external_nlist *));
-
- /*
- --- 134,141 ----
- static boolean aout_get_external_symbols PARAMS ((bfd *));
- static boolean translate_from_native_sym_flags
- PARAMS ((bfd *, aout_symbol_type *));
- ! /*Amiga hack - used in amigados.c, must be global */
- ! /*static*/ boolean translate_to_native_sym_flags
- PARAMS ((bfd *, asymbol *, struct external_nlist *));
-
- /*
- ***************
- *** 1525,1531 ****
-
- /* Set the fields of SYM_POINTER according to CACHE_PTR. */
-
- ! static boolean
- translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer)
- bfd *abfd;
- asymbol *cache_ptr;
- --- 1526,1532 ----
-
- /* Set the fields of SYM_POINTER according to CACHE_PTR. */
-
- ! /*static*/ boolean
- translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer)
- bfd *abfd;
- asymbol *cache_ptr;
- ***************
- *** 1916,1925 ****
- --- 1917,1943 ----
-
- r_length = g->howto->size ; /* Size as a power of two */
- r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */
- +
- + #ifdef __amigados__
- + /* Changed for cooperation with AMIGA backend */
- + /* This only applies, if aout flavour 191194 ST*/
- /* XXX This relies on relocs coming from a.out files. */
- + /* FIXME! "#ifdef __amigados__" is the wrong way to select this code. */
- + if (bfd_asymbol_bfd(sym)->xvec->flavour==bfd_target_aout_flavour)
- + {
- + r_baserel = (g->howto->type & 8) != 0;
- + r_jmptable = (g->howto->type & 16) != 0;
- + r_relative = (g->howto->type & 32) != 0;
- + }
- + else
- + {
- + r_baserel=r_jmptable=r_relative=0;
- + }
- + #else
- r_baserel = (g->howto->type & 8) != 0;
- r_jmptable = (g->howto->type & 16) != 0;
- r_relative = (g->howto->type & 32) != 0;
- + #endif
-
- #if 0
- /* For a standard reloc, the addend is in the object file. */
- ***************
- *** 2399,2404 ****
- --- 2417,2427 ----
-
- if (asect == obj_bsssec (abfd))
- return 0;
- +
- + #ifdef __amigados__ /* FIXME */
- + fprintf(stderr,"Hmmm, sec=%s, %lx, .text=%lx, .data=%lx, .bss=%lx\n",
- + asect->name,asect,obj_textsec(abfd),obj_datasec(abfd),obj_bsssec(abfd));
- + #endif
-
- bfd_set_error (bfd_error_invalid_operation);
- return -1;
- diff -rc --new-file binutils-2.5.2-base/bfd/archive.c binutils-2.5.2/bfd/archive.c
- *** binutils-2.5.2-base/bfd/archive.c Sat Oct 22 01:27:47 1994
- --- binutils-2.5.2/bfd/archive.c Wed Feb 15 18:23:32 1995
- ***************
- *** 1630,1637 ****
- --- 1630,1640 ----
- {
- if (bfd_update_armap_timestamp (arch))
- break;
- + #if 0 /* Amiga hack - this seems to always happen. Need to investigate
- + why and fix it. For now, stop the gripes... -fnf */
- fprintf (stderr,
- "Warning: writing archive was slow: rewriting timestamp\n");
- + #endif
- }
- while (++tries < 6);
- }
- diff -rc --new-file binutils-2.5.2-base/bfd/bfd-in2.h binutils-2.5.2/bfd/bfd-in2.h
- *** binutils-2.5.2-base/bfd/bfd-in2.h Sat Oct 22 01:27:50 1994
- --- binutils-2.5.2/bfd/bfd-in2.h Fri Feb 10 14:29:18 1995
- ***************
- *** 1787,1792 ****
- --- 1787,1793 ----
- struct lynx_core_struct *lynx_core_data;
- struct osf_core_struct *osf_core_data;
- struct cisco_core_struct *cisco_core_data;
- + struct amiga_data_struct *amiga_data;
- PTR any;
- } tdata;
-
- ***************
- *** 1984,1990 ****
- bfd_target_tekhex_flavour,
- bfd_target_srec_flavour,
- bfd_target_som_flavour,
- ! bfd_target_os9k_flavour};
-
- /* Forward declaration. */
- typedef struct bfd_link_info _bfd_link_info;
- --- 1985,1992 ----
- bfd_target_tekhex_flavour,
- bfd_target_srec_flavour,
- bfd_target_som_flavour,
- ! bfd_target_os9k_flavour,
- ! bfd_target_amiga_flavour};
-
- /* Forward declaration. */
- typedef struct bfd_link_info _bfd_link_info;
- diff -rc --new-file binutils-2.5.2-base/bfd/bfd.c binutils-2.5.2/bfd/bfd.c
- *** binutils-2.5.2-base/bfd/bfd.c Fri Oct 14 23:16:16 1994
- --- binutils-2.5.2/bfd/bfd.c Fri Feb 10 14:29:20 1995
- ***************
- *** 169,174 ****
- --- 169,175 ----
- . struct lynx_core_struct *lynx_core_data;
- . struct osf_core_struct *osf_core_data;
- . struct cisco_core_struct *cisco_core_data;
- + . struct amiga_data_struct *amiga_data;
- . PTR any;
- . } tdata;
- .
- diff -rc --new-file binutils-2.5.2-base/bfd/config/amigados.mh binutils-2.5.2/bfd/config/amigados.mh
- *** binutils-2.5.2-base/bfd/config/amigados.mh Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/bfd/config/amigados.mh Fri Feb 10 14:29:22 1995
- ***************
- *** 0 ****
- --- 1,5 ----
- + # Host makefile fragment for Commodore Amiga running AmigaDOS
- + # Use the GNU C compiler.
- + CC=gcc
- + # Don't use -g, it doesn't do anything useful yet. Optimize though.
- + CFLAGS=-O
- diff -rc --new-file binutils-2.5.2-base/bfd/config/amigados.mt binutils-2.5.2/bfd/config/amigados.mt
- *** binutils-2.5.2-base/bfd/config/amigados.mt Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/bfd/config/amigados.mt Fri Feb 10 14:29:24 1995
- ***************
- *** 0 ****
- --- 1,5 ----
- + # Target config file for Commodore Amiga running AmigaDOS
- + SELECT_VECS =aout_amiga_vec
- + #We use two backends on AMIGA: HUNK and gcc's a.out format
- + DEFAULT_VECTOR=amiga_vec
- + SELECT_ARCHITECTURES=bfd_m68k_arch
- diff -rc --new-file binutils-2.5.2-base/bfd/config.bfd binutils-2.5.2/bfd/config.bfd
- *** binutils-2.5.2-base/bfd/config.bfd Tue Sep 13 18:30:07 1994
- --- binutils-2.5.2/bfd/config.bfd Fri Feb 10 14:29:26 1995
- ***************
- *** 81,86 ****
- --- 81,87 ----
- m68*-*-vxworks*) bfd_name=m68k-aout strip_underscore=yes ;;
- m68*-ericsson-*) bfd_name=m68k-ose strip_underscore=yes ;;
- m68*-netx-*) bfd_name=m68k-aout strip_underscore=yes ;;
- + m68*-cbm-amigados*) bfd_name=amigados ;;
-
- m88*-harris-cxux*) bfd_name=m88k-elf ;;
- # DGUX used to use COFF, but now (Jan 94) I believe it uses ELF by default.
- diff -rc --new-file binutils-2.5.2-base/bfd/configure.in binutils-2.5.2/bfd/configure.in
- *** binutils-2.5.2-base/bfd/configure.in Wed Oct 19 18:00:22 1994
- --- binutils-2.5.2/bfd/configure.in Fri Feb 10 14:29:28 1995
- ***************
- *** 137,143 ****
- --- 137,145 ----
- # with the two vector lists in targets.c.
- a29kcoff_big_vec) tb="$tb coff-a29k.o cofflink.o" ;;
- a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o stab-syms.o" ;;
- + amiga_vec) tb="$tb amigados.o amigadoslink.o" ;;
- aout0_big_vec) tb="$tb aout0.o aout32.o stab-syms.o" ;;
- + aout_amiga_vec) tb="$tb aout-amiga.o aout32.o stab-syms.o";;
- aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
- aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
- apollocoff_vec) tb="$tb coff-apollo.o" ;;
- ***************
- *** 273,281 ****
- test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
-
- echo "TDEFAULTS = \
- ! ${defvec+-DDEFAULT_VECTOR=$defvec} \
- ! ${selvecs+-DSELECT_VECS='$selvecs'} \
- ! ${selarchs+-DSELECT_ARCHITECTURES='$selarchs'}" \
- >> Makefile.2
-
- cat Makefile.tmp >> Makefile.2
- --- 275,283 ----
- test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
-
- echo "TDEFAULTS = \
- ! \"-DDEFAULT_VECTOR=$defvec\" \
- ! \"-DSELECT_VECS=$selvecs\" \
- ! \"-DSELECT_ARCHITECTURES=$selarchs\"" \
- >> Makefile.2
-
- cat Makefile.tmp >> Makefile.2
- diff -rc --new-file binutils-2.5.2-base/bfd/doc/Makefile.in binutils-2.5.2/bfd/doc/Makefile.in
- *** binutils-2.5.2-base/bfd/doc/Makefile.in Mon Sep 12 15:48:32 1994
- --- binutils-2.5.2/bfd/doc/Makefile.in Tue Feb 14 19:29:08 1995
- ***************
- *** 67,73 ****
-
- DOCFILES = aoutx.texi archive.texi archures.texi \
- bfd.texi cache.texi coffcode.texi \
- ! core.texi elf.texi elfcode.texi format.texi libbfd.texi \
- opncls.texi reloc.texi section.texi \
- syms.texi targets.texi init.texi hash.texi linker.texi
-
- --- 67,73 ----
-
- DOCFILES = aoutx.texi archive.texi archures.texi \
- bfd.texi cache.texi coffcode.texi \
- ! core.texi elf.texi elfcode.texi amiga.texi amigalink.texi format.texi libbfd.texi \
- opncls.texi reloc.texi section.texi \
- syms.texi targets.texi init.texi hash.texi linker.texi
-
- ***************
- *** 87,92 ****
- --- 87,93 ----
- $(srcdir)/../cache.c $(srcdir)/../coffcode.h \
- $(srcdir)/../core.c $(srcdir)/../elf.c \
- $(srcdir)/../elfcode.h $(srcdir)/../format.c \
- + $(srcdir)/../amigados.c $(srcdir)/../amigadoslink.c \
- $(srcdir)/../libbfd.c $(srcdir)/../opncls.c \
- $(srcdir)/../reloc.c $(srcdir)/../section.c \
- $(srcdir)/../syms.c $(srcdir)/../targets.c \
- ***************
- *** 136,141 ****
- --- 137,148 ----
- aoutx.texi: $(MKDOC) $(srcdir)/../aoutx.h $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../aoutx.h >aoutx.texi
-
- + amiga.texi: $(MKDOC) $(srcdir)/../amigados.c $(srcdir)/doc.str
- + $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../amigados.c >amiga.texi
- +
- + amigalink.texi: $(MKDOC) $(srcdir)/../amigadoslink.c $(srcdir)/doc.str
- + $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../amigadoslink.c >amigalink.texi
- +
- archive.texi: $(MKDOC) $(srcdir)/../archive.c $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../archive.c >archive.texi
-
- ***************
- *** 264,269 ****
- --- 271,279 ----
-
- bfd.info: $(DOCFILES) bfdsumm.texi bfd.texinfo
- $(MAKEINFO) -I$(srcdir) -o bfd.info $(srcdir)/bfd.texinfo
- +
- + bfd.guide: $(DOCFILES) bfdsumm.texi bfd.texinfo
- + $(MAKEINFO) --amiga -I$(srcdir) -o bfd.guide $(srcdir)/bfd.texinfo
-
- bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
- $(TEXI2DVI) $(srcdir)/bfd.texinfo
- diff -rc --new-file binutils-2.5.2-base/bfd/doc/bfd.texinfo binutils-2.5.2/bfd/doc/bfd.texinfo
- *** binutils-2.5.2-base/bfd/doc/bfd.texinfo Mon Sep 12 15:48:33 1994
- --- binutils-2.5.2/bfd/doc/bfd.texinfo Fri Feb 10 14:29:30 1995
- ***************
- *** 302,310 ****
- @chapter BFD back ends
- @menu
- * What to Put Where::
- ! * aout :: a.out backends
- ! * coff :: coff backends
- ! * elf :: elf backends
- @ignore
- * oasys :: oasys backends
- * ieee :: ieee backend
- --- 302,311 ----
- @chapter BFD back ends
- @menu
- * What to Put Where::
- ! * aout :: a.out backends
- ! * coff :: coff backends
- ! * elf :: elf backends
- ! * amiga :: amigados backend
- @ignore
- * oasys :: oasys backends
- * ieee :: ieee backend
- ***************
- *** 320,329 ****
- @node coff, elf, aout, BFD back ends
- @include coffcode.texi
-
- ! @node elf, , coff, BFD back ends
- @include elf.texi
- @c Leave this out until the file has some actual contents...
- @c @include elfcode.texi
-
- @node Index, , BFD back ends , Top
- @unnumbered Index
- --- 321,334 ----
- @node coff, elf, aout, BFD back ends
- @include coffcode.texi
-
- ! @node elf, amiga , coff, BFD back ends
- @include elf.texi
- @c Leave this out until the file has some actual contents...
- @c @include elfcode.texi
- +
- + @node amiga, , elf, BFD back ends
- + @include amiga.texi
- + @include amigalink.texi
-
- @node Index, , BFD back ends , Top
- @unnumbered Index
- diff -rc --new-file binutils-2.5.2-base/bfd/hosts/amigados.h binutils-2.5.2/bfd/hosts/amigados.h
- *** binutils-2.5.2-base/bfd/hosts/amigados.h Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/bfd/hosts/amigados.h Fri Feb 10 14:29:30 1995
- ***************
- *** 0 ****
- --- 1,5 ----
- + /* Host configuration for AmigaDOS */
- + #ifndef hosts_amigados_h
- + #define hosts_amigados_h
- + #include "hosts/std-host.h"
- + #endif /* hosts_amigados_h */
- diff -rc --new-file binutils-2.5.2-base/bfd/libamiga.h binutils-2.5.2/bfd/libamiga.h
- *** binutils-2.5.2-base/bfd/libamiga.h Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/bfd/libamiga.h Fri Feb 10 14:29:32 1995
- ***************
- *** 0 ****
- --- 1,173 ----
- + /* BFD back-end data structures for AmigaOS.
- + Copyright (C) 1992-1994 Free Software Foundation, Inc.
- + Contributed by Leonard Norrgard.
- + Extended by Stephan Thesing Nov 94
- +
- + This file is part of BFD, the Binary File Descriptor library.
- +
- + This program is free software; you can redistribute it and/or modify
- + it under the terms of the GNU General Public License as published by
- + the Free Software Foundation; either version 2 of the License, or
- + (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., 675 Mass Ave, Cambridge, MA 02139, USA. */
- +
- + #ifdef __STDC__
- + #define CAT3(a,b,c) a##b##c
- + #else
- + #define CAT3(a,b,c) a/**/b/**/c
- + #endif
- +
- + #define GET_WORD bfd_h_get_32
- + #define GET_SWORD (int32_type)GET_WORD
- + #define PUT_WORD bfd_h_put_32
- + #define NAME(x,y) CAT3(x,_32_,y)
- + #define JNAME(x) CAT(x,_32)
- + #define BYTES_IN_WORD 4
- +
- +
- + #include <exec/memory.h>
- + #include <dos/doshunks.h>
- + #if 0
- + /* Hunk ID numbers.*/
- + #define HUNK_UNIT 999
- + #define HUNK_NAME 1000
- + #define HUNK_CODE 1001
- + #define HUNK_DATA 1002
- + #define HUNK_BSS 1003
- + #define HUNK_RELOC32 1004
- + #define HUNK_RELOC16 1005
- + #define HUNK_RELOC8 1006
- + #define HUNK_EXT 1007
- + #define HUNK_SYMBOL 1008
- + #define HUNK_DEBUG 1009
- + #define HUNK_END 1010
- + #define HUNK_HEADER 1011
- + #define HUNK_OVERLAY 1013
- + #define HUNK_BREAK 1014
- + #define HUNK_DREL32 1015
- + #define HUNK_DREL16 1016
- + #define HUNK_DREL8 1017
- + #define HUNK_LIB 1018
- + #define HUNK_INDEX 1019
- + #endif
- +
- + /* The hunk ID part. */
- + #define HUNK_VALUE(hunk_id) ((hunk_id) & 0x3fffffff)
- +
- + /* Attributes of a hunk. */
- + #define HUNK_ATTRIBUTE(hunk_id) ((hunk_id) >> 30)
- + #define HUNK_ATTR_CHIP 0x01 /* Hunk contents must go into chip (graphics) memory. */
- + #define HUNK_ATTR_FAST 0x02 /* fast */
- + #define HUNK_ATTR_FOLLOWS 0x03 /* Mem id follows */
- +
- + #if 0
- + /* HUNK_EXT sub-types.*/
- + #define EXT_SYMB 0 /* Symbol table. */
- + #define EXT_DEF 1 /* Relocatable definition. */
- + #define EXT_ABS 2 /* Absolute definition. */
- + #define EXT_RES 3 /* Obsolete. */
- + #define EXT_REF32 129 /* 32 bit reference to symbol. */
- + #define EXT_COMMON 130 /* 32 bit reference to COMMON block. */
- + #define EXT_REF16 131 /* 16 bit reference to symbol. */
- + #define EXT_REF8 132 /* 8 bit reference to symbol. */
- + #define EXT_DEXT32 133 /* 32 bit data releative reference. */
- + #define EXT_DEXT16 134 /* 16 bit data releative reference. */
- + #define EXT_DEXT8 135 /* 8 bit data releative reference. */
- + #endif
- +
- +
- + typedef struct amiga_reloc {
- + arelent relent;
- + struct amiga_reloc *next;
- + struct amiga_symbol *symbol;
- + long target_hunk;
- + } amiga_reloc_type;
- +
- + typedef struct amiga_symbol {
- + asymbol symbol;
- + struct amiga_symbol *next;
- + long hunk_number;
- + unsigned char type;
- + } amiga_symbol_type;
- +
- + struct amiga_raw_symbol {
- + struct amiga_raw_symbol *next;
- + unsigned long data[1];
- + };
- +
- + typedef struct amiga_per_section
- + {
- + amiga_reloc_type *reloc_tail; /* last reloc */ /* first is in section->relocation */
- + int attribute; /* Memory type required by this section */
- + int real_length; /* This is the length, occuring in the hunk */
- + /* _raw_size may be larger than this */
- + int max_raw_relocs; /* Size of array */
- + int num_raw_relocs; /* # of relocs, this points to : */
- + unsigned long **raw_relocs; /* Points to array of raw_relocs */
- + /* every array element points to the raw data */
- + struct amiga_raw_symbol *first;
- + struct amiga_raw_symbol *last; /* tail */
- +
- + } amiga_per_section_type;
- + #define amiga_per_section(x) ((amiga_per_section_type *)((x)->used_by_bfd))
- +
- + /* The `tdata' struct for all a.out-like object file formats.
- + Various things depend on this struct being around any time an a.out
- + file is being handled. An example is dbxread.c in GDB. */
- +
- + struct amiga_data {
- + struct internal_exec *hdr; /* exec file header */
- + amiga_symbol_type *symbols; /* symtab for input bfd */
- +
- + /* Filler, so we can pretend to be an a.out to GDB. */
- + asection *textsec;
- + asection *datasec;
- + asection *bsssec;
- +
- + /* The positions of the string table and symbol table. */
- + file_ptr sym_filepos;
- + file_ptr str_filepos;
- +
- + unsigned int n_symbols; /* number of symbols */
- +
- + /* Size of a relocation entry in external form */
- + unsigned dummy_reloc_entry_size;
- +
- + /* Size of a symbol table entry in external form */
- + unsigned symbol_entry_size;
- +
- + unsigned exec_bytes_size;
- + unsigned vma_adjusted : 1;
- + };
- +
- + typedef struct amiga_data_struct {
- + struct amiga_data a;
- +
- + unsigned long symtab_size;
- + unsigned long stringtab_size;
- +
- + unsigned long *first_byte;
- + unsigned long *file_end;
- + unsigned long *file_pointer;
- + amiga_symbol_type *symbols;
- + amiga_symbol_type *symbol_tail;
- + boolean IsLoadFile; /* If true, this is a load file (for output bfd only) */
- + int maxsymbols; /* Used by final_link routine to add symbols to output bfd.
- + This is the # of entries, allocated in abdfd->osymbols */
- + } amiga_data_type;
- +
- + #define adata(bfd) ((bfd)->tdata.amiga_data->a)
- +
- + /* We take the address of the first element of an asymbol to ensure that the
- + macro is only ever applied to an asymbol */
- + #define amiga_symbol(asymbol) ((amiga_symbol_type *)(&(asymbol)->the_bfd))
- +
- + #define AMIGA_DATA(abfd) ((abfd)->tdata.amiga_data)
- diff -rc --new-file binutils-2.5.2-base/bfd/linker.c binutils-2.5.2/bfd/linker.c
- *** binutils-2.5.2-base/bfd/linker.c Mon Oct 31 07:00:39 1994
- --- binutils-2.5.2/bfd/linker.c Tue Feb 14 20:12:52 1995
- ***************
- *** 434,440 ****
- static boolean default_fill_link_order
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- struct bfd_link_order *));
- ! static boolean default_indirect_link_order
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- struct bfd_link_order *, boolean));
-
- --- 434,441 ----
- static boolean default_fill_link_order
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- struct bfd_link_order *));
- ! /*Amiga hack - used in amigadoslink.c so must be global */
- ! /*static*/ boolean default_indirect_link_order
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- struct bfd_link_order *, boolean));
-
- ***************
- *** 2442,2448 ****
-
- /* Default routine to handle a bfd_indirect_link_order. */
-
- ! static boolean
- default_indirect_link_order (output_bfd, info, output_section, link_order,
- generic_linker)
- bfd *output_bfd;
- --- 2443,2449 ----
-
- /* Default routine to handle a bfd_indirect_link_order. */
-
- ! /*static*/ boolean
- default_indirect_link_order (output_bfd, info, output_section, link_order,
- generic_linker)
- bfd *output_bfd;
- diff -rc --new-file binutils-2.5.2-base/bfd/targets.c binutils-2.5.2/bfd/targets.c
- *** binutils-2.5.2-base/bfd/targets.c Sat Oct 22 01:28:21 1994
- --- binutils-2.5.2/bfd/targets.c Tue Feb 14 19:08:58 1995
- ***************
- *** 146,152 ****
- . bfd_target_tekhex_flavour,
- . bfd_target_srec_flavour,
- . bfd_target_som_flavour,
- ! . bfd_target_os9k_flavour};
- .
- .{* Forward declaration. *}
- .typedef struct bfd_link_info _bfd_link_info;
- --- 146,153 ----
- . bfd_target_tekhex_flavour,
- . bfd_target_srec_flavour,
- . bfd_target_som_flavour,
- ! . bfd_target_os9k_flavour,
- ! . bfd_target_amiga_flavour};
- .
- .{* Forward declaration. *}
- .typedef struct bfd_link_info _bfd_link_info;
- ***************
- *** 424,429 ****
- --- 425,432 ----
- we can't intermix extern's and initializers. */
- extern const bfd_target a29kcoff_big_vec;
- extern const bfd_target a_out_adobe_vec;
- + extern const bfd_target amiga_vec;
- + extern const bfd_target aout_amiga_vec;
- extern const bfd_target aout_mips_big_vec;
- extern const bfd_target aout_mips_little_vec;
- extern const bfd_target aout0_big_vec;
- ***************
- *** 528,533 ****
- --- 531,538 ----
- it wasn't omitted by mistake. */
- &a29kcoff_big_vec,
- &a_out_adobe_vec,
- + &amiga_vec,
- + &aout_amiga_vec,
- #if 0 /* No one seems to use this. */
- &aout_mips_big_vec,
- #endif
- diff -rc --new-file binutils-2.5.2-base/binutils/Makefile.in binutils-2.5.2/binutils/Makefile.in
- *** binutils-2.5.2-base/binutils/Makefile.in Wed Nov 2 20:17:06 1994
- --- binutils-2.5.2/binutils/Makefile.in Mon Mar 27 12:35:22 1995
- ***************
- *** 62,68 ****
- CC_FOR_BUILD = $(CC)
- NM_FOR_TARGET = nm
- NM = $(NM_FOR_TARGET)
- ! SYMLINK = ln -s
-
- BISON = bison -y
- # Comment these out if using lex.
- --- 62,71 ----
- CC_FOR_BUILD = $(CC)
- NM_FOR_TARGET = nm
- NM = $(NM_FOR_TARGET)
- ! #SYMLINK = ln -s
- ! SYMLINK = cp
- ! #HARDLINK = ln
- ! HARDLINK = cp
-
- BISON = bison -y
- # Comment these out if using lex.
- ***************
- *** 106,111 ****
- --- 109,120 ----
-
- MANPAGES= ar nm objdump ranlib size strings strip objcopy nlmconv
-
- + # For now, install only a subset of the new binutils since we still use
- + # some of the old 1.8.x utils
- + INSTALL_PROGS = $(OBJDUMP_PROG) $(STRINGS_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) $(BUILD_NLMCONV) $(BUILD_SRCONV) $(SYSINFO_PROG)
- + INSTALL_TOOL_PROGS =
- + INSTALL_MANPAGES= objdump strings objcopy nlmconv
- +
- PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) $(BUILD_NLMCONV) $(BUILD_SRCONV) $(SYSINFO_PROG)
- STAGESTUFF = $(PROGS) *.o
- # Files that can be generated, but should be in the distribution.
- ***************
- *** 248,261 ****
- ar_with_ranlib: $(ADDL_LIBS) ar.o maybe-ranlib.o $(BFD)
- $(CC) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
- -rm -f $(RANLIB_PROG)
- ! -ln $(AR_PROG) $(RANLIB_PROG)
-
- # objcopy and strip in one binary that uses argv[0] to decide its action.
-
- objcopy_with_strip: $(ADDL_LIBS) objcopy.o maybe-strip.o $(BFD)
- $(CC) $(CFLAGS) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o maybe-strip.o $(ADDL_LIBS) $(EXTRALIBS)
- -rm -f $(STRIP_PROG)
- ! -ln $(OBJCOPY_PROG) $(STRIP_PROG)
-
- sysroff.c: sysinfo sysroff.info
- ./sysinfo -c <$(srcdir)/sysroff.info >sysroff.c
- --- 257,270 ----
- ar_with_ranlib: $(ADDL_LIBS) ar.o maybe-ranlib.o $(BFD)
- $(CC) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
- -rm -f $(RANLIB_PROG)
- ! -$(HARDLINK) $(AR_PROG) $(RANLIB_PROG)
-
- # objcopy and strip in one binary that uses argv[0] to decide its action.
-
- objcopy_with_strip: $(ADDL_LIBS) objcopy.o maybe-strip.o $(BFD)
- $(CC) $(CFLAGS) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o maybe-strip.o $(ADDL_LIBS) $(EXTRALIBS)
- -rm -f $(STRIP_PROG)
- ! -$(HARDLINK) $(OBJCOPY_PROG) $(STRIP_PROG)
-
- sysroff.c: sysinfo sysroff.info
- ./sysinfo -c <$(srcdir)/sysroff.info >sysroff.c
- ***************
- *** 506,525 ****
- etags $(INCDIR)/*.h $(srcdir)/*.[hc]
-
- install: all $(DEMANGLER_PROG).1
- ! for i in $(PROGS) ; do \
- $(INSTALL_XFORM) $$i $(bindir)/`echo $$i | sed -e 's/.new//'` ; \
- done
- ! for i in $(MANPAGES) ; do \
- $(INSTALL_XFORM1) $(srcdir)/$$i.1 $(man1dir)/$$i.1 ; \
- done
- $(INSTALL_XFORM1) $(DEMANGLER_PROG).1 $(man1dir)/$(DEMANGLER_PROG).1
- -if [ -d $(tooldir) ]; then \
- if [ -d $(tooldir)/bin ]; then true; else mkdir $(tooldir)/bin; fi; \
- ! for i in $(TOOL_PROGS) ; do \
- j=`echo $$i | sed -e 's/.new//'`; \
- rm -f $(tooldir)/bin/$$j; \
- k=`t='$(program_transform_name)'; echo $$j | sed -e s/x/x/ $$t`; \
- ! ln $(bindir)/$$k $(tooldir)/bin/$$j >/dev/null 2>/dev/null \
- || $(INSTALL_PROGRAM) $$i $(tooldir)/bin/$$j; \
- done; \
- else true; fi
- --- 515,534 ----
- etags $(INCDIR)/*.h $(srcdir)/*.[hc]
-
- install: all $(DEMANGLER_PROG).1
- ! for i in $(INSTALL_PROGS) ; do \
- $(INSTALL_XFORM) $$i $(bindir)/`echo $$i | sed -e 's/.new//'` ; \
- done
- ! for i in $(INSTALL_MANPAGES) ; do \
- $(INSTALL_XFORM1) $(srcdir)/$$i.1 $(man1dir)/$$i.1 ; \
- done
- $(INSTALL_XFORM1) $(DEMANGLER_PROG).1 $(man1dir)/$(DEMANGLER_PROG).1
- -if [ -d $(tooldir) ]; then \
- if [ -d $(tooldir)/bin ]; then true; else mkdir $(tooldir)/bin; fi; \
- ! for i in $(INSTALL_TOOL_PROGS) ; do \
- j=`echo $$i | sed -e 's/.new//'`; \
- rm -f $(tooldir)/bin/$$j; \
- k=`t='$(program_transform_name)'; echo $$j | sed -e s/x/x/ $$t`; \
- ! $(HARDLINK) $(bindir)/$$k $(tooldir)/bin/$$j >/dev/null 2>/dev/null \
- || $(INSTALL_PROGRAM) $$i $(tooldir)/bin/$$j; \
- done; \
- else true; fi
- ***************
- *** 551,557 ****
- diststuff: $(DISTSTUFF)
-
- $(DIST_NAME).tar.z:
- ! cd ../..; rm -f $(DIST_NAME); ln -s devo $(DIST_NAME)
- make diststuff -f Makefile.in
- cd ../ld; make diststuff -f Makefile.in
- cd ../gprof; make diststuff -f Makefile.in
- --- 560,566 ----
- diststuff: $(DISTSTUFF)
-
- $(DIST_NAME).tar.z:
- ! cd ../..; rm -f $(DIST_NAME); $(SYMLINK) devo $(DIST_NAME)
- make diststuff -f Makefile.in
- cd ../ld; make diststuff -f Makefile.in
- cd ../gprof; make diststuff -f Makefile.in
- diff -rc --new-file binutils-2.5.2-base/config/mh-amigados binutils-2.5.2/config/mh-amigados
- *** binutils-2.5.2-base/config/mh-amigados Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/config/mh-amigados Mon Mar 27 11:19:12 1995
- ***************
- *** 0 ****
- --- 1,13 ----
- + # Host makefile fragment for Commodore Amiga running AmigaDOS.
- +
- + # There is no standard system compiler. Assume use GNU C.
- + CC = gcc
- + # There is no support for -g yet. But use -O instead.
- + CFLAGS = -O
- + # We have both types of links under AmigaDOS with GNU
- + # utils, however the links need to be made in canonical
- + # AmigaDOS format (foo:bar/bell/file) rather than UNIX
- + # format (/foo/bar/bell/file). When this is fixed, then
- + # these can go away.
- + SYMLINK = cp
- + HARDLINK = cp
- diff -rc --new-file binutils-2.5.2-base/configure binutils-2.5.2/configure
- *** binutils-2.5.2-base/configure Wed Oct 19 16:05:50 1994
- --- binutils-2.5.2/configure Fri Feb 10 15:43:04 1995
- ***************
- *** 36,46 ****
- # config.status is removed.
- #
-
- export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0 $argv; kill $$)
-
- remove=rm
- ! hard_link=ln
- ! symbolic_link='ln -s'
-
- #for Test
- #remove="echo rm"
- --- 36,49 ----
- # config.status is removed.
- #
-
- + # In places where the argument to echo may start with a '-', use /bin/echo
- + # since the AmigaDOS pdksh builtin echo botches this case.
- +
- export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0 $argv; kill $$)
-
- remove=rm
- ! hard_link=cp
- ! symbolic_link=cp
-
- #for Test
- #remove="echo rm"
- ***************
- *** 65,71 ****
- norecursion=
- other_options=
- package_makefile_frag=
- ! prefix=/usr/local
- progname=
- program_prefix=
- program_prefixoption=
- --- 68,77 ----
- norecursion=
- other_options=
- package_makefile_frag=
- ! # This is a hack so we don't have to remember to always configure using
- ! # the "--prefix=/gnu" option. Personally I feel this should be settable
- ! # in a config file. -fnf
- ! prefix=/gnu
- progname=
- program_prefix=
- program_prefixoption=
- ***************
- *** 102,110 ****
- ## path. Since PATH might include "." we also add `pwd` to the end of PATH.
- ##
-
- ! progname=$0
- # if PWD already has a value, it is probably wrong.
- ! if [ -n "$PWD" ]; then PWD=`pwd`; fi
-
- case "${progname}" in
- /*) ;;
- --- 108,119 ----
- ## path. Since PATH might include "." we also add `pwd` to the end of PATH.
- ##
-
- ! # For some reason, the value of $0 in AmigaDOS pdksh ends up with a
- ! # trailing '/' that needs to be stripped.
- ! progname=`/bin/echo $0 | sed 's:/$::'`
- # if PWD already has a value, it is probably wrong.
- ! # The AmigaDOS pksh can't change the value of PWD, it's readonly.
- ! #if [ -n "$PWD" ]; then PWD=`pwd`; fi
-
- case "${progname}" in
- /*) ;;
- ***************
- *** 140,146 ****
- # Split out the argument for options that take them
- case $option in
- --*=*)
- ! optarg=`echo $option | sed -e 's/^[^=]*=//'`
- ;;
- # These options have mandatory values. Since we didn't find an = sign,
- # the value must be in the next argument
- --- 149,155 ----
- # Split out the argument for options that take them
- case $option in
- --*=*)
- ! optarg=`/bin/echo $option | sed -e 's/^[^=]*=//'`
- ;;
- # These options have mandatory values. Since we didn't find an = sign,
- # the value must be in the next argument
- ***************
- *** 165,171 ****
- --cache*)
- ;;
- --disable-*)
- ! enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'`
- eval $enableopt=no
- disableoptions="$disableoptions $option"
- ;;
- --- 174,180 ----
- --cache*)
- ;;
- --disable-*)
- ! enableopt=`/bin/echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'`
- eval $enableopt=no
- disableoptions="$disableoptions $option"
- ;;
- ***************
- *** 175,181 ****
- *) optarg=yes ;;
- esac
-
- ! enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
- eval $enableopt="$optarg"
- enableoptions="$enableoptions $option"
- ;;
- --- 184,190 ----
- *) optarg=yes ;;
- esac
-
- ! enableopt=`/bin/echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
- eval $enableopt="$optarg"
- enableoptions="$enableoptions $option"
- ;;
- ***************
- *** 217,223 ****
- ;;
- --program-transform-name* | --program-t*)
- # Double any backslashes or dollar signs in the argument
- ! program_transform_name="${program_transform_name} -e `echo ${optarg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
- program_transform_nameoption="${program_transform_nameoption} --program-transform-name='$optarg'"
- ;;
- --rm)
- --- 226,232 ----
- ;;
- --program-transform-name* | --program-t*)
- # Double any backslashes or dollar signs in the argument
- ! program_transform_name="${program_transform_name} -e `/bin/echo ${optarg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
- program_transform_nameoption="${program_transform_nameoption} --program-transform-name='$optarg'"
- ;;
- --rm)
- ***************
- *** 236,242 ****
- # bolted into an object file as debug info, it has two slashes
- # in it. Ordinarily this is ok, but emacs takes double slash
- # to mean "forget the first part".
- ! srcdir=`echo $optarg | sed -e 's:/$::'`
- ;;
- --srcdir* | --sr*)
- srcdir=$optarg
- --- 245,251 ----
- # bolted into an object file as debug info, it has two slashes
- # in it. Ordinarily this is ok, but emacs takes double slash
- # to mean "forget the first part".
- ! srcdir=`/bin/echo $optarg | sed -e 's:/$::'`
- ;;
- --srcdir* | --sr*)
- srcdir=$optarg
- ***************
- *** 258,264 ****
- verbose=--verbose
- ;;
- --version | --V | --vers*)
- ! echo "This is Cygnus Configure version" `echo ${version} | sed 's/[ $:]//g'`
- exit 0
- ;;
- --with-*)
- --- 267,273 ----
- verbose=--verbose
- ;;
- --version | --V | --vers*)
- ! echo "This is Cygnus Configure version" `/bin/echo ${version} | sed 's/[ $:]//g'`
- exit 0
- ;;
- --with-*)
- ***************
- *** 267,278 ****
- *) optarg=yes ;;
- esac
-
- ! withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
- eval $withopt="$optarg"
- withoptions="$withoptions $option"
- ;;
- --without-*)
- ! withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'`
- eval $withopt=no
- withoutoptions="$withoutoptions $option"
- ;;
- --- 276,287 ----
- *) optarg=yes ;;
- esac
-
- ! withopt=`/bin/echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
- eval $withopt="$optarg"
- withoptions="$withoptions $option"
- ;;
- --without-*)
- ! withopt=`/bin/echo ${option} | sed 's:^--::;s:out::;s:-:_:g'`
- eval $withopt=no
- withoutoptions="$withoutoptions $option"
- ;;
- ***************
- *** 331,337 ****
- NOUNDEFS)
- # Neither --host option nor undefs were present.
- # Call config.guess.
- ! guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
- if host_alias=`${guesssys}`
- then
- # If the string we are going to use for
- --- 340,346 ----
- NOUNDEFS)
- # Neither --host option nor undefs were present.
- # Call config.guess.
- ! guesssys=`/bin/echo ${progname} | sed 's/configure$/config.guess/'`
- if host_alias=`${guesssys}`
- then
- # If the string we are going to use for
- ***************
- *** 411,418 ****
- exit 1
- fi
-
- ! configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
- ! moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
-
- # this is a hack. sun4 must always be a valid host alias or this will fail.
- if ${configsub} sun4 >/dev/null 2>&1 ; then
- --- 420,427 ----
- exit 1
- fi
-
- ! configsub=`/bin/echo ${progname} | sed 's/configure$/config.sub/'`
- ! moveifchange=`/bin/echo ${progname} | sed 's/configure$/move-if-change/'`
-
- # this is a hack. sun4 must always be a valid host alias or this will fail.
- if ${configsub} sun4 >/dev/null 2>&1 ; then
- ***************
- *** 437,443 ****
- srcdir=.
- else
- if [ -r ${progname}.in ] ; then
- ! srcdir=`echo ${progname} | sed 's:/configure$::'`
- else
- echo '***' "Can't find configure.in. Try using --srcdir=some_dir" 1>&2
- exit 1
- --- 446,452 ----
- srcdir=.
- else
- if [ -r ${progname}.in ] ; then
- ! srcdir=`/bin/echo ${progname} | sed 's:/configure$::'`
- else
- echo '***' "Can't find configure.in. Try using --srcdir=some_dir" 1>&2
- exit 1
- ***************
- *** 523,531 ****
- *)
- if result=`${config_shell} ${configsub} ${build_alias}` ; then
- buildopt="--build=${build_alias}"
- ! build_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! build_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! build_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- build=${build_cpu}-${build_vendor}-${build_os}
- else
- echo "Unrecognized build system name ${build_alias}." 1>&2
- --- 532,540 ----
- *)
- if result=`${config_shell} ${configsub} ${build_alias}` ; then
- buildopt="--build=${build_alias}"
- ! build_cpu=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! build_vendor=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! build_os=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- build=${build_cpu}-${build_vendor}-${build_os}
- else
- echo "Unrecognized build system name ${build_alias}." 1>&2
- ***************
- *** 540,548 ****
- echo "Unrecognized host system name ${host_alias}." 1>&2
- exit 1
- fi
- ! host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- host=${host_cpu}-${host_vendor}-${host_os}
-
- . ${tmpfile}.hst
- --- 549,557 ----
- echo "Unrecognized host system name ${host_alias}." 1>&2
- exit 1
- fi
- ! host_cpu=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! host_vendor=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! host_os=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- host=${host_cpu}-${host_vendor}-${host_os}
-
- . ${tmpfile}.hst
- ***************
- *** 553,561 ****
- echo "Unrecognized target system name ${target_alias}." 1>&2
- exit 1
- fi
- ! target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- target=${target_cpu}-${target_vendor}-${target_os}
-
- . ${tmpfile}.tgt
- --- 562,570 ----
- echo "Unrecognized target system name ${target_alias}." 1>&2
- exit 1
- fi
- ! target_cpu=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! target_vendor=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! target_os=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- target=${target_cpu}-${target_vendor}-${target_os}
-
- . ${tmpfile}.tgt
- ***************
- *** 611,624 ****
- # ${subdir} is relative path from . to the directory we're currently
- # configuring.
- # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed.
- ! invsubdir=`echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'`
-
- ### figure out what to do with srcdir
- case "${srcdir}" in
- ".") # no -srcdir option. We're building in place.
- makesrcdir=. ;;
- /*) # absolute path
- ! makesrcdir=`echo ${srcdir}/${subdir} | sed -e 's|/\.$||'`
- ;;
- *) # otherwise relative
- case "${subdir}" in
- --- 620,633 ----
- # ${subdir} is relative path from . to the directory we're currently
- # configuring.
- # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed.
- ! invsubdir=`/bin/echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'`
-
- ### figure out what to do with srcdir
- case "${srcdir}" in
- ".") # no -srcdir option. We're building in place.
- makesrcdir=. ;;
- /*) # absolute path
- ! makesrcdir=`/bin/echo ${srcdir}/${subdir} | sed -e 's|/\.$||'`
- ;;
- *) # otherwise relative
- case "${subdir}" in
- ***************
- *** 846,852 ****
- # make sure that some sort of reasonable default exists for these
- # two variables
- CXX=${CXX-"g++ -O"}
- ! CC=${CC-cc}
-
- # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
- # remove any form feeds.
- --- 855,861 ----
- # make sure that some sort of reasonable default exists for these
- # two variables
- CXX=${CXX-"g++ -O"}
- ! CC=${CC-gcc}
-
- # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
- # remove any form feeds.
- ***************
- *** 891,897 ****
- *) using="${using} and \"${site_makefile_frag}\"" ;;
- esac
-
- ! newusing=`echo "${using}" | sed 's/and/using/'`
- using=${newusing}
- echo "Created \"${Makefile}\" in" ${PWD=`pwd`} ${using}
-
- --- 900,906 ----
- *) using="${using} and \"${site_makefile_frag}\"" ;;
- esac
-
- ! newusing=`/bin/echo "${using}" | sed 's/and/using/'`
- using=${newusing}
- echo "Created \"${Makefile}\" in" ${PWD=`pwd`} ${using}
-
- ***************
- *** 983,989 ****
-
- ### The recursion line is here.
- if [ ! -z "${recprog}" ] ; then
- ! if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} \
- ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
- ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${removing} ${other_options} ${redirect} ; then
- true
- --- 992,1000 ----
-
- ### The recursion line is here.
- if [ ! -z "${recprog}" ] ; then
- ! echo ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} ${prefixoption} ${tmpdiroption} ${exec_prefixoption} ${srcdiroption} ${program_prefixoption} ${program_suffixoption} \
- ! ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${removing} ${other_options} ${redirect}
- ! if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} \
- ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
- ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${removing} ${other_options} ${redirect} ; then
- true
- diff -rc --new-file binutils-2.5.2-base/configure.in binutils-2.5.2/configure.in
- *** binutils-2.5.2-base/configure.in Wed Nov 2 20:20:43 1994
- --- binutils-2.5.2/configure.in Fri Feb 10 15:43:04 1995
- ***************
- *** 123,128 ****
- --- 123,129 ----
- *-*-lynxos*) host_makefile_frag=config/mh-lynxos ;;
- *-*-sysv4*) host_makefile_frag=config/mh-sysv4 ;;
- *-*-sysv*) host_makefile_frag=config/mh-sysv ;;
- + *-*-amigados*) host_makefile_frag=config/mh-amigados ;;
- esac
- fi
-
- diff -rc --new-file binutils-2.5.2-base/gas/Makefile.in binutils-2.5.2/gas/Makefile.in
- *** binutils-2.5.2-base/gas/Makefile.in Wed Nov 2 20:17:06 1994
- --- binutils-2.5.2/gas/Makefile.in Mon Mar 27 12:21:04 1995
- ***************
- *** 72,78 ****
- TEXI2DVI = texi2dvi
- RANLIB = ranlib
- CC = @CC@
- ! CFLAGS = -g
-
- MAKEOVERRIDES=
-
- --- 72,82 ----
- TEXI2DVI = texi2dvi
- RANLIB = ranlib
- CC = @CC@
- ! CFLAGS = -O2
- ! #SYMLINK = ln -s
- ! SYMLINK = cp
- ! #HARDLINK = ln
- ! HARDLINK = cp
-
- MAKEOVERRIDES=
-
- ***************
- *** 372,378 ****
- targ-env.h obj-format.h targ-cpu.h \
- struc-symbol.h write.h flonum.h bignum.h expr.h \
- frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
- ! input-scrub.o : input-scrub.c /usr/include/errno.h /usr/include/sys/errno.h \
- as.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h \
- write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
- --- 376,385 ----
- targ-env.h obj-format.h targ-cpu.h \
- struc-symbol.h write.h flonum.h bignum.h expr.h \
- frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
- ! # Removed hardwired dependency of input-scrub.o on files in /usr/include
- ! # This is a botch for code that may be compiled with (or as) part of
- ! # a cross compilation system.
- ! input-scrub.o : input-scrub.c \
- as.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h \
- write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
- ***************
- *** 465,476 ****
- install:
- srcroot=`cd $(srcroot); pwd`; export srcroot; \
- $(INSTALL_XFORM) as.new $(bindir)/as; \
- $(INSTALL_XFORM1) $(srcdir)/doc/as.1 $(man1dir)/as.1; \
- n=`echo as | sed '$(program_transform_name)'`; \
- if [ -d $(tooldir) ]; then \
- if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \
- rm -f $(tooldir)/bin/as; \
- ! ln $(bindir)/$$n $(tooldir)/bin/as >/dev/null 2>/dev/null \
- || $(INSTALL_PROGRAM) as.new $(tooldir)/bin/as; \
- else true; fi
- srcroot=`cd $(srcroot); pwd`; export srcroot; \
- --- 472,484 ----
- install:
- srcroot=`cd $(srcroot); pwd`; export srcroot; \
- $(INSTALL_XFORM) as.new $(bindir)/as; \
- + $(INSTALL_XFORM) as.new $(bindir)/gas; \
- $(INSTALL_XFORM1) $(srcdir)/doc/as.1 $(man1dir)/as.1; \
- n=`echo as | sed '$(program_transform_name)'`; \
- if [ -d $(tooldir) ]; then \
- if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \
- rm -f $(tooldir)/bin/as; \
- ! $(HARDLINK) $(bindir)/$$n $(tooldir)/bin/as >/dev/null 2>/dev/null \
- || $(INSTALL_PROGRAM) as.new $(tooldir)/bin/as; \
- else true; fi
- srcroot=`cd $(srcroot); pwd`; export srcroot; \
- ***************
- *** 479,485 ****
- if [ -d $(tooldir) ]; then \
- if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \
- rm -f $(tooldir)/bin/gasp; \
- ! ln $(bindir)/$$n $(tooldir)/bin/gasp >/dev/null 2>/dev/null \
- || $(INSTALL_PROGRAM) gasp.new $(tooldir)/bin/gasp; \
- else true; fi
-
- --- 487,493 ----
- if [ -d $(tooldir) ]; then \
- if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \
- rm -f $(tooldir)/bin/gasp; \
- ! $(HARDLINK) $(bindir)/$$n $(tooldir)/bin/gasp >/dev/null 2>/dev/null \
- || $(INSTALL_PROGRAM) gasp.new $(tooldir)/bin/gasp; \
- else true; fi
-
- ***************
- *** 498,520 ****
-
- bootstrap: as.new force
- $(MAKE) stage1
- ! rm -f stage && ln -s stage1 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
- $(MAKE) stage2
- ! rm -f stage && ln -s stage2 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
- $(MAKE) comparison against=stage2
-
- bootstrap2: force
- ! rm -f stage && ln -s stage1 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
- $(MAKE) stage2
- ! rm -f stage && ln -s stage2 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
- $(MAKE) comparison against=stage2
-
- bootstrap3: force
- ! rm -f stage && ln -s stage2 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
- $(MAKE) comparison against=stage2
-
- --- 506,528 ----
-
- bootstrap: as.new force
- $(MAKE) stage1
- ! rm -f stage && $(SYMLINK) stage1 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
- $(MAKE) stage2
- ! rm -f stage && $(SYMLINK) stage2 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
- $(MAKE) comparison against=stage2
-
- bootstrap2: force
- ! rm -f stage && $(SYMLINK) stage1 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
- $(MAKE) stage2
- ! rm -f stage && $(SYMLINK) stage2 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
- $(MAKE) comparison against=stage2
-
- bootstrap3: force
- ! rm -f stage && $(SYMLINK) stage2 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
- $(MAKE) comparison against=stage2
-
- ***************
- *** 522,538 ****
- stage1: force
- -mkdir stage1
- -mv $(STAGESTUFF) stage1
- ! if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi
-
- stage2: force
- -mkdir stage2
- -mv $(STAGESTUFF) stage2
- ! if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi
-
- stage3: force
- -mkdir stage3
- -mv $(STAGESTUFF) stage3
- ! if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi
-
- against=stage2
-
- --- 530,546 ----
- stage1: force
- -mkdir stage1
- -mv $(STAGESTUFF) stage1
- ! if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; $(SYMLINK) as.new as) ; fi
-
- stage2: force
- -mkdir stage2
- -mv $(STAGESTUFF) stage2
- ! if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; $(SYMLINK) as.new as) ; fi
-
- stage3: force
- -mkdir stage3
- -mv $(STAGESTUFF) stage3
- ! if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; $(SYMLINK) as.new as) ; fi
-
- against=stage2
-
- diff -rc --new-file binutils-2.5.2-base/gas/as.c binutils-2.5.2/gas/as.c
- *** binutils-2.5.2-base/gas/as.c Wed Oct 19 22:52:37 1994
- --- binutils-2.5.2/gas/as.c Tue Feb 14 19:14:26 1995
- ***************
- *** 51,56 ****
- --- 51,60 ----
- #endif /* __STDC__ */
- #endif /* SIGTY */
-
- + #ifndef __amigados__
- + #define HAVE_SBRK
- + #endif
- +
- #if 0
- /* Not currently used. */
- static SIGTY got_sig PARAMS ((int sig));
- ***************
- *** 447,459 ****
- --- 451,467 ----
- if (flag_print_statistics)
- {
- extern char **environ;
- + #ifdef HAVE_SBRK
- char *lim = (char *) sbrk (0);
- + #endif
- long run_time = get_run_time () - start_time;
-
- fprintf (stderr, "%s: total time in assembly: %ld.%06ld\n",
- myname, run_time / 1000000, run_time % 1000000);
- + #ifdef HAVE_SBRK
- fprintf (stderr, "%s: data size %ld\n",
- myname, (long) (lim - (char *) &environ));
- + #endif
- }
-
- /* Use exit instead of return, because under VMS environments they
- diff -rc --new-file binutils-2.5.2-base/gas/config/amigados.mh binutils-2.5.2/gas/config/amigados.mh
- *** binutils-2.5.2-base/gas/config/amigados.mh Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/gas/config/amigados.mh Mon Mar 27 11:27:26 1995
- ***************
- *** 0 ****
- --- 1,13 ----
- + # Host makefile fragment for Commodore Amiga running AmigaDOS.
- +
- + # There is no standard system compiler. Assume use GNU C.
- + CC = gcc
- + # There is no support for -g yet. But use -O instead.
- + CFLAGS = -O
- + # We have both types of links under AmigaDOS with GNU
- + # utils, however the links need to be made in canonical
- + # AmigaDOS format (foo:bar/bell/file) rather than UNIX
- + # format (/foo/bar/bell/file). When this is fixed, then
- + # these can go away.
- + SYMLINK = cp
- + HARDLINK = cp
- diff -rc --new-file binutils-2.5.2-base/gas/config/tc-m68k.c binutils-2.5.2/gas/config/tc-m68k.c
- *** binutils-2.5.2-base/gas/config/tc-m68k.c Thu Oct 27 23:11:43 1994
- --- binutils-2.5.2/gas/config/tc-m68k.c Fri Feb 10 15:43:30 1995
- ***************
- *** 554,561 ****
- --- 554,563 ----
- {"even", s_even, 0},
- {"skip", s_space, 0},
- {"proc", s_proc, 0},
- + #ifndef amigados
- #ifdef TE_SUN3
- {"align", s_align_bytes, 0},
- + #endif
- #endif
- {0, 0, 0}
- };
- diff -rc --new-file binutils-2.5.2-base/gas/configure binutils-2.5.2/gas/configure
- *** binutils-2.5.2-base/gas/configure Tue Nov 1 23:17:52 1994
- --- binutils-2.5.2/gas/configure Fri Feb 10 15:43:32 1995
- ***************
- *** 1,7 ****
- #!/bin/sh
-
- # Guess values for system-dependent variables and create Makefiles.
- ! # Generated automatically using autoconf version 2.0
- # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
- #
- # This configure script is free software; the Free Software Foundation
- --- 1,7 ----
- #!/bin/sh
-
- # Guess values for system-dependent variables and create Makefiles.
- ! # Generated automatically using autoconf version 2.1
- # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
- #
- # This configure script is free software; the Free Software Foundation
- ***************
- *** 9,50 ****
-
- # Defaults:
- ac_help=
- ! ac_default_prefix=/usr/local
- # Any additions from configure.in:
- ac_help="$ac_help
- bfd-assembler use BFD back end for writing object files"
-
- - # Omit some internal or obsolete options to make the list less imposing.
- - ac_usage="Usage: configure [options] [host]
- - Options: [defaults in brackets after descriptions]
- - Configuration:
- - --cache-file=FILE cache test results in FILE
- - --help print this message
- - --no-create do not create output files
- - --quiet, --silent do not print \`checking...' messages
- - --version print the version of autoconf that created configure
- - Directory and file names:
- - --prefix=PREFIX install architecture-independent files in PREFIX
- - [$ac_default_prefix]
- - --exec-prefix=PREFIX install architecture-dependent files in PREFIX
- - [same as prefix]
- - --srcdir=DIR find the sources in DIR [configure dir or ..]
- - --program-prefix=PREFIX prepend PREFIX to installed program names
- - --program-suffix=SUFFIX append SUFFIX to installed program names
- - --program-transform-name=PROGRAM run sed PROGRAM on installed program names
- - Host type:
- - --build=BUILD configure for building on BUILD [BUILD=HOST]
- - --host=HOST configure for HOST [guessed]
- - --target=TARGET configure for TARGET [TARGET=HOST]
- - Features and packages:
- - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- - --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- - --x-includes=DIR X include files are in DIR
- - --x-libraries=DIR X library files are in DIR
- - --enable and --with options recognized:$ac_help"
- -
- # Initialize some variables set by options.
- # The variables have the same names as the options, with
- # dashes changed to underlines.
- --- 9,19 ----
-
- # Defaults:
- ac_help=
- ! ac_default_prefix=/gnu
- # Any additions from configure.in:
- ac_help="$ac_help
- bfd-assembler use BFD back end for writing object files"
-
- # Initialize some variables set by options.
- # The variables have the same names as the options, with
- # dashes changed to underlines.
- ***************
- *** 82,88 ****
- fi
-
- case "$ac_option" in
- ! -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
-
- --- 51,57 ----
- fi
-
- case "$ac_option" in
- ! -*=*) ac_optarg=`/bin/echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
-
- ***************
- *** 103,123 ****
- cache_file="$ac_optarg" ;;
-
- -disable-* | --disable-*)
- ! ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that are not valid shell variable names.
- ! if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ! ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
-
- -enable-* | --enable-*)
- ! ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- ! if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ! ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- --- 72,92 ----
- cache_file="$ac_optarg" ;;
-
- -disable-* | --disable-*)
- ! ac_feature=`/bin/echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that are not valid shell variable names.
- ! if test -n "`/bin/echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ! ac_feature=`/bin/echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
-
- -enable-* | --enable-*)
- ! ac_feature=`/bin/echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- ! if test -n "`/bin/echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ! ac_feature=`/bin/echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- ***************
- *** 138,145 ****
- with_gas=yes ;;
-
- -help | --help | --hel | --he)
- cat << EOF
- ! $ac_usage
- EOF
- exit 0 ;;
-
- --- 107,144 ----
- with_gas=yes ;;
-
- -help | --help | --hel | --he)
- + # Omit some internal or obsolete options to make the list less imposing.
- + # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
- ! Usage: configure [options] [host]
- ! Options: [defaults in brackets after descriptions]
- ! Configuration:
- ! --cache-file=FILE cache test results in FILE
- ! --help print this message
- ! --no-create do not create output files
- ! --quiet, --silent do not print \`checking...' messages
- ! --version print the version of autoconf that created configure
- ! Directory and file names:
- ! --prefix=PREFIX install architecture-independent files in PREFIX
- ! [$ac_default_prefix]
- ! --exec-prefix=PREFIX install architecture-dependent files in PREFIX
- ! [same as prefix]
- ! --srcdir=DIR find the sources in DIR [configure dir or ..]
- ! --program-prefix=PREFIX prepend PREFIX to installed program names
- ! --program-suffix=SUFFIX append SUFFIX to installed program names
- ! --program-transform-name=PROGRAM run sed PROGRAM on installed program names
- ! Host type:
- ! --build=BUILD configure for building on BUILD [BUILD=HOST]
- ! --host=HOST configure for HOST [guessed]
- ! --target=TARGET configure for TARGET [TARGET=HOST]
- ! Features and packages:
- ! --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- ! --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- ! --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- ! --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- ! --x-includes=DIR X include files are in DIR
- ! --x-libraries=DIR X library files are in DIR
- ! --enable and --with options recognized:$ac_help
- EOF
- exit 0 ;;
-
- ***************
- *** 219,234 ****
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers)
- ! echo "configure generated by autoconf version 2.0"
- exit 0 ;;
-
- -with-* | --with-*)
- ! ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- ! if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ! ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- --- 218,233 ----
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers)
- ! echo "configure generated by autoconf version 2.1"
- exit 0 ;;
-
- -with-* | --with-*)
- ! ac_package=`/bin/echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- ! if test -n "`/bin/echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ! ac_package=`/bin/echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- ***************
- *** 236,247 ****
- eval "with_${ac_package}='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ! ac_package=`echo $ac_option|sed -e 's/-*without-//'`
- # Reject names that are not valid shell variable names.
- ! if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ! ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
-
- --x)
- --- 235,246 ----
- eval "with_${ac_package}='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ! ac_package=`/bin/echo $ac_option|sed -e 's/-*without-//'`
- # Reject names that are not valid shell variable names.
- ! if test -n "`/bin/echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ! ac_package=`/bin/echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
-
- --x)
- ***************
- *** 266,272 ****
- ;;
-
- *)
- ! if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- --- 265,271 ----
- ;;
-
- *)
- ! if test -n "`/bin/echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- ***************
- *** 279,285 ****
- done
-
- if test -n "$ac_prev"; then
- ! { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
- fi
-
- trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
- --- 278,284 ----
- done
-
- if test -n "$ac_prev"; then
- ! { echo "configure: error: missing argument to --`/bin/echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
- fi
-
- trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
- ***************
- *** 329,335 ****
- # confdefs.h avoids OS command line length limits that DEFS can exceed.
- rm -rf conftest* confdefs.h
- # AIX cpp loses on an empty file, so make sure it contains at least a newline.
- ! echo > confdefs.h
-
- # A filename unique to this package, relative to the directory that
- # configure is in, which we can look for to find out if srcdir is correct.
- --- 328,334 ----
- # confdefs.h avoids OS command line length limits that DEFS can exceed.
- rm -rf conftest* confdefs.h
- # AIX cpp loses on an empty file, so make sure it contains at least a newline.
- ! /bin/echo > confdefs.h
-
- # A filename unique to this package, relative to the directory that
- # configure is in, which we can look for to find out if srcdir is correct.
- ***************
- *** 340,346 ****
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_prog=$0
- ! ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- --- 339,345 ----
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_prog=$0
- ! ac_confdir=`/bin/echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- ***************
- *** 356,362 ****
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
- fi
- fi
- ! srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-
- # Prefer explicitly selected file to automatically selected ones.
- if test -z "$CONFIG_SITE"; then
- --- 355,361 ----
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
- fi
- fi
- ! srcdir=`/bin/echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-
- # Prefer explicitly selected file to automatically selected ones.
- if test -z "$CONFIG_SITE"; then
- ***************
- *** 460,466 ****
- else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
- fi
-
- ! echo $ac_n "checking host system type""... $ac_c" 1>&4
-
- host_alias=$host
- case "$host_alias" in
- --- 459,465 ----
- else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
- fi
-
- ! /bin/echo $ac_n "checking host system type""... $ac_c" 1>&4
-
- host_alias=$host
- case "$host_alias" in
- ***************
- *** 475,486 ****
- esac
-
- host=`$ac_config_sub $host_alias`
- ! host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- ! echo "$ac_t""$host" 1>&4
-
- ! echo $ac_n "checking target system type""... $ac_c" 1>&4
-
- target_alias=$target
- case "$target_alias" in
- --- 474,485 ----
- esac
-
- host=`$ac_config_sub $host_alias`
- ! host_cpu=`/bin/echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! host_vendor=`/bin/echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! host_os=`/bin/echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- ! /bin/echo "$ac_t""$host" 1>&4
-
- ! /bin/echo $ac_n "checking target system type""... $ac_c" 1>&4
-
- target_alias=$target
- case "$target_alias" in
- ***************
- *** 492,503 ****
- esac
-
- target=`$ac_config_sub $target_alias`
- ! target_cpu=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! target_vendor=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! target_os=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- ! echo "$ac_t""$target" 1>&4
-
- ! echo $ac_n "checking build system type""... $ac_c" 1>&4
-
- build_alias=$build
- case "$build_alias" in
- --- 491,502 ----
- esac
-
- target=`$ac_config_sub $target_alias`
- ! target_cpu=`/bin/echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! target_vendor=`/bin/echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! target_os=`/bin/echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- ! /bin/echo "$ac_t""$target" 1>&4
-
- ! /bin/echo $ac_n "checking build system type""... $ac_c" 1>&4
-
- build_alias=$build
- case "$build_alias" in
- ***************
- *** 509,518 ****
- esac
-
- build=`$ac_config_sub $build_alias`
- ! build_cpu=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! build_vendor=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! build_os=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- ! echo "$ac_t""$build" 1>&4
-
- test "$host_alias" != "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- --- 508,517 ----
- esac
-
- build=`$ac_config_sub $build_alias`
- ! build_cpu=`/bin/echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! build_vendor=`/bin/echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! build_os=`/bin/echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- ! /bin/echo "$ac_t""$build" 1>&4
-
- test "$host_alias" != "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- ***************
- *** 523,529 ****
- else
- # Double any \ or $.
- echo 's,\\,\\\\,g; s,\$,$$,g' > conftestsed
- ! program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
- rm -f conftestsed
- fi
- test "$program_prefix" != NONE &&
- --- 522,528 ----
- else
- # Double any \ or $.
- echo 's,\\,\\\\,g; s,\$,$$,g' > conftestsed
- ! program_transform_name="`/bin/echo $program_transform_name|sed -f conftestsed`"
- rm -f conftestsed
- fi
- test "$program_prefix" != NONE &&
- ***************
- *** 621,627 ****
- i960-*-vxworks5.*) obj_format=coff emulation=ic960 gas_target=ic960coff ;;
- i960-*-vxworks*) obj_format=bout ;;
-
- ! m68k-wrs-vxworks | m68k-ericsson-ose | m68k-*-sunos*)
- obj_format=aout emulation=sun3 ;;
- m68k-motorola-sysv) obj_format=coff gas_target=m68kcoff emulation=delta ;;
- m68k-bull-sysv3*) obj_format=coff gas_target=m68kcoff emulation=dpx2 ;;
- --- 620,626 ----
- i960-*-vxworks5.*) obj_format=coff emulation=ic960 gas_target=ic960coff ;;
- i960-*-vxworks*) obj_format=bout ;;
-
- ! m68k-wrs-vxworks | m68k-ericsson-ose | m68k-*-sunos* | m68*-cbm-amigados*)
- obj_format=aout emulation=sun3 ;;
- m68k-motorola-sysv) obj_format=coff gas_target=m68kcoff emulation=delta ;;
- m68k-bull-sysv3*) obj_format=coff gas_target=m68kcoff emulation=dpx2 ;;
- ***************
- *** 816,825 ****
- EOF
-
-
- ! echo $ac_n "checking for CC""... $ac_c" 1>&4
- test -z "$CC" && CC=`egrep '^CC *=' ../Makefile | tail -1 | sed 's/^CC *= *//'`
- test -z "$CC" && CC=cc
- ! echo "$ac_t""setting CC to $CC" 1>&4
-
- # Find out if we are using GNU C, under whatever name.
- cat > conftest.c <<EOF
- --- 815,824 ----
- EOF
-
-
- ! /bin/echo $ac_n "checking for CC""... $ac_c" 1>&4
- test -z "$CC" && CC=`egrep '^CC *=' ../Makefile | tail -1 | sed 's/^CC *= *//'`
- test -z "$CC" && CC=cc
- ! /bin/echo "$ac_t""setting CC to $CC" 1>&4
-
- # Find out if we are using GNU C, under whatever name.
- cat > conftest.c <<EOF
- ***************
- *** 845,859 ****
- # AFS /usr/afsws/bin/install, which mishandles nonexistent args
- # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
- # ./install, which can be erroneously created by make from ./install.sh.
- ! echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&4
- if test -z "$INSTALL"; then
- if eval "test \"`echo '${'ac_cv_path_install'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- case "$ac_dir" in
- ! ''|.|/etc|/usr/sbin|/usr/etc|/sbin|/usr/afsws/bin|/usr/ucb) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
- --- 844,858 ----
- # AFS /usr/afsws/bin/install, which mishandles nonexistent args
- # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
- # ./install, which can be erroneously created by make from ./install.sh.
- ! /bin/echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&4
- if test -z "$INSTALL"; then
- if eval "test \"`echo '${'ac_cv_path_install'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- case "$ac_dir" in
- ! ''|.|/gnu/etc) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
- ***************
- *** 878,884 ****
- fi
- INSTALL="$ac_cv_path_install"
- fi
- ! echo "$ac_t""$INSTALL" 1>&4
-
- # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
- # It thinks the first close brace ends the variable substitution.
- --- 877,883 ----
- fi
- INSTALL="$ac_cv_path_install"
- fi
- ! /bin/echo "$ac_t""$INSTALL" 1>&4
-
- # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
- # It thinks the first close brace ends the variable substitution.
- ***************
- *** 887,900 ****
- test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-
- ! echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&4
- # On Suns, sometimes $CPP names a directory.
- if test -n "$CPP" && test -d "$CPP"; then
- CPP=
- fi
- if test -z "$CPP"; then
- if eval "test \"`echo '${'ac_cv_prog_CPP'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- --- 886,899 ----
- test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-
- ! /bin/echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&4
- # On Suns, sometimes $CPP names a directory.
- if test -n "$CPP" && test -d "$CPP"; then
- CPP=
- fi
- if test -z "$CPP"; then
- if eval "test \"`echo '${'ac_cv_prog_CPP'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- ***************
- *** 902,908 ****
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
- ! #line 906 "configure"
- #include "confdefs.h"
- #include <assert.h>
- Syntax Error
- --- 901,907 ----
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
- ! #line 905 "configure"
- #include "confdefs.h"
- #include <assert.h>
- Syntax Error
- ***************
- *** 912,922 ****
- if test -z "$ac_err"; then
- :
- else
- ! echo "$ac_err" >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
- ! #line 920 "configure"
- #include "confdefs.h"
- #include <assert.h>
- Syntax Error
- --- 911,921 ----
- if test -z "$ac_err"; then
- :
- else
- ! /bin/echo "$ac_err" >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
- ! #line 919 "configure"
- #include "confdefs.h"
- #include <assert.h>
- Syntax Error
- ***************
- *** 926,932 ****
- if test -z "$ac_err"; then
- :
- else
- ! echo "$ac_err" >&5
- rm -rf conftest*
- CPP=/lib/cpp
- fi
- --- 925,931 ----
- if test -z "$ac_err"; then
- :
- else
- ! /bin/echo "$ac_err" >&5
- rm -rf conftest*
- CPP=/lib/cpp
- fi
- ***************
- *** 937,953 ****
- fi
- fi
- CPP="$ac_cv_prog_CPP"
- ! echo "$ac_t""$CPP" 1>&4
-
- for ac_hdr in string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h
- do
- ! ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
- ! echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 951 "configure"
- #include "confdefs.h"
- #include <$ac_hdr>
- EOF
- --- 936,952 ----
- fi
- fi
- CPP="$ac_cv_prog_CPP"
- ! /bin/echo "$ac_t""$CPP" 1>&4
-
- for ac_hdr in string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h
- do
- ! ac_safe=`/bin/echo "$ac_hdr" | tr './\055' '___'`
- ! /bin/echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 950 "configure"
- #include "confdefs.h"
- #include <$ac_hdr>
- EOF
- ***************
- *** 957,984 ****
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
- else
- ! echo "$ac_err" >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
- fi
- rm -f conftest*
- fi
- if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- ! echo "$ac_t""yes" 1>&4
- ! ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
- cat >> confdefs.h <<EOF
- #define $ac_tr_hdr 1
- EOF
-
- else
- ! echo "$ac_t""no" 1>&4
- fi
- done
-
-
- # Put this here so that autoconf's "cross-compiling" message doesn't confuse
- # people who are not cross-compiling but are compiling cross-assemblers.
- ! echo $ac_n "checking whether compiling a cross-assembler""... $ac_c" 1>&4
- if test "${host}" = "${target}"; then
- cross_gas=no
- else
- --- 956,983 ----
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
- else
- ! /bin/echo "$ac_err" >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
- fi
- rm -f conftest*
- fi
- if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- ! /bin/echo "$ac_t""yes" 1>&4
- ! ac_tr_hdr=HAVE_`/bin/echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
- cat >> confdefs.h <<EOF
- #define $ac_tr_hdr 1
- EOF
-
- else
- ! /bin/echo "$ac_t""no" 1>&4
- fi
- done
-
-
- # Put this here so that autoconf's "cross-compiling" message doesn't confuse
- # people who are not cross-compiling but are compiling cross-assemblers.
- ! /bin/echo $ac_n "checking whether compiling a cross-assembler""... $ac_c" 1>&4
- if test "${host}" = "${target}"; then
- cross_gas=no
- else
- ***************
- *** 988,1005 ****
- EOF
-
- fi
- ! echo "$ac_t""$cross_gas" 1>&4
-
- # If we cannot run a trivial program, we must be cross compiling.
- ! echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_c_cross'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- if test "$cross_compiling" = yes; then
- ac_cv_cross=yes
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1003 "configure"
- #include "confdefs.h"
- main(){return(0);}
- EOF
- --- 987,1004 ----
- EOF
-
- fi
- ! /bin/echo "$ac_t""$cross_gas" 1>&4
-
- # If we cannot run a trivial program, we must be cross compiling.
- ! /bin/echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_c_cross'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- if test "$cross_compiling" = yes; then
- ac_cv_cross=yes
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1002 "configure"
- #include "confdefs.h"
- main(){return(0);}
- EOF
- ***************
- *** 1013,1028 ****
- rm -fr conftest*
- fi
- cross_compiling=$ac_cv_c_cross
- ! echo "$ac_t""$ac_cv_c_cross" 1>&4
-
- # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
- # for constant arguments. Useless!
- ! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_header_alloca_h'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1026 "configure"
- #include "confdefs.h"
- #include <alloca.h>
- int main() { return 0; }
- --- 1012,1027 ----
- rm -fr conftest*
- fi
- cross_compiling=$ac_cv_c_cross
- ! /bin/echo "$ac_t""$ac_cv_c_cross" 1>&4
-
- # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
- # for constant arguments. Useless!
- ! /bin/echo $ac_n "checking for working alloca.h""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_header_alloca_h'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1025 "configure"
- #include "confdefs.h"
- #include <alloca.h>
- int main() { return 0; }
- ***************
- *** 1040,1046 ****
- rm -f conftest*
-
- fi
- ! echo "$ac_t""$ac_cv_header_alloca_h" 1>&4
- if test $ac_cv_header_alloca_h = yes; then
- cat >> confdefs.h <<\EOF
- #define HAVE_ALLOCA_H 1
- --- 1039,1045 ----
- rm -f conftest*
-
- fi
- ! /bin/echo "$ac_t""$ac_cv_header_alloca_h" 1>&4
- if test $ac_cv_header_alloca_h = yes; then
- cat >> confdefs.h <<\EOF
- #define HAVE_ALLOCA_H 1
- ***************
- *** 1048,1059 ****
-
- fi
-
- ! echo $ac_n "checking for alloca""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_func_alloca'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1057 "configure"
- #include "confdefs.h"
-
- #ifdef __GNUC__
- --- 1047,1058 ----
-
- fi
-
- ! /bin/echo $ac_n "checking for alloca""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_func_alloca'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1056 "configure"
- #include "confdefs.h"
-
- #ifdef __GNUC__
- ***************
- *** 1087,1093 ****
- rm -f conftest*
-
- fi
- ! echo "$ac_t""$ac_cv_func_alloca" 1>&4
- if test $ac_cv_func_alloca = yes; then
- cat >> confdefs.h <<\EOF
- #define HAVE_ALLOCA 1
- --- 1086,1092 ----
- rm -f conftest*
-
- fi
- ! /bin/echo "$ac_t""$ac_cv_func_alloca" 1>&4
- if test $ac_cv_func_alloca = yes; then
- cat >> confdefs.h <<\EOF
- #define HAVE_ALLOCA 1
- ***************
- *** 1106,1117 ****
- EOF
-
-
- ! echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_os_cray'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1115 "configure"
- #include "confdefs.h"
- #if defined(CRAY) && ! defined(CRAY2)
- webecray
- --- 1105,1116 ----
- EOF
-
-
- ! /bin/echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_os_cray'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1114 "configure"
- #include "confdefs.h"
- #if defined(CRAY) && ! defined(CRAY2)
- webecray
- ***************
- *** 1131,1146 ****
- rm -f conftest*
-
- fi
- ! echo "$ac_t""$ac_cv_os_cray" 1>&4
- if test $ac_cv_os_cray = yes; then
- ! echo $ac_n "checking for _getb67""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_func__getb67'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1142 "configure"
- #include "confdefs.h"
- #include <ctype.h> /* Arbitrary system header to define __stub macros. */
- int main() { return 0; }
- int t() {
-
- --- 1130,1148 ----
- rm -f conftest*
-
- fi
- ! /bin/echo "$ac_t""$ac_cv_os_cray" 1>&4
- if test $ac_cv_os_cray = yes; then
- ! /bin/echo $ac_n "checking for _getb67""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_func__getb67'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1141 "configure"
- #include "confdefs.h"
- #include <ctype.h> /* Arbitrary system header to define __stub macros. */
- + /* Override any gcc2 internal prototype to avoid an error. */
- + char _getb67();
- +
- int main() { return 0; }
- int t() {
-
- ***************
- *** 1150,1157 ****
- #if defined (__stub__getb67) || defined (__stub____getb67)
- choke me
- #else
- ! /* Override any gcc2 internal prototype to avoid an error. */
- ! char _getb67(); _getb67();
- #endif
-
- ; return 0; }
- --- 1152,1158 ----
- #if defined (__stub__getb67) || defined (__stub____getb67)
- choke me
- #else
- ! _getb67();
- #endif
-
- ; return 0; }
- ***************
- *** 1167,1187 ****
-
- fi
- if eval "test \"`echo '$ac_cv_func_'_getb67`\" = yes"; then
- ! echo "$ac_t""yes" 1>&4
- cat >> confdefs.h <<\EOF
- #define CRAY_STACKSEG_END _getb67
- EOF
-
- else
- ! echo "$ac_t""no" 1>&4
- ! echo $ac_n "checking for GETB67""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_func_GETB67'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1183 "configure"
- #include "confdefs.h"
- #include <ctype.h> /* Arbitrary system header to define __stub macros. */
- int main() { return 0; }
- int t() {
-
- --- 1168,1191 ----
-
- fi
- if eval "test \"`echo '$ac_cv_func_'_getb67`\" = yes"; then
- ! /bin/echo "$ac_t""yes" 1>&4
- cat >> confdefs.h <<\EOF
- #define CRAY_STACKSEG_END _getb67
- EOF
-
- else
- ! /bin/echo "$ac_t""no" 1>&4
- ! /bin/echo $ac_n "checking for GETB67""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_func_GETB67'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1184 "configure"
- #include "confdefs.h"
- #include <ctype.h> /* Arbitrary system header to define __stub macros. */
- + /* Override any gcc2 internal prototype to avoid an error. */
- + char GETB67();
- +
- int main() { return 0; }
- int t() {
-
- ***************
- *** 1191,1198 ****
- #if defined (__stub_GETB67) || defined (__stub___GETB67)
- choke me
- #else
- ! /* Override any gcc2 internal prototype to avoid an error. */
- ! char GETB67(); GETB67();
- #endif
-
- ; return 0; }
- --- 1195,1201 ----
- #if defined (__stub_GETB67) || defined (__stub___GETB67)
- choke me
- #else
- ! GETB67();
- #endif
-
- ; return 0; }
- ***************
- *** 1208,1228 ****
-
- fi
- if eval "test \"`echo '$ac_cv_func_'GETB67`\" = yes"; then
- ! echo "$ac_t""yes" 1>&4
- cat >> confdefs.h <<\EOF
- #define CRAY_STACKSEG_END GETB67
- EOF
-
- else
- ! echo "$ac_t""no" 1>&4
- ! echo $ac_n "checking for getb67""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_func_getb67'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1224 "configure"
- #include "confdefs.h"
- #include <ctype.h> /* Arbitrary system header to define __stub macros. */
- int main() { return 0; }
- int t() {
-
- --- 1211,1234 ----
-
- fi
- if eval "test \"`echo '$ac_cv_func_'GETB67`\" = yes"; then
- ! /bin/echo "$ac_t""yes" 1>&4
- cat >> confdefs.h <<\EOF
- #define CRAY_STACKSEG_END GETB67
- EOF
-
- else
- ! /bin/echo "$ac_t""no" 1>&4
- ! /bin/echo $ac_n "checking for getb67""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_func_getb67'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1227 "configure"
- #include "confdefs.h"
- #include <ctype.h> /* Arbitrary system header to define __stub macros. */
- + /* Override any gcc2 internal prototype to avoid an error. */
- + char getb67();
- +
- int main() { return 0; }
- int t() {
-
- ***************
- *** 1232,1239 ****
- #if defined (__stub_getb67) || defined (__stub___getb67)
- choke me
- #else
- ! /* Override any gcc2 internal prototype to avoid an error. */
- ! char getb67(); getb67();
- #endif
-
- ; return 0; }
- --- 1238,1244 ----
- #if defined (__stub_getb67) || defined (__stub___getb67)
- choke me
- #else
- ! getb67();
- #endif
-
- ; return 0; }
- ***************
- *** 1249,1261 ****
-
- fi
- if eval "test \"`echo '$ac_cv_func_'getb67`\" = yes"; then
- ! echo "$ac_t""yes" 1>&4
- cat >> confdefs.h <<\EOF
- #define CRAY_STACKSEG_END getb67
- EOF
-
- else
- ! echo "$ac_t""no" 1>&4
- fi
-
- fi
- --- 1254,1266 ----
-
- fi
- if eval "test \"`echo '$ac_cv_func_'getb67`\" = yes"; then
- ! /bin/echo "$ac_t""yes" 1>&4
- cat >> confdefs.h <<\EOF
- #define CRAY_STACKSEG_END getb67
- EOF
-
- else
- ! /bin/echo "$ac_t""no" 1>&4
- fi
-
- fi
- ***************
- *** 1264,1278 ****
-
- fi
-
- ! echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_c_stack_direction'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- if test "$cross_compiling" = yes; then
- ac_cv_c_stack_direction=0
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1276 "configure"
- #include "confdefs.h"
- find_stack_direction ()
- {
- --- 1269,1283 ----
-
- fi
-
- ! /bin/echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_c_stack_direction'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- if test "$cross_compiling" = yes; then
- ac_cv_c_stack_direction=0
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1281 "configure"
- #include "confdefs.h"
- find_stack_direction ()
- {
- ***************
- *** 1300,1319 ****
- fi
- rm -fr conftest*
- fi
- ! echo "$ac_t""$ac_cv_c_stack_direction" 1>&4
- cat >> confdefs.h <<EOF
- #define STACK_DIRECTION $ac_cv_c_stack_direction
- EOF
-
- fi
-
- ! echo $ac_n "checking for inline""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_c_inline'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- if test "$GCC" = yes; then
- cat > conftest.$ac_ext <<EOF
- ! #line 1317 "configure"
- #include "confdefs.h"
-
- int main() { return 0; }
- --- 1305,1324 ----
- fi
- rm -fr conftest*
- fi
- ! /bin/echo "$ac_t""$ac_cv_c_stack_direction" 1>&4
- cat >> confdefs.h <<EOF
- #define STACK_DIRECTION $ac_cv_c_stack_direction
- EOF
-
- fi
-
- ! /bin/echo $ac_n "checking for inline""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_c_inline'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- if test "$GCC" = yes; then
- cat > conftest.$ac_ext <<EOF
- ! #line 1322 "configure"
- #include "confdefs.h"
-
- int main() { return 0; }
- ***************
- *** 1334,1340 ****
- ac_cv_c_inline=no
- fi
- fi
- ! echo "$ac_t""$ac_cv_c_inline" 1>&4
- if test $ac_cv_c_inline = no; then
- cat >> confdefs.h <<\EOF
- #define inline __inline
- --- 1339,1345 ----
- ac_cv_c_inline=no
- fi
- fi
- ! /bin/echo "$ac_t""$ac_cv_c_inline" 1>&4
- if test $ac_cv_c_inline = no; then
- cat >> confdefs.h <<\EOF
- #define inline __inline
- ***************
- *** 1346,1359 ****
- # VMS doesn't have unlink.
- for ac_func in unlink remove
- do
- ! echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1355 "configure"
- #include "confdefs.h"
- #include <ctype.h> /* Arbitrary system header to define __stub macros. */
- int main() { return 0; }
- int t() {
-
- --- 1351,1367 ----
- # VMS doesn't have unlink.
- for ac_func in unlink remove
- do
- ! /bin/echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
- if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1360 "configure"
- #include "confdefs.h"
- #include <ctype.h> /* Arbitrary system header to define __stub macros. */
- + /* Override any gcc2 internal prototype to avoid an error. */
- + char $ac_func();
- +
- int main() { return 0; }
- int t() {
-
- ***************
- *** 1363,1370 ****
- #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
- choke me
- #else
- ! /* Override any gcc2 internal prototype to avoid an error. */
- ! char $ac_func(); $ac_func();
- #endif
-
- ; return 0; }
- --- 1371,1377 ----
- #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
- choke me
- #else
- ! $ac_func();
- #endif
-
- ; return 0; }
- ***************
- *** 1380,1393 ****
-
- fi
- if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- ! echo "$ac_t""yes" 1>&4
- ! ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
- cat >> confdefs.h <<EOF
- #define $ac_tr_func 1
- EOF
- break
- else
- ! echo "$ac_t""no" 1>&4
- fi
- done
-
- --- 1387,1400 ----
-
- fi
- if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- ! /bin/echo "$ac_t""yes" 1>&4
- ! ac_tr_func=HAVE_`/bin/echo $ac_func | tr '[a-z]' '[A-Z]'`
- cat >> confdefs.h <<EOF
- #define $ac_tr_func 1
- EOF
- break
- else
- ! /bin/echo "$ac_t""no" 1>&4
- fi
- done
-
- ***************
- *** 1395,1406 ****
- # Some non-ANSI preprocessors botch requoting inside strings. That's bad
- # enough, but on some of those systems, the assert macro relies on requoting
- # working properly!
- ! echo $ac_n "checking for working assert macro""... $ac_c" 1>&4
- if eval "test \"`echo '${'gas_cv_assert_ok'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1404 "configure"
- #include "confdefs.h"
- #include <assert.h>
- #include <stdio.h>
- --- 1402,1413 ----
- # Some non-ANSI preprocessors botch requoting inside strings. That's bad
- # enough, but on some of those systems, the assert macro relies on requoting
- # working properly!
- ! /bin/echo $ac_n "checking for working assert macro""... $ac_c" 1>&4
- if eval "test \"`echo '${'gas_cv_assert_ok'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1411 "configure"
- #include "confdefs.h"
- #include <assert.h>
- #include <stdio.h>
- ***************
- *** 1427,1433 ****
- rm -f conftest*
-
- fi
- ! echo "$ac_t""$gas_cv_assert_ok" 1>&4
- test $gas_cv_assert_ok = yes || cat >> confdefs.h <<\EOF
- #define BROKEN_ASSERT 1
- EOF
- --- 1434,1440 ----
- rm -f conftest*
-
- fi
- ! /bin/echo "$ac_t""$gas_cv_assert_ok" 1>&4
- test $gas_cv_assert_ok = yes || cat >> confdefs.h <<\EOF
- #define BROKEN_ASSERT 1
- EOF
- ***************
- *** 1452,1463 ****
- #endif
- "
-
- ! echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&4
- if eval "test \"`echo '${'gas_cv_decl_needed_malloc'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1461 "configure"
- #include "confdefs.h"
- $gas_test_headers
- int main() { return 0; }
- --- 1459,1470 ----
- #endif
- "
-
- ! /bin/echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&4
- if eval "test \"`echo '${'gas_cv_decl_needed_malloc'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1468 "configure"
- #include "confdefs.h"
- $gas_test_headers
- int main() { return 0; }
- ***************
- *** 1479,1485 ****
- rm -f conftest*
-
- fi
- ! echo "$ac_t""$gas_cv_decl_needed_malloc" 1>&4
- test $gas_cv_decl_needed_malloc = no || {
- cat >> confdefs.h <<\EOF
- #define NEED_DECLARATION_MALLOC 1
- --- 1486,1492 ----
- rm -f conftest*
-
- fi
- ! /bin/echo "$ac_t""$gas_cv_decl_needed_malloc" 1>&4
- test $gas_cv_decl_needed_malloc = no || {
- cat >> confdefs.h <<\EOF
- #define NEED_DECLARATION_MALLOC 1
- ***************
- *** 1488,1499 ****
- }
-
-
- ! echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&4
- if eval "test \"`echo '${'gas_cv_decl_needed_free'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1497 "configure"
- #include "confdefs.h"
- $gas_test_headers
- int main() { return 0; }
- --- 1495,1506 ----
- }
-
-
- ! /bin/echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&4
- if eval "test \"`echo '${'gas_cv_decl_needed_free'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1504 "configure"
- #include "confdefs.h"
- $gas_test_headers
- int main() { return 0; }
- ***************
- *** 1515,1521 ****
- rm -f conftest*
-
- fi
- ! echo "$ac_t""$gas_cv_decl_needed_free" 1>&4
- test $gas_cv_decl_needed_free = no || {
- cat >> confdefs.h <<\EOF
- #define NEED_DECLARATION_FREE 1
- --- 1522,1528 ----
- rm -f conftest*
-
- fi
- ! /bin/echo "$ac_t""$gas_cv_decl_needed_free" 1>&4
- test $gas_cv_decl_needed_free = no || {
- cat >> confdefs.h <<\EOF
- #define NEED_DECLARATION_FREE 1
- ***************
- *** 1527,1538 ****
- # Does errno.h declare errno, or do we have to add a separate declaration
- # for it?
-
- ! echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&4
- if eval "test \"`echo '${'gas_cv_decl_needed_errno'+set}'`\" = set"; then
- ! echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1536 "configure"
- #include "confdefs.h"
-
- #ifdef HAVE_ERRNO_H
- --- 1534,1545 ----
- # Does errno.h declare errno, or do we have to add a separate declaration
- # for it?
-
- ! /bin/echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&4
- if eval "test \"`echo '${'gas_cv_decl_needed_errno'+set}'`\" = set"; then
- ! /bin/echo $ac_n "(cached) $ac_c" 1>&4
- else
- cat > conftest.$ac_ext <<EOF
- ! #line 1543 "configure"
- #include "confdefs.h"
-
- #ifdef HAVE_ERRNO_H
- ***************
- *** 1558,1564 ****
- rm -f conftest*
-
- fi
- ! echo "$ac_t""$gas_cv_decl_needed_errno" 1>&4
- test $gas_cv_decl_needed_errno = no || {
- cat >> confdefs.h <<\EOF
- #define NEED_DECLARATION_ERRNO 1
- --- 1565,1571 ----
- rm -f conftest*
-
- fi
- ! /bin/echo "$ac_t""$gas_cv_decl_needed_errno" 1>&4
- test $gas_cv_decl_needed_errno = no || {
- cat >> confdefs.h <<\EOF
- #define NEED_DECLARATION_ERRNO 1
- ***************
- *** 1618,1624 ****
- : ${CONFIG_STATUS=./config.status}
-
- echo creating $CONFIG_STATUS
- ! rm -f $CONFIG_STATUS
- cat > $CONFIG_STATUS <<EOF
- #!/bin/sh
- # Generated automatically by configure.
- --- 1625,1633 ----
- : ${CONFIG_STATUS=./config.status}
-
- echo creating $CONFIG_STATUS
- ! # Some systems, like AmigaDOS, won't allow you to remove a script that is
- ! # being executed, so just move it out of the way instead.
- ! if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi
- cat > $CONFIG_STATUS <<EOF
- #!/bin/sh
- # Generated automatically by configure.
- ***************
- *** 1639,1645 ****
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- ! echo "$CONFIG_STATUS generated by autoconf version 2.0"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- --- 1648,1654 ----
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- ! /bin/echo "$CONFIG_STATUS generated by autoconf version 2.1"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- ***************
- *** 1703,1723 ****
- for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile]", defaulting infile="outfile.in".
- case "$ac_file" in
- ! *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
- ! ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- # Adjust relative srcdir, etc. for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ! ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/$ac_dir"
- # A "../" for each directory in $ac_dir_suffix.
- ! ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
- fi
- --- 1712,1732 ----
- for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile]", defaulting infile="outfile.in".
- case "$ac_file" in
- ! *:*) ac_file_in=`/bin/echo "$ac_file"|sed 's%.*:%%'`
- ! ac_file=`/bin/echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- # Adjust relative srcdir, etc. for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ! ac_dir=`/bin/echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/$ac_dir"
- # A "../" for each directory in $ac_dir_suffix.
- ! ac_dots=`/bin/echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
- fi
- ***************
- *** 1725,1731 ****
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- ! else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- --- 1734,1740 ----
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- ! else top_srcdir=`/bin/echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- ***************
- *** 1738,1744 ****
- esac
- echo creating "$ac_file"
- rm -f "$ac_file"
- ! configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
- # $configure_input" ;;
- --- 1747,1753 ----
- esac
- echo creating "$ac_file"
- rm -f "$ac_file"
- ! configure_input="Generated automatically from `/bin/echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
- # $configure_input" ;;
- ***************
- *** 1776,1783 ****
- for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile]", defaulting infile="outfile.in".
- case "$ac_file" in
- ! *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
- ! ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- --- 1785,1792 ----
- for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile]", defaulting infile="outfile.in".
- case "$ac_file" in
- ! *:*) ac_file_in=`/bin/echo "$ac_file"|sed 's%.*:%%'`
- ! ac_file=`/bin/echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- ***************
- *** 1841,1847 ****
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
- ! echo "$ac_file is unchanged"
- rm -f conftest.h
- else
- rm -f $ac_file
- --- 1850,1856 ----
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
- ! /bin/echo "$ac_file is unchanged"
- rm -f conftest.h
- else
- rm -f $ac_file
- ***************
- *** 1873,1885 ****
-
- # Make relative symlinks.
- # Remove last slash and all that follows it. Not all systems have dirname.
- ! ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
- # The dest file is in a subdirectory.
- test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
- ac_dest_dir_suffix="/$ac_dest_dir"
- # A "../" for each directory in $ac_dest_dir_suffix.
- ! ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dest_dir_suffix= ac_dots=
- fi
- --- 1882,1894 ----
-
- # Make relative symlinks.
- # Remove last slash and all that follows it. Not all systems have dirname.
- ! ac_dest_dir=`/bin/echo $ac_dest|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
- # The dest file is in a subdirectory.
- test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
- ac_dest_dir_suffix="/$ac_dest_dir"
- # A "../" for each directory in $ac_dest_dir_suffix.
- ! ac_dots=`/bin/echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dest_dir_suffix= ac_dots=
- fi
- ***************
- *** 1890,1897 ****
- esac
-
- # Make a symlink if possible; otherwise try a hard link.
- ! if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
- ! ln $srcdir/$ac_source $ac_dest; then :
- else
- { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
- fi
- --- 1899,1908 ----
- esac
-
- # Make a symlink if possible; otherwise try a hard link.
- ! # On the Amiga, we instead try a hard link first and then
- ! # just do a cp, since symbolic links still have rough edges.
- ! if ln $ac_rel_source $ac_dest 2>/dev/null ||
- ! cp -p $srcdir/$ac_source $ac_dest; then :
- else
- { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
- fi
- diff -rc --new-file binutils-2.5.2-base/gas/configure.in binutils-2.5.2/gas/configure.in
- *** binutils-2.5.2-base/gas/configure.in Tue Nov 1 23:17:54 1994
- --- binutils-2.5.2/gas/configure.in Fri Feb 10 15:43:32 1995
- ***************
- *** 39,44 ****
- --- 39,45 ----
- m683??) cpu_type=m68k ;;
- changequote([,])dnl
- m8*) cpu_type=m88k ;;
- + m68*) cpu_type=m68k ;;
- mips*el) cpu_type=mips endian=little;;
- mips*) cpu_type=mips endian=big ;;
- powerpc*) cpu_type=ppc ;;
- ***************
- *** 109,115 ****
- i960-*-vxworks5.*) obj_format=coff emulation=ic960 gas_target=ic960coff ;;
- i960-*-vxworks*) obj_format=bout ;;
-
- ! m68k-wrs-vxworks | m68k-ericsson-ose | m68k-*-sunos*)
- obj_format=aout emulation=sun3 ;;
- m68k-motorola-sysv) obj_format=coff gas_target=m68kcoff emulation=delta ;;
- m68k-bull-sysv3*) obj_format=coff gas_target=m68kcoff emulation=dpx2 ;;
- --- 110,116 ----
- i960-*-vxworks5.*) obj_format=coff emulation=ic960 gas_target=ic960coff ;;
- i960-*-vxworks*) obj_format=bout ;;
-
- ! m68k-wrs-vxworks | m68k-ericsson-ose | m68k-*-sunos* | m68*-cbm-amigados*)
- obj_format=aout emulation=sun3 ;;
- m68k-motorola-sysv) obj_format=coff gas_target=m68kcoff emulation=delta ;;
- m68k-bull-sysv3*) obj_format=coff gas_target=m68kcoff emulation=dpx2 ;;
- diff -rc --new-file binutils-2.5.2-base/ld/Makefile.in binutils-2.5.2/ld/Makefile.in
- *** binutils-2.5.2-base/ld/Makefile.in Wed Oct 19 18:36:47 1994
- --- binutils-2.5.2/ld/Makefile.in Sun Feb 12 22:20:00 1995
- ***************
- *** 21,27 ****
- srcdir = .
- objdir = .
-
- ! prefix = /usr/local
-
- program_transform_name =
- exec_prefix = $(prefix)
- --- 21,27 ----
- srcdir = .
- objdir = .
-
- ! prefix = /gnu
-
- program_transform_name =
- exec_prefix = $(prefix)
- ***************
- *** 58,64 ****
- AR = ar
- AR_FLAGS = qv
- CC = cc
- ! CFLAGS = -g
- MAKEINFO = makeinfo
- TEXI2DVI = texi2dvi
- RANLIB = ranlib
- --- 58,64 ----
- AR = ar
- AR_FLAGS = qv
- CC = cc
- ! CFLAGS = -O2
- MAKEINFO = makeinfo
- TEXI2DVI = texi2dvi
- RANLIB = ranlib
- ***************
- *** 66,72 ****
- BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
- LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
-
- ! # Seach path to override the default search path for -lfoo libraries.
- # If LIB_PATH is empty, the ones in the script (if any) are left alone.
- # (The default is usually /lib:usr/lib:/usr/local/lib, unless building
- # a cross-linker, in which case the default is empty. See genscripts.sh.)
- --- 66,72 ----
- BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
- LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
-
- ! # Search path to override the default search path for -lfoo libraries.
- # If LIB_PATH is empty, the ones in the script (if any) are left alone.
- # (The default is usually /lib:usr/lib:/usr/local/lib, unless building
- # a cross-linker, in which case the default is empty. See genscripts.sh.)
- ***************
- *** 203,209 ****
- ehppaelf.o emipsidtl.o esh.o eelf_i386.o ealpha.o \
- ei386lynx.o em68klynx.o esparclynx.o ecoff_sparc.o \
- eelf32ppc.o ei386go32.o em68kaout.o ei386linux.o \
- ! eelf32_sparc.o eelf64_sparc.o eriscix.o eelf32bmip.o eelf32lmip.o
-
- CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
- ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
- --- 203,210 ----
- ehppaelf.o emipsidtl.o esh.o eelf_i386.o ealpha.o \
- ei386lynx.o em68klynx.o esparclynx.o ecoff_sparc.o \
- eelf32ppc.o ei386go32.o em68kaout.o ei386linux.o \
- ! eelf32_sparc.o eelf64_sparc.o eriscix.o eelf32bmip.o eelf32lmip.o\
- ! eamiga.o eamiga_bss.o
-
- CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
- ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
- ***************
- *** 271,279 ****
-
- # These all start with e so 'make clean' can find them.
-
- ! GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${host_alias} ${target_alias} ${EMUL} "$(NATIVE_LIB_DIRS)"
- GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
-
- esun4.c: $(srcdir)/emulparams/sun4.sh \
- $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sun4
- --- 272,286 ----
-
- # These all start with e so 'make clean' can find them.
-
- ! GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${host_alias} ${target_alias} ${EMUL} "$(NATIVE_LIB_DIRS)" "$(LIB_PATH)"
- GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
-
- + eamiga.c: $(srcdir)/emulparams/amiga.sh\
- + $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga.sc ${GEN_DEPENDS}
- + ${GENSCRIPTS} amiga
- + eamiga_bss.c: $(srcdir)/emulparams/amiga_bss.sh\
- + $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga_bss.sc ${GEN_DEPENDS}
- + ${GENSCRIPTS} amiga_bss
- esun4.c: $(srcdir)/emulparams/sun4.sh \
- $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sun4
- diff -rc --new-file binutils-2.5.2-base/ld/config/amigados.mh binutils-2.5.2/ld/config/amigados.mh
- *** binutils-2.5.2-base/ld/config/amigados.mh Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/ld/config/amigados.mh Sun Feb 12 22:23:28 1995
- ***************
- *** 0 ****
- --- 1,24 ----
- + # Host: Commodore Amiga running AmigaDOS.
- + NAT_FILE= nm-amigados.h
- + NATDEPFILES=
- + XDEPFILES=
- + XM_FILE= xm-amigados.h
- + REGEX=regex.o
- + REGEX1=regex.o
- + # Use GNU C compiler
- + CC = gcc
- + # Use GNU install
- + INSTALL = /bin/install -c
- + # Don't use the mmalloc library, there is no sbrk() or mmap().
- + MMALLOC=
- + MMALLOC_DISABLE = -DNO_MMALLOC
- + # Host makefile fragment for Commodore Amiga running AmigaDOS
- + # Use the GNU C compiler.
- + CC=gcc
- + # Don't use -g, it doesn't do anything useful yet. Optimize though.
- + CFLAGS=-O2
- + # Search /local/os-lib, /local/lib, $(exec_prefix)/os-lib, and
- + # $(exec_prefix)/lib, in that order. I.E. user installed libraries
- + # take precedence over ones supplied with the compiler kit, and OS
- + # libraries take precedence over non-OS ones.
- + LIB_PATH=/local/os-lib:/local/lib:$(exec_prefix)/os-lib:$(exec_prefix)/lib
- diff -rc --new-file binutils-2.5.2-base/ld/config/amigados.mt binutils-2.5.2/ld/config/amigados.mt
- *** binutils-2.5.2-base/ld/config/amigados.mt Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/ld/config/amigados.mt Fri Feb 10 14:29:46 1995
- ***************
- *** 0 ****
- --- 1,9 ----
- + # Target: Commodore Amiga running AmigaDOS
- + TDEPFILES= m68k-pinsn.o exec.o m68k-tdep.o
- + TM_FILE= tm-amigados.h
- + EMUL=amiga
- + EMUL_EXTRA=amiga_bss
- + # Target config file for Commodore Amiga running AmigaDOS
- + DEFAULT_VECTOR=amiga_vec
- + SELECT_VECS=aout_amiga_vec
- + SELECT_ARCHITECTURES=bfd_m68k_arch
- diff -rc --new-file binutils-2.5.2-base/ld/configure.in binutils-2.5.2/ld/configure.in
- *** binutils-2.5.2-base/ld/configure.in Fri Oct 21 22:19:47 1994
- --- binutils-2.5.2/ld/configure.in Fri Feb 10 14:29:46 1995
- ***************
- *** 94,99 ****
- --- 94,100 ----
- m68*-*-coff) ld_target=m68k-coff ;;
- m68*-*-hpux*) ld_target=hp300hpux ;;
- m68*-*-lynxos*) ld_target=m68k-lynx ;;
- + m68*-cbm-amigados*) ld_target=amigados ;;
- m68*-*-*)
- echo '***' "Unknown m68k target vendor for ld:" ${target_vendor} 1>&2
- exit 1 ;;
- diff -rc --new-file binutils-2.5.2-base/ld/emulparams/amiga.sh binutils-2.5.2/ld/emulparams/amiga.sh
- *** binutils-2.5.2-base/ld/emulparams/amiga.sh Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/ld/emulparams/amiga.sh Fri Feb 10 14:29:48 1995
- ***************
- *** 0 ****
- --- 1,8 ----
- + SCRIPT_NAME=amiga
- + OUTPUT_FORMAT="amiga"
- + TEXT_START_ADDR=0x400
- + PAGE_SIZE=0x400
- + SEGMENT_SIZE=0x400
- + NONPAGED_TEXT_START_ADDR=0x400
- + TEMPLATE_NAME=amiga
- + ARCH=m68k
- diff -rc --new-file binutils-2.5.2-base/ld/emulparams/amiga_bss.sh binutils-2.5.2/ld/emulparams/amiga_bss.sh
- *** binutils-2.5.2-base/ld/emulparams/amiga_bss.sh Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/ld/emulparams/amiga_bss.sh Fri Feb 10 14:29:50 1995
- ***************
- *** 0 ****
- --- 1,8 ----
- + SCRIPT_NAME=amiga_bss
- + OUTPUT_FORMAT="amiga"
- + TEXT_START_ADDR=0x400
- + PAGE_SIZE=0x400
- + SEGMENT_SIZE=0x400
- + NONPAGED_TEXT_START_ADDR=0x400
- + TEMPLATE_NAME=amiga
- + ARCH=m68k
- diff -rc --new-file binutils-2.5.2-base/ld/emultempl/amiga.em binutils-2.5.2/ld/emultempl/amiga.em
- *** binutils-2.5.2-base/ld/emultempl/amiga.em Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/ld/emultempl/amiga.em Fri Feb 10 14:29:50 1995
- ***************
- *** 0 ****
- --- 1,168 ----
- + # This shell script emits a C file. -*- C -*-
- + # It does some substitutions.
- + cat >e${EMULATION_NAME}.c <<EOF
- + /* This file is is generated by a shell script. DO NOT EDIT! */
- +
- + /* emulate the original gld for the given ${EMULATION_NAME}
- + Copyright (C) 1991, 1993 Free Software Foundation, Inc.
- + Written by Steve Chamberlain steve@cygnus.com
- +
- + This file is part of GLD, the Gnu Linker.
- +
- + This program is free software; you can redistribute it and/or modify
- + it under the terms of the GNU General Public License as published by
- + the Free Software Foundation; either version 2 of the License, or
- + (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., 675 Mass Ave, Cambridge, MA 02139, USA. */
- +
- + #define TARGET_IS_${EMULATION_NAME}
- +
- + #include "bfd.h"
- + #include "sysdep.h"
- + #include "bfdlink.h"
- +
- + #include "ld.h"
- + #include "config.h"
- + #include "ldmain.h"
- + #include "ldemul.h"
- + #include "ldfile.h"
- + #include "ldmisc.h"
- + #include "ldexp.h"
- + #include "ldlang.h"
- +
- + #ifdef TARGET_IS_amiga
- + #include "libamiga.h"
- + #else
- + extern int amiga_base_relative; /* defined in amigadoslink.c */
- + #endif
- +
- + /* This is defined in bfd/amigados.c */
- + /* 1 means, write out debug hunk, when producing a load file */
- + extern int write_debug_hunk;
- +
- + /* This is the attribute to use for the next file */
- + extern int amiga_attribute;
- +
- + static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
- + static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
- +
- + static void
- + gld${EMULATION_NAME}_before_parse()
- + {
- + #ifdef TARGET_IS_amiga_bss
- + amiga_base_relative=1;
- + #endif
- +
- + #ifndef TARGET_ /* I.e., if not generic. */
- + ldfile_output_architecture = bfd_arch_${ARCH};
- + #endif /* not TARGET_ */
- + }
- +
- + #ifdef TARGET_IS_amiga
- +
- + static void
- + amiga_assign_attribute(lang_input_statement_type *);
- +
- + void
- + amiga_after_allocation()
- + {
- + #if 0 /* Does not work at the moment */
- + lang_for_each_input_file (amiga_assign_attribute);
- + #endif
- + }
- +
- + static void
- + amiga_assign_attribute(inp)
- + lang_input_statement_type *inp;
- + {
- + asection *s;
- +
- + if (inp->the_bfd->xvec->flavour==bfd_target_amiga_flavour)
- + {
- + for (s=inp->the_bfd->sections;s!=NULL;s=s->next)
- + amiga_per_section(s)->attribute=inp->amiga_attribute;
- + }
- +
- + }
- + #else
- + extern void
- + amiga_after_allocation();
- + #endif
- +
- + static char *
- + gld${EMULATION_NAME}_get_script(isfile)
- + int *isfile;
- + EOF
- +
- + if test -n "$COMPILE_IN"
- + then
- + # Scripts compiled in.
- +
- + # sed commands to quote an ld script as a C string.
- + sc="-f ${srcdir}/emultempl/stringify.sed"
- +
- + cat >>e${EMULATION_NAME}.c <<EOF
- + {
- + *isfile = 0;
- +
- + if (link_info.relocateable == true && config.build_constructors == true)
- + return
- + EOF
- + sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
- + echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
- + sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
- + echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
- + sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
- + echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
- + sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
- + echo ' ; else return' >> e${EMULATION_NAME}.c
- + sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
- + echo '; }' >> e${EMULATION_NAME}.c
- +
- + else
- + # Scripts read from the filesystem.
- +
- + cat >>e${EMULATION_NAME}.c <<EOF
- + {
- + *isfile = 1;
- +
- + if (link_info.relocateable == true && config.build_constructors == true)
- + return "ldscripts/${EMULATION_NAME}.xu";
- + else if (link_info.relocateable == true)
- + return "ldscripts/${EMULATION_NAME}.xr";
- + else if (!config.text_read_only)
- + return "ldscripts/${EMULATION_NAME}.xbn";
- + else if (!config.magic_demand_paged)
- + return "ldscripts/${EMULATION_NAME}.xn";
- + else
- + return "ldscripts/${EMULATION_NAME}.x";
- + }
- + EOF
- +
- + fi
- +
- + cat >>e${EMULATION_NAME}.c <<EOF
- +
- + struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
- + {
- + gld${EMULATION_NAME}_before_parse,
- + syslib_default,
- + hll_default,
- + after_parse_default,
- + amiga_after_allocation,
- + set_output_arch_default,
- + ldemul_default_target,
- + before_allocation_default,
- + gld${EMULATION_NAME}_get_script,
- + "${EMULATION_NAME}",
- + "${OUTPUT_FORMAT}"
- + };
- + EOF
- diff -rc --new-file binutils-2.5.2-base/ld/genscripts.sh binutils-2.5.2/ld/genscripts.sh
- *** binutils-2.5.2-base/ld/genscripts.sh Mon Sep 26 18:00:13 1994
- --- binutils-2.5.2/ld/genscripts.sh Sun Feb 12 22:31:44 1995
- ***************
- *** 15,21 ****
- target_alias=$4
- DEFAULT_EMULATION=$5
- NATIVE_LIB_DIRS=$6
- ! EMULATION_NAME=$7
-
- # Include the emulation-specific parameters:
- . ${srcdir}/emulparams/${EMULATION_NAME}.sh
- --- 15,22 ----
- target_alias=$4
- DEFAULT_EMULATION=$5
- NATIVE_LIB_DIRS=$6
- ! LIB_PATH=$7
- ! EMULATION_NAME=$8
-
- # Include the emulation-specific parameters:
- . ${srcdir}/emulparams/${EMULATION_NAME}.sh
- diff -rc --new-file binutils-2.5.2-base/ld/ldlang.c binutils-2.5.2/ld/ldlang.c
- *** binutils-2.5.2-base/ld/ldlang.c Tue Sep 20 21:15:58 1994
- --- binutils-2.5.2/ld/ldlang.c Fri Feb 10 14:29:52 1995
- ***************
- *** 296,301 ****
- --- 296,302 ----
- boolean add_to_list;
- {
- lang_input_statement_type *p;
- + extern int amiga_attribute;
-
- if (add_to_list)
- p = new_stat (lang_input_statement, stat_ptr);
- ***************
- *** 309,314 ****
- --- 310,318 ----
- lang_has_input_file = true;
- p->target = target;
- p->complained = false;
- + p->amiga_attribute=amiga_attribute; /* Amiga section attribute */
- + amiga_attribute=0; /* reset it */
- +
- switch (file_type)
- {
- case lang_input_file_is_symbols_only_enum:
- diff -rc --new-file binutils-2.5.2-base/ld/ldlang.h binutils-2.5.2/ld/ldlang.h
- *** binutils-2.5.2-base/ld/ldlang.h Tue Sep 20 21:16:01 1994
- --- binutils-2.5.2/ld/ldlang.h Fri Feb 10 14:29:54 1995
- ***************
- *** 229,234 ****
- --- 229,236 ----
- asection *common_section;
- asection *common_output_section;
- boolean complained;
- + /* Added for AMIGA support of section attributes */
- + int amiga_attribute;
- } lang_input_statement_type;
-
- typedef struct
- diff -rc --new-file binutils-2.5.2-base/ld/ldmain.c binutils-2.5.2/ld/ldmain.c
- *** binutils-2.5.2-base/ld/ldmain.c Wed Oct 26 05:23:55 1994
- --- binutils-2.5.2/ld/ldmain.c Tue Feb 14 18:53:44 1995
- ***************
- *** 45,50 ****
- --- 45,54 ----
-
- #include <string.h>
-
- + #ifndef __amigados__
- + #define HAVE_SBRK
- + #endif
- +
- static char *get_emulation PARAMS ((int, char **));
- static void set_scripts_dir PARAMS ((void));
-
- ***************
- *** 319,331 ****
- --- 323,339 ----
- if (config.stats)
- {
- extern char **environ;
- + #ifdef HAVE_SBRK
- char *lim = (char *) sbrk (0);
- + #endif
- long run_time = get_run_time () - start_time;
-
- fprintf (stderr, "%s: total time in link: %ld.%06ld\n",
- program_name, run_time / 1000000, run_time % 1000000);
- + #ifdef HAVE_SBRK
- fprintf (stderr, "%s: data size %ld\n", program_name,
- (long) (lim - (char *) &environ));
- + #endif
- }
-
- /* Prevent remove_output from doing anything, after a successful link. */
- diff -rc --new-file binutils-2.5.2-base/ld/lexsup.c binutils-2.5.2/ld/lexsup.c
- *** binutils-2.5.2-base/ld/lexsup.c Wed Oct 12 20:26:42 1994
- --- binutils-2.5.2/ld/lexsup.c Fri Feb 10 14:29:56 1995
- ***************
- *** 46,51 ****
- --- 46,55 ----
- static void set_default_dirlist PARAMS ((char *dirlist_ptr));
- static void set_section_start PARAMS ((char *sect, char *valstr));
-
- + /* Used by AMIGA linker */
- + extern int write_debug_hunk;
- + extern int amiga_attribute;
- +
- void
- parse_args (argc, argv)
- int argc;
- ***************
- *** 91,101 ****
- --- 95,113 ----
- #define OPTION_VERSION (OPTION_VERBOSE + 1)
- #define OPTION_WARN_COMMON (OPTION_VERSION + 1)
- #define OPTION_WARN_ONCE (OPTION_WARN_COMMON + 1)
- + /* These are added for AMIGA support of special features, like memory attributes and debug hunk*/
- + #define OPTION_AMIGA_CHIP (OPTION_WARN_ONCE + 1)
- + #define OPTION_AMIGA_FAST (OPTION_AMIGA_CHIP + 1)
- + #define OPTION_AMIGA_ATTRIBUTE (OPTION_AMIGA_FAST + 1)
- + #define OPTION_AMIGA_DEBUG (OPTION_AMIGA_ATTRIBUTE + 1)
-
- static struct option longopts[] = {
- + {"amiga-debug-hunk", no_argument, NULL, OPTION_AMIGA_DEBUG},
- + {"attribute", required_argument, NULL, OPTION_AMIGA_ATTRIBUTE},
- {"Bdynamic", no_argument, NULL, OPTION_CALL_SHARED},
- {"Bstatic", no_argument, NULL, OPTION_NON_SHARED},
- {"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
- + {"chip", no_argument, NULL, OPTION_AMIGA_CHIP},
- {"dc", no_argument, NULL, 'd'},
- {"defsym", required_argument, NULL, OPTION_DEFSYM},
- {"dll-verbose", no_argument, NULL, OPTION_VERSION}, /* Linux. */
- ***************
- *** 106,111 ****
- --- 118,124 ----
- {"EB", no_argument, NULL, OPTION_EB},
- {"EL", no_argument, NULL, OPTION_EL},
- {"end-group", no_argument, NULL, ')'},
- + {"fast", no_argument, NULL, OPTION_AMIGA_FAST},
- {"format", required_argument, NULL, 'b'},
- {"help", no_argument, NULL, OPTION_HELP},
- {"Map", required_argument, NULL, OPTION_MAP},
- ***************
- *** 420,425 ****
- --- 433,455 ----
- }
- lang_leave_group ();
- ingroup = 0;
- + break;
- + case OPTION_AMIGA_CHIP:
- + amiga_attribute=2; /* We do not use MEMF_FAST, so we do not have to include exec/memory.h*/
- + break;
- + case OPTION_AMIGA_FAST:
- + amiga_attribute=4;
- + break;
- + case OPTION_AMIGA_ATTRIBUTE:
- + {
- + char *end;
- + amiga_attribute = strtoul (optarg, &end, 0);
- + if (*end)
- + einfo ("%P%F: invalid number `%s'\n", optarg);
- + }
- + break;
- + case OPTION_AMIGA_DEBUG:
- + write_debug_hunk=1; /* Write out debug hunk */
- break;
- }
- }
- diff -rc --new-file binutils-2.5.2-base/ld/scripttempl/amiga.sc binutils-2.5.2/ld/scripttempl/amiga.sc
- *** binutils-2.5.2-base/ld/scripttempl/amiga.sc Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/ld/scripttempl/amiga.sc Fri Feb 10 14:29:58 1995
- ***************
- *** 0 ****
- --- 1,42 ----
- + cat <<EOF
- + OUTPUT_FORMAT("${OUTPUT_FORMAT}")
- + OUTPUT_ARCH(${ARCH})
- +
- + ${RELOCATING+${LIB_SEARCH_DIRS}}
- + ${STACKZERO+${RELOCATING+${STACKZERO}}}
- + ${SHLIB_PATH+${RELOCATING+${SHLIB_PATH}}}
- +
- + SECTIONS
- + {
- + ${RELOCATING+. = ${TEXT_START_ADDR};}
- + .text :
- + {
- + ${RELOCATING+___machtype = ABSOLUTE(0x0);}
- + ${RELOCATING+_stext = .;}
- + *(.text)
- + ${RELOCATING+_etext = .;}
- + ${RELOCATING+__etext = .;}
- + ${RELOCATING+___text_size = ABSOLUTE(_etext - _stext);}
- + ${PAD_TEXT+${RELOCATING+. = ${DATA_ALIGNMENT};}}
- + }
- + ${RELOCATING+. = ${DATA_ALIGNMENT};}
- + .data :
- + {
- + ${RELOCATING+_sdata = .;}
- + ${CONSTRUCTING+CONSTRUCTORS}
- + *(.data)
- + ${RELOCATING+_edata = .;}
- + ${RELOCATING+__edata = .;}
- + ${RELOCATING+___data_size = ABSOLUTE(_edata - _sdata);}
- + }
- + .bss :
- + {
- + ${RELOCATING+ __bss_start = .};
- + *(.bss)
- + *(COMMON)
- + ${RELOCATING+_end = ALIGN(4) };
- + ${RELOCATING+__end = ALIGN(4) };
- + ${RELOCATING+___bss_size = ABSOLUTE(_end - __bss_start);}
- + }
- + }
- + EOF
- diff -rc --new-file binutils-2.5.2-base/ld/scripttempl/amiga_bss.sc binutils-2.5.2/ld/scripttempl/amiga_bss.sc
- *** binutils-2.5.2-base/ld/scripttempl/amiga_bss.sc Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/ld/scripttempl/amiga_bss.sc Fri Feb 10 14:29:58 1995
- ***************
- *** 0 ****
- --- 1,43 ----
- + cat <<EOF
- + OUTPUT_FORMAT("${OUTPUT_FORMAT}")
- + OUTPUT_ARCH(${ARCH})
- +
- + ${RELOCATING+${LIB_SEARCH_DIRS}}
- + ${STACKZERO+${RELOCATING+${STACKZERO}}}
- + ${SHLIB_PATH+${RELOCATING+${SHLIB_PATH}}}
- +
- + SECTIONS
- + {
- + ${RELOCATING+. = ${TEXT_START_ADDR};}
- + .text :
- + {
- + ${RELOCATING+___machtype = ABSOLUTE(0x0);}
- + ${RELOCATING+_stext = .;}
- + *(.text)
- + ${RELOCATING+_etext = .;}
- + ${RELOCATING+__etext = .;}
- + ${RELOCATING+___text_size = ABSOLUTE(_etext - _stext);}
- + ${PAD_TEXT+${RELOCATING+. = ${DATA_ALIGNMENT};}}
- + }
- + ${RELOCATING+. = ${DATA_ALIGNMENT};}
- + .data :
- + {
- + ${RELOCATING+_sdata = .;}
- + ${CONSTRUCTING+CONSTRUCTORS}
- + *(.data)
- + ${RELOCATING+_edata = .;}
- + ${RELOCATING+__edata = .;}
- + ${RELOCATING+___data_size = ABSOLUTE(_edata - _sdata);}
- + ${RELOCATING+___bss_size = ABSOLUTE(_end - __bss_start);}
- + ${RELOCATING+___a4_init = (ABSOLUTE(ABSOLUTE(___data_size) + ABSOLUTE(___bss_size)) > ABSOLUTE(0x7fff)) ? 0x0 : 0x8000 ;}
- + }
- + .bss :
- + {
- + ${RELOCATING+ __bss_start = .};
- + *(.bss)
- + *(COMMON)
- + ${RELOCATING+_end = ALIGN(4) };
- + ${RELOCATING+__end = ALIGN(4) };
- + }
- + }
- + EOF
- diff -rc --new-file binutils-2.5.2-base/libiberty/config/mh-amigados binutils-2.5.2/libiberty/config/mh-amigados
- *** binutils-2.5.2-base/libiberty/config/mh-amigados Thu Jan 1 00:00:00 1970
- --- binutils-2.5.2/libiberty/config/mh-amigados Tue Feb 14 18:49:48 1995
- ***************
- *** 0 ****
- --- 1,15 ----
- + # Host configuration for Commodore Amiga running AmigaDOS.
- + # We don't actually use libmmalloc.a, since there is no sbrk(),
- + # but this allows us to compile it (and then ignore it).
- +
- + CC=gcc
- + # We don't need -g yet, so do -O instead.
- + CFLAGS=-O
- + MMALLOC=
- + MMALLOC_DISABLE = -DNO_MMALLOC
- + # Host makefile fragment for Commodore Amiga running AmigaDOS.
- +
- + # There is no standard system compiler. Assume use GNU C.
- + CC = gcc
- + # There is no support for -g yet. But use -O2 instead.
- + CFLAGS = -O2
- diff -rc --new-file binutils-2.5.2-base/libiberty/config.table binutils-2.5.2/libiberty/config.table
- *** binutils-2.5.2-base/libiberty/config.table Mon Sep 5 10:52:49 1994
- --- binutils-2.5.2/libiberty/config.table Fri Feb 10 14:30:00 1995
- ***************
- *** 22,27 ****
- --- 22,28 ----
- *-*-sysv4*) frag=mh-sysv4 ;;
- *-*-sysv*) frag=mh-sysv ;;
- *-*-go32) frag=mh-go32 ;;
- + *-*-amigados*) frag=mh-amigados ;;
- esac
-
- # xiberty sets xhost. Try to handle funky case of solaris 2 -> sun 4.
- diff -rc --new-file binutils-2.5.2-base/libiberty/xmalloc.c binutils-2.5.2/libiberty/xmalloc.c
- *** binutils-2.5.2-base/libiberty/xmalloc.c Wed Sep 14 21:06:41 1994
- --- binutils-2.5.2/libiberty/xmalloc.c Tue Feb 14 19:23:10 1995
- ***************
- *** 28,33 ****
- --- 28,37 ----
- #define size_t unsigned long
- #endif
-
- + #ifndef __amigados__
- + #define HAVE_SBRK
- + #endif
- +
- /* For systems with larger pointers than ints, these must be declared. */
- PTR malloc PARAMS ((size_t));
- PTR realloc PARAMS ((PTR, size_t));
- ***************
- *** 42,50 ****
- --- 46,58 ----
- xmalloc_set_program_name (s)
- const char *s;
- {
- + #ifdef HAVE_SBRK
- name = s;
- if (first_break == NULL)
- first_break = (char *) sbrk (0);
- + #else
- + return;
- + #endif
- }
-
- PTR
- ***************
- *** 58,63 ****
- --- 66,72 ----
- newmem = malloc (size);
- if (!newmem)
- {
- + #ifdef HAVE_SBRK
- extern char **environ;
- size_t allocated;
-
- ***************
- *** 69,74 ****
- --- 78,84 ----
- "\n%s%sCan not allocate %lu bytes after allocating %lu bytes\n",
- name, *name ? ": " : "",
- (unsigned long) size, (unsigned long) allocated);
- + #endif
- xexit (1);
- }
- return (newmem);
- ***************
- *** 89,94 ****
- --- 99,105 ----
- newmem = realloc (oldmem, size);
- if (!newmem)
- {
- + #ifdef HAVE_SBRK
- extern char **environ;
- size_t allocated;
-
- ***************
- *** 100,105 ****
- --- 111,117 ----
- "\n%s%sCan not reallocate %lu bytes after allocating %lu bytes\n",
- name, *name ? ": " : "",
- (unsigned long) size, (unsigned long) allocated);
- + #endif
- xexit (1);
- }
- return (newmem);
-