home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / src / diffs / gdb-4.12.diffs < prev    next >
Encoding:
Text File  |  1995-01-21  |  148.0 KB  |  3,577 lines

  1. diff -rc --new-file gdb-4.12/Product-Info /gnu/src/amiga/gdb-4.12/Product-Info
  2. *** gdb-4.12/Product-Info    Thu Jan  1 00:00:00 1970
  3. --- /gnu/src/amiga/gdb-4.12/Product-Info    Tue Jul 12 17:16:37 1994
  4. ***************
  5. *** 0 ****
  6. --- 1,33 ----
  7. + .name
  8. + gdb
  9. + .fullname
  10. + GNU debugger
  11. + .type
  12. + Programmer Tool
  13. + .short
  14. + GNU debugger (incomplete port)
  15. + .description
  16. + The purpose of a debugger such as GDB is to allow you to see what is
  17. + going on "inside" another program while it executes, or what another
  18. + program was doing at the moment it crashed.
  19. + GDB can do four main kinds of things (plus other things in support of
  20. + these) to help you catch bugs in the act: (1) start your program,
  21. + specifying anything that might affect its behavior, (2) make your
  22. + program stop on specified conditions, (3) examine what has happened,
  23. + when your program has stopped, (4) change things in your program, so
  24. + you can experiment with correcting the effects of one bug and go on to
  25. + learn about another.
  26. + You can use GDB to debug programs written in C, C++, and Modula-2.
  27. + Fortran support will be added when a GNU Fortran compiler is ready.
  28. + .version
  29. + 4.12
  30. + .author
  31. + Free Software Foundation
  32. + .requirements
  33. + Amiga binary requires ixemul.library.
  34. + .distribution
  35. + GNU Public License
  36. + .described-by
  37. + Fred Fish (fnf@amigalib.com)
  38. diff -rc --new-file gdb-4.12/bfd/COPYING /gnu/src/amiga/gdb-4.12/bfd/COPYING
  39. *** gdb-4.12/bfd/COPYING    Thu Jan  1 00:00:00 1970
  40. --- /gnu/src/amiga/gdb-4.12/bfd/COPYING    Thu Feb  3 12:40:45 1994
  41. ***************
  42. *** 0 ****
  43. --- 1,339 ----
  44. +             GNU GENERAL PUBLIC LICENSE
  45. +                Version 2, June 1991
  46. +  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  47. +                           675 Mass Ave, Cambridge, MA 02139, USA
  48. +  Everyone is permitted to copy and distribute verbatim copies
  49. +  of this license document, but changing it is not allowed.
  50. +                 Preamble
  51. +   The licenses for most software are designed to take away your
  52. + freedom to share and change it.  By contrast, the GNU General Public
  53. + License is intended to guarantee your freedom to share and change free
  54. + software--to make sure the software is free for all its users.  This
  55. + General Public License applies to most of the Free Software
  56. + Foundation's software and to any other program whose authors commit to
  57. + using it.  (Some other Free Software Foundation software is covered by
  58. + the GNU Library General Public License instead.)  You can apply it to
  59. + your programs, too.
  60. +   When we speak of free software, we are referring to freedom, not
  61. + price.  Our General Public Licenses are designed to make sure that you
  62. + have the freedom to distribute copies of free software (and charge for
  63. + this service if you wish), that you receive source code or can get it
  64. + if you want it, that you can change the software or use pieces of it
  65. + in new free programs; and that you know you can do these things.
  66. +   To protect your rights, we need to make restrictions that forbid
  67. + anyone to deny you these rights or to ask you to surrender the rights.
  68. + These restrictions translate to certain responsibilities for you if you
  69. + distribute copies of the software, or if you modify it.
  70. +   For example, if you distribute copies of such a program, whether
  71. + gratis or for a fee, you must give the recipients all the rights that
  72. + you have.  You must make sure that they, too, receive or can get the
  73. + source code.  And you must show them these terms so they know their
  74. + rights.
  75. +   We protect your rights with two steps: (1) copyright the software, and
  76. + (2) offer you this license which gives you legal permission to copy,
  77. + distribute and/or modify the software.
  78. +   Also, for each author's protection and ours, we want to make certain
  79. + that everyone understands that there is no warranty for this free
  80. + software.  If the software is modified by someone else and passed on, we
  81. + want its recipients to know that what they have is not the original, so
  82. + that any problems introduced by others will not reflect on the original
  83. + authors' reputations.
  84. +   Finally, any free program is threatened constantly by software
  85. + patents.  We wish to avoid the danger that redistributors of a free
  86. + program will individually obtain patent licenses, in effect making the
  87. + program proprietary.  To prevent this, we have made it clear that any
  88. + patent must be licensed for everyone's free use or not licensed at all.
  89. +   The precise terms and conditions for copying, distribution and
  90. + modification follow.
  91. +             GNU GENERAL PUBLIC LICENSE
  92. +    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  93. +   0. This License applies to any program or other work which contains
  94. + a notice placed by the copyright holder saying it may be distributed
  95. + under the terms of this General Public License.  The "Program", below,
  96. + refers to any such program or work, and a "work based on the Program"
  97. + means either the Program or any derivative work under copyright law:
  98. + that is to say, a work containing the Program or a portion of it,
  99. + either verbatim or with modifications and/or translated into another
  100. + language.  (Hereinafter, translation is included without limitation in
  101. + the term "modification".)  Each licensee is addressed as "you".
  102. + Activities other than copying, distribution and modification are not
  103. + covered by this License; they are outside its scope.  The act of
  104. + running the Program is not restricted, and the output from the Program
  105. + is covered only if its contents constitute a work based on the
  106. + Program (independent of having been made by running the Program).
  107. + Whether that is true depends on what the Program does.
  108. +   1. You may copy and distribute verbatim copies of the Program's
  109. + source code as you receive it, in any medium, provided that you
  110. + conspicuously and appropriately publish on each copy an appropriate
  111. + copyright notice and disclaimer of warranty; keep intact all the
  112. + notices that refer to this License and to the absence of any warranty;
  113. + and give any other recipients of the Program a copy of this License
  114. + along with the Program.
  115. + You may charge a fee for the physical act of transferring a copy, and
  116. + you may at your option offer warranty protection in exchange for a fee.
  117. +   2. You may modify your copy or copies of the Program or any portion
  118. + of it, thus forming a work based on the Program, and copy and
  119. + distribute such modifications or work under the terms of Section 1
  120. + above, provided that you also meet all of these conditions:
  121. +     a) You must cause the modified files to carry prominent notices
  122. +     stating that you changed the files and the date of any change.
  123. +     b) You must cause any work that you distribute or publish, that in
  124. +     whole or in part contains or is derived from the Program or any
  125. +     part thereof, to be licensed as a whole at no charge to all third
  126. +     parties under the terms of this License.
  127. +     c) If the modified program normally reads commands interactively
  128. +     when run, you must cause it, when started running for such
  129. +     interactive use in the most ordinary way, to print or display an
  130. +     announcement including an appropriate copyright notice and a
  131. +     notice that there is no warranty (or else, saying that you provide
  132. +     a warranty) and that users may redistribute the program under
  133. +     these conditions, and telling the user how to view a copy of this
  134. +     License.  (Exception: if the Program itself is interactive but
  135. +     does not normally print such an announcement, your work based on
  136. +     the Program is not required to print an announcement.)
  137. + These requirements apply to the modified work as a whole.  If
  138. + identifiable sections of that work are not derived from the Program,
  139. + and can be reasonably considered independent and separate works in
  140. + themselves, then this License, and its terms, do not apply to those
  141. + sections when you distribute them as separate works.  But when you
  142. + distribute the same sections as part of a whole which is a work based
  143. + on the Program, the distribution of the whole must be on the terms of
  144. + this License, whose permissions for other licensees extend to the
  145. + entire whole, and thus to each and every part regardless of who wrote it.
  146. + Thus, it is not the intent of this section to claim rights or contest
  147. + your rights to work written entirely by you; rather, the intent is to
  148. + exercise the right to control the distribution of derivative or
  149. + collective works based on the Program.
  150. + In addition, mere aggregation of another work not based on the Program
  151. + with the Program (or with a work based on the Program) on a volume of
  152. + a storage or distribution medium does not bring the other work under
  153. + the scope of this License.
  154. +   3. You may copy and distribute the Program (or a work based on it,
  155. + under Section 2) in object code or executable form under the terms of
  156. + Sections 1 and 2 above provided that you also do one of the following:
  157. +     a) Accompany it with the complete corresponding machine-readable
  158. +     source code, which must be distributed under the terms of Sections
  159. +     1 and 2 above on a medium customarily used for software interchange; or,
  160. +     b) Accompany it with a written offer, valid for at least three
  161. +     years, to give any third party, for a charge no more than your
  162. +     cost of physically performing source distribution, a complete
  163. +     machine-readable copy of the corresponding source code, to be
  164. +     distributed under the terms of Sections 1 and 2 above on a medium
  165. +     customarily used for software interchange; or,
  166. +     c) Accompany it with the information you received as to the offer
  167. +     to distribute corresponding source code.  (This alternative is
  168. +     allowed only for noncommercial distribution and only if you
  169. +     received the program in object code or executable form with such
  170. +     an offer, in accord with Subsection b above.)
  171. + The source code for a work means the preferred form of the work for
  172. + making modifications to it.  For an executable work, complete source
  173. + code means all the source code for all modules it contains, plus any
  174. + associated interface definition files, plus the scripts used to
  175. + control compilation and installation of the executable.  However, as a
  176. + special exception, the source code distributed need not include
  177. + anything that is normally distributed (in either source or binary
  178. + form) with the major components (compiler, kernel, and so on) of the
  179. + operating system on which the executable runs, unless that component
  180. + itself accompanies the executable.
  181. + If distribution of executable or object code is made by offering
  182. + access to copy from a designated place, then offering equivalent
  183. + access to copy the source code from the same place counts as
  184. + distribution of the source code, even though third parties are not
  185. + compelled to copy the source along with the object code.
  186. +   4. You may not copy, modify, sublicense, or distribute the Program
  187. + except as expressly provided under this License.  Any attempt
  188. + otherwise to copy, modify, sublicense or distribute the Program is
  189. + void, and will automatically terminate your rights under this License.
  190. + However, parties who have received copies, or rights, from you under
  191. + this License will not have their licenses terminated so long as such
  192. + parties remain in full compliance.
  193. +   5. You are not required to accept this License, since you have not
  194. + signed it.  However, nothing else grants you permission to modify or
  195. + distribute the Program or its derivative works.  These actions are
  196. + prohibited by law if you do not accept this License.  Therefore, by
  197. + modifying or distributing the Program (or any work based on the
  198. + Program), you indicate your acceptance of this License to do so, and
  199. + all its terms and conditions for copying, distributing or modifying
  200. + the Program or works based on it.
  201. +   6. Each time you redistribute the Program (or any work based on the
  202. + Program), the recipient automatically receives a license from the
  203. + original licensor to copy, distribute or modify the Program subject to
  204. + these terms and conditions.  You may not impose any further
  205. + restrictions on the recipients' exercise of the rights granted herein.
  206. + You are not responsible for enforcing compliance by third parties to
  207. + this License.
  208. +   7. If, as a consequence of a court judgment or allegation of patent
  209. + infringement or for any other reason (not limited to patent issues),
  210. + conditions are imposed on you (whether by court order, agreement or
  211. + otherwise) that contradict the conditions of this License, they do not
  212. + excuse you from the conditions of this License.  If you cannot
  213. + distribute so as to satisfy simultaneously your obligations under this
  214. + License and any other pertinent obligations, then as a consequence you
  215. + may not distribute the Program at all.  For example, if a patent
  216. + license would not permit royalty-free redistribution of the Program by
  217. + all those who receive copies directly or indirectly through you, then
  218. + the only way you could satisfy both it and this License would be to
  219. + refrain entirely from distribution of the Program.
  220. + If any portion of this section is held invalid or unenforceable under
  221. + any particular circumstance, the balance of the section is intended to
  222. + apply and the section as a whole is intended to apply in other
  223. + circumstances.
  224. + It is not the purpose of this section to induce you to infringe any
  225. + patents or other property right claims or to contest validity of any
  226. + such claims; this section has the sole purpose of protecting the
  227. + integrity of the free software distribution system, which is
  228. + implemented by public license practices.  Many people have made
  229. + generous contributions to the wide range of software distributed
  230. + through that system in reliance on consistent application of that
  231. + system; it is up to the author/donor to decide if he or she is willing
  232. + to distribute software through any other system and a licensee cannot
  233. + impose that choice.
  234. + This section is intended to make thoroughly clear what is believed to
  235. + be a consequence of the rest of this License.
  236. +   8. If the distribution and/or use of the Program is restricted in
  237. + certain countries either by patents or by copyrighted interfaces, the
  238. + original copyright holder who places the Program under this License
  239. + may add an explicit geographical distribution limitation excluding
  240. + those countries, so that distribution is permitted only in or among
  241. + countries not thus excluded.  In such case, this License incorporates
  242. + the limitation as if written in the body of this License.
  243. +   9. The Free Software Foundation may publish revised and/or new versions
  244. + of the General Public License from time to time.  Such new versions will
  245. + be similar in spirit to the present version, but may differ in detail to
  246. + address new problems or concerns.
  247. + Each version is given a distinguishing version number.  If the Program
  248. + specifies a version number of this License which applies to it and "any
  249. + later version", you have the option of following the terms and conditions
  250. + either of that version or of any later version published by the Free
  251. + Software Foundation.  If the Program does not specify a version number of
  252. + this License, you may choose any version ever published by the Free Software
  253. + Foundation.
  254. +   10. If you wish to incorporate parts of the Program into other free
  255. + programs whose distribution conditions are different, write to the author
  256. + to ask for permission.  For software which is copyrighted by the Free
  257. + Software Foundation, write to the Free Software Foundation; we sometimes
  258. + make exceptions for this.  Our decision will be guided by the two goals
  259. + of preserving the free status of all derivatives of our free software and
  260. + of promoting the sharing and reuse of software generally.
  261. +                 NO WARRANTY
  262. +   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  263. + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  264. + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  265. + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  266. + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  267. + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
  268. + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  269. + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  270. + REPAIR OR CORRECTION.
  271. +   12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  272. + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  273. + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  274. + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  275. + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
  276. + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  277. + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  278. + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  279. + POSSIBILITY OF SUCH DAMAGES.
  280. +              END OF TERMS AND CONDITIONS
  281. +     Appendix: How to Apply These Terms to Your New Programs
  282. +   If you develop a new program, and you want it to be of the greatest
  283. + possible use to the public, the best way to achieve this is to make it
  284. + free software which everyone can redistribute and change under these terms.
  285. +   To do so, attach the following notices to the program.  It is safest
  286. + to attach them to the start of each source file to most effectively
  287. + convey the exclusion of warranty; and each file should have at least
  288. + the "copyright" line and a pointer to where the full notice is found.
  289. +     <one line to give the program's name and a brief idea of what it does.>
  290. +     Copyright (C) 19yy  <name of author>
  291. +     This program is free software; you can redistribute it and/or modify
  292. +     it under the terms of the GNU General Public License as published by
  293. +     the Free Software Foundation; either version 2 of the License, or
  294. +     (at your option) any later version.
  295. +     This program is distributed in the hope that it will be useful,
  296. +     but WITHOUT ANY WARRANTY; without even the implied warranty of
  297. +     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  298. +     GNU General Public License for more details.
  299. +     You should have received a copy of the GNU General Public License
  300. +     along with this program; if not, write to the Free Software
  301. +     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  302. + Also add information on how to contact you by electronic and paper mail.
  303. + If the program is interactive, make it output a short notice like this
  304. + when it starts in an interactive mode:
  305. +     Gnomovision version 69, Copyright (C) 19yy name of author
  306. +     Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  307. +     This is free software, and you are welcome to redistribute it
  308. +     under certain conditions; type `show c' for details.
  309. + The hypothetical commands `show w' and `show c' should show the appropriate
  310. + parts of the General Public License.  Of course, the commands you use may
  311. + be called something other than `show w' and `show c'; they could even be
  312. + mouse-clicks or menu items--whatever suits your program.
  313. + You should also get your employer (if you work as a programmer) or your
  314. + school, if any, to sign a "copyright disclaimer" for the program, if
  315. + necessary.  Here is a sample; alter the names:
  316. +   Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  317. +   `Gnomovision' (which makes passes at compilers) written by James Hacker.
  318. +   <signature of Ty Coon>, 1 April 1989
  319. +   Ty Coon, President of Vice
  320. + This General Public License does not permit incorporating your program into
  321. + proprietary programs.  If your program is a subroutine library, you may
  322. + consider it more useful to permit linking proprietary applications with the
  323. + library.  If this is what you want to do, use the GNU Library General
  324. + Public License instead of this License.
  325. diff -rc --new-file gdb-4.12/bfd/Makefile.in /gnu/src/amiga/gdb-4.12/bfd/Makefile.in
  326. *** gdb-4.12/bfd/Makefile.in    Thu Feb  3 16:46:35 1994
  327. --- /gnu/src/amiga/gdb-4.12/bfd/Makefile.in    Fri Jun 17 07:33:34 1994
  328. ***************
  329. *** 113,118 ****
  330. --- 113,119 ----
  331.   BFD32_BACKENDS = \
  332.       aout-adobe.o \
  333.       aout32.o \
  334. +     amiga.o \
  335.       bout.o \
  336.       cf-i386lynx.o \
  337.       cf-m68klynx.o \
  338. ***************
  339. *** 232,238 ****
  340.        hp300bsd.c hp300hpux.c \
  341.        i386lynx.c cf-i386lynx.c m68klynx.c cf-m68klynx.c \
  342.        sparclynx.c cf-sparclynx.c aix386-core.c hpux-core.c \
  343. !      irix-core.c lynx-core.c osf-core.c hash.c linker.c
  344.   
  345.   HFILES = aout-target.h aoutf1.h aoutx.h coffcode.h \
  346.        coffswap.h ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \
  347. --- 233,239 ----
  348.        hp300bsd.c hp300hpux.c \
  349.        i386lynx.c cf-i386lynx.c m68klynx.c cf-m68klynx.c \
  350.        sparclynx.c cf-sparclynx.c aix386-core.c hpux-core.c \
  351. !      irix-core.c lynx-core.c osf-core.c hash.c linker.c amiga.c
  352.   
  353.   HFILES = aout-target.h aoutf1.h aoutx.h coffcode.h \
  354.        coffswap.h ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \
  355. ***************
  356. *** 492,497 ****
  357. --- 493,500 ----
  358.   
  359.   bfd.ps: 
  360.       (cd $(docdir); $(MAKE) bfd.ps $(FLAGS_TO_PASS))
  361. + amiga.o: amiga.c libamiga.h bfd.h
  362.   
  363.   # What appears below is generated by a hacked mkdep using gcc -MM.
  364.   
  365. diff -rc --new-file gdb-4.12/bfd/amiga.c /gnu/src/amiga/gdb-4.12/bfd/amiga.c
  366. *** gdb-4.12/bfd/amiga.c    Thu Jan  1 00:00:00 1970
  367. --- /gnu/src/amiga/gdb-4.12/bfd/amiga.c    Fri Jun 17 07:33:35 1994
  368. ***************
  369. *** 0 ****
  370. --- 1,1019 ----
  371. + /* BFD back-end for Commodore-Amiga AmigaDOS binaries.
  372. +    Copyright (C) 1990-1994 Free Software Foundation, Inc.
  373. +    Contributed by Leonard Norrgard.  Partially based on the bout
  374. +    and ieee BFD backends and Markus Wild's tool hunk2gcc.
  375. + This file is part of BFD, the Binary File Descriptor library.
  376. + This program is free software; you can redistribute it and/or modify
  377. + it under the terms of the GNU General Public License as published by
  378. + the Free Software Foundation; either version 2 of the License, or
  379. + (at your option) any later version.
  380. + This program is distributed in the hope that it will be useful,
  381. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  382. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  383. + GNU General Public License for more details.
  384. + You should have received a copy of the GNU General Public License
  385. + along with this program; if not, write to the Free Software
  386. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  387. + /* TODO:
  388. +    - writing of object files
  389. +    - .chipdata, .chipbss
  390. +    - fix fixme:s
  391. +    BFD:
  392. +    - add flag to say if the format allows multiple sections with the
  393. +      same name.  Fix bfd_get_section_by_name() and bfd_make_section()
  394. +      accordingly.
  395. +    - dumpobj.c: the disassembler: use relocation record data to find symbolic
  396. +      names of addresses, when available.  Needs new routine where one can
  397. +      specify the source section of the symbol to be printed as well as some
  398. +      rewrite of the disassemble functions.
  399. +    */
  400. + #include "bfd.h"
  401. + #include "sysdep.h"
  402. + #include "libbfd.h"
  403. + #include "libamiga.h"
  404. + #define GL(x) bfd_get_32 (abfd, (bfd_byte *) (x))
  405. + #define DEBUG_AMIGA 0
  406. + static boolean amiga_digest_file ();
  407. + static boolean amiga_mkobject ();
  408. + reloc_howto_type howto_hunk_reloc8 =
  409. + {
  410. +   HUNK_RELOC8, /* type */
  411. +   0,           /* rightshift */
  412. +   0,           /* size */
  413. +   0,           /* bitsize */
  414. +   true,        /* pc_relative */
  415. +   0,           /* bitpos */
  416. +   complain_overflow_bitfield,  /* complain_on_overflow */
  417. +   0,           /* special_function */
  418. +   "reloc8",    /* textual name */
  419. +   false,       /* partial_inplace? */
  420. +   0x000000ff,  /* src_mask */
  421. +   0x000000ff,  /* dst_mask */
  422. +   true         /* pcrel_offset */
  423. + };
  424. + reloc_howto_type howto_hunk_reloc16 =
  425. + {HUNK_RELOC16,0,0,0,true,0,complain_overflow_bitfield,0,"reloc16",false,0x0000ffff,0x0000ffff,true};
  426. + reloc_howto_type howto_hunk_reloc32 =
  427. + {HUNK_RELOC32,0,0,0,true,0,complain_overflow_bitfield,0,"reloc32",false,0xffffffff,0xffffffff,true};
  428. + reloc_howto_type howto_hunk_drel8 =
  429. + {HUNK_DREL8,0,0,0,false,0,complain_overflow_bitfield,0,"drel8",false,0x000000ff,0x000000ff,true};
  430. + reloc_howto_type howto_hunk_drel16 =
  431. + {HUNK_DREL16,0,0,0,false,0,complain_overflow_bitfield,0,"drel16",false,0x0000ffff,0x0000ffff,true};
  432. + reloc_howto_type howto_hunk_drel32 =
  433. + {HUNK_DREL32,0,0,0,false,0,complain_overflow_bitfield,0,"drel32",false,0xffffffff,0xffffffff,true};
  434. + reloc_howto_type *amiga_howto_array[2][3] =
  435. + {
  436. +   { &howto_hunk_reloc8, &howto_hunk_reloc16, &howto_hunk_reloc32 },
  437. +   { &howto_hunk_drel8, &howto_hunk_drel16, &howto_hunk_drel32 }
  438. + };
  439. + static bfd_target *
  440. + amiga_object_p (abfd)
  441. +      bfd *abfd;
  442. + {
  443. +   char buf[8];
  444. +   unsigned int x;
  445. +   struct stat stat_buffer;
  446. +   /* An Amiga object file must be at least 8 bytes long.  */
  447. +   if (bfd_read ((PTR) buf, 1, 8, abfd) != 8)
  448. +     {
  449. +       bfd_error = wrong_format;
  450. +       return 0;
  451. +     }
  452. +   /* Does it look like an Amiga object file?  */
  453. +   x = GL(buf);
  454. +   if ((x != HUNK_UNIT) && (x != HUNK_HEADER))
  455. +     {
  456. +       /* Not an Amiga file.  */
  457. +       bfd_error = wrong_format;
  458. +       return 0;
  459. +     }
  460. +   /* So far it seems to be an Amiga file.  Now slurp it
  461. +      in and examine it closer.  */
  462. +   if (-1 == fstat (fileno ((FILE *) abfd->iostream), &stat_buffer))
  463. +     {
  464. +       bfd_error = system_call_error;
  465. +       return 0;
  466. +     }
  467. +   /* Can't fail and return (but must be declared boolean to suit
  468. +      other bfd requirements).  */
  469. +   (void) amiga_mkobject (abfd);
  470. +   AMIGA_DATA(abfd)->symbol_tail_ptr = &AMIGA_DATA(abfd)->external_symbols;
  471. +   
  472. +   AMIGA_DATA(abfd)->first_byte = (unsigned long *) bfd_alloc (abfd, stat_buffer.st_size);
  473. +   bfd_seek (abfd, 0, SEEK_SET);
  474. +   bfd_read (AMIGA_DATA(abfd)->first_byte, 1, stat_buffer.st_size, abfd);
  475. +   AMIGA_DATA(abfd)->file_pointer = AMIGA_DATA(abfd)->first_byte;
  476. +   AMIGA_DATA(abfd)->file_end = (unsigned long *)((unsigned char *)AMIGA_DATA(abfd)->first_byte + stat_buffer.st_size);
  477. +   if (!amiga_digest_file (abfd))
  478. +     {
  479. +       /* Something went wrong.  */
  480. +       return (struct bfd_target *) 0;
  481. +     }
  482. +   /* Set default architecture to m68k:68020.  */
  483. +   abfd->arch_info = bfd_scan_arch ("m68k:68020");
  484. +   return abfd->xvec;
  485. + }
  486. + /* Skip over the hunk length longword + the number of longwords given there.  */
  487. + #define next_hunk(abfd) \
  488. +   { AMIGA_DATA(abfd)->file_pointer += 1 + GL(AMIGA_DATA(abfd)->file_pointer); }
  489. + static asection *
  490. + amiga_get_section_by_hunk_number (abfd, hunk_number)
  491. +      bfd *abfd;
  492. +      unsigned int hunk_number;
  493. + {
  494. +   /* A cache, so we don't have to search the entire list every time.  */
  495. +   static asection *last_reference;
  496. +   asection *p;
  497. +   if (last_reference)
  498. +     if (last_reference->target_index == hunk_number)
  499. +       return last_reference;
  500. +   for (p = abfd->sections; p != NULL; p = p->next)
  501. +     if (p->target_index == hunk_number)
  502. +       {
  503. +     last_reference = p;
  504. +     return p;
  505. +       }
  506. +   BFD_FAIL();
  507. +   return (asection *) 0;
  508. + }
  509. + /* Remember about a symbol found at the current file position.
  510. +    Return number of longwords to advance the file_pointer with.  */
  511. + static unsigned long
  512. + amiga_add_symbol (abfd, hunk_number)
  513. +      bfd *abfd;
  514. +      unsigned int hunk_number;
  515. + {
  516. +   int length;
  517. +   amiga_symbol_type *symbol = bfd_alloc (abfd, sizeof (amiga_symbol_type));
  518. +   if (symbol)
  519. +     {
  520. +       amiga_data_type *amiga_data = AMIGA_DATA(abfd);
  521. +       unsigned long *file_pointer = amiga_data->file_pointer;
  522. +       unsigned char type = GL(file_pointer) >> 24;
  523. +       ++abfd->symcount;
  524. +       *amiga_data->symbol_tail_ptr = symbol;
  525. +       amiga_data->symbol_tail_ptr = &symbol->next;
  526. +       symbol->symbol.the_bfd = abfd;
  527. +       /* The symbol name is not necessarily nul-terminated in the file.
  528. +      So, we move it to start on the length word and put a NUL at the
  529. +      end of it all.  This way, we avoid allocating separate memory for
  530. +      the symbol name, while assuring that the name is nul-terminated.  */
  531. +       length = (GL(file_pointer) & 0xffffff) << 2;
  532. +       strncpy ((char *) file_pointer, (char *) (file_pointer + 1), length);
  533. +       *(((char *)file_pointer) + length) = '\0';
  534. +       symbol->symbol.name = (char *)file_pointer;
  535. +       symbol->symbol.udata = (PTR) NULL;
  536. +       symbol->symbol.flags = ((type == EXT_DEF) || (type == EXT_ABS))
  537. +                  ? BSF_GLOBAL : BSF_NO_FLAGS;
  538. +       symbol->symbol.value = ((type == EXT_DEF) || (type == EXT_ABS))
  539. +                  ? (symvalue) GL(file_pointer + 1 + (length>>2)) : 0;
  540. +       symbol->symbol.section = amiga_get_section_by_hunk_number (abfd, hunk_number);
  541. +       symbol->hunk_number = hunk_number;
  542. +       symbol->type = type;
  543. +       symbol->next = 0;
  544. +     }
  545. +   return length >> 2;
  546. + }
  547. + static void
  548. + amiga_add_reloc (abfd, section, offset, symbol_number, howto, target_hunk)
  549. +      bfd *abfd;
  550. +      asection *section;
  551. +      bfd_size_type offset;
  552. +      int symbol_number;
  553. +      reloc_howto_type *howto;
  554. +      unsigned int target_hunk;
  555. + {
  556. +   amiga_reloc_type *reloc;
  557. +   reloc = (amiga_reloc_type *) bfd_alloc (abfd, sizeof (amiga_reloc_type));
  558. +   reloc->next = 0;
  559. +   abfd -> flags |= HAS_RELOC;
  560. +   section -> flags |= SEC_RELOC;
  561. +   ++section->reloc_count;
  562. +   if (amiga_per_section(section)->reloc_tail_ptr)
  563. +     amiga_per_section(section)->reloc_tail_ptr->next = reloc;
  564. +   else
  565. +     section->relocation = (struct reloc_cache_entry *) reloc;
  566. +   amiga_per_section(section)->reloc_tail_ptr = reloc;
  567. +   amiga_per_section(section)->reloc_tail_ptr->next = (amiga_reloc_type *) 0;
  568. +   reloc->relent.address = offset;
  569. +   reloc->relent.addend = 0;
  570. +   reloc->relent.howto = howto;
  571. +   reloc->symbol_number = symbol_number;
  572. +   reloc->target_hunk = target_hunk;
  573. + }
  574. + /* BFD doesn't currently allow multiple sections with the same
  575. +    name, so we try a little harder to get a unique name.  */
  576. + asection *
  577. + amiga_make_unique_section (abfd, name)
  578. +      bfd *abfd;
  579. +      CONST char *name;
  580. + {
  581. +   asection *section;
  582. +   section = bfd_make_section (abfd, name);
  583. +   if (!section)
  584. +     {
  585. +       int i = 1;
  586. +       char *new_name;
  587. +       new_name = bfd_alloc (abfd, strlen(name) + 3);
  588. +       /* We try to come up with an original name (since BFD
  589. +      currently requires all sections to have different names).  */
  590. +       while (!section && (i<=99))
  591. +     {
  592. +       sprintf (new_name, "%s_%u", name, i);
  593. +       section = bfd_make_section (abfd, new_name);
  594. +     }
  595. +       if (!section)
  596. +     {
  597. +       /* Complain about the given name.  */
  598. +       bfd_error = bad_value;
  599. +       return 0;
  600. +     }
  601. +     }
  602. +   return section;
  603. + }
  604. + static boolean
  605. + amiga_digest_file (abfd)
  606. +      bfd *abfd;
  607. + {
  608. +   int is_chip;
  609. +   int units = 0;
  610. +   int hunk_number;
  611. +   char *current_name = 0;
  612. +   asection *current_section;
  613. +   amiga_data_type *amiga_data = AMIGA_DATA(abfd);
  614. +   int hunk_type;
  615. +   /* Hunk numbers starts with 0, but we pre-increment the hunk_number when
  616. +      we assign a new one, so this really makes the first hunk number 0.  */
  617. +   hunk_number = -1;
  618. +   while (units < 2)
  619. +     {
  620. +       hunk_type = HUNK_VALUE(GL(amiga_data->file_pointer++));
  621. + #if DEBUG_AMIGA
  622. +       printf ("Processing %s hunk...",
  623. +           hunk_type == HUNK_UNIT ? "HUNK_UNIT" :
  624. +           hunk_type == HUNK_NAME ? "HUNK_NAME" :
  625. +           hunk_type == HUNK_DEBUG ? "HUNK_DEBUG" :
  626. +           hunk_type == HUNK_OVERLAY ? "HUNK_OVERLAY" :
  627. +           hunk_type == HUNK_BREAK ? "HUNK_BREAK" :
  628. +           hunk_type == HUNK_HEADER ? "HUNK_HEADER" :
  629. +           hunk_type == HUNK_CODE ? "HUNK_CODE" :
  630. +           hunk_type == HUNK_DATA ? "HUNK_DATA" :
  631. +           hunk_type == HUNK_BSS ? "HUNK_BSS" :
  632. +           hunk_type == HUNK_RELOC8 ? "HUNK_RELOC8" :
  633. +           hunk_type == HUNK_RELOC16 ? "HUNK_RELOC16" :
  634. +           hunk_type == HUNK_RELOC32 ? "HUNK_RELOC32" :
  635. +           hunk_type == HUNK_DREL8 ? "HUNK_DREL8" :
  636. +           hunk_type == HUNK_DREL16 ? "HUNK_DREL16" :
  637. +           hunk_type == HUNK_DREL32 ? "HUNK_DREL32" :
  638. +           hunk_type == HUNK_SYMBOL ? "HUNK_SYMBOL" :
  639. +           hunk_type == HUNK_EXT ? "HUNK_EXT" :
  640. +           hunk_type == HUNK_END ? "HUNK_END" :
  641. +           hunk_type == HUNK_LIB ? "HUNK_LIB" :
  642. +           hunk_type == HUNK_INDEX ? "HUNK_INDEX" :
  643. +           "*unknown*");
  644. + #endif
  645. +       switch (hunk_type)
  646. +     {
  647. +     case HUNK_UNIT:
  648. +       current_name =
  649. +         (GL(amiga_data->file_pointer) == 0)
  650. +           ? "" : (char *)(amiga_data->file_pointer + 1);
  651. +       /* Allow only one program unit per bfd.  */
  652. +       if (units++)
  653. +         break;
  654. +       /* We always initialize hunk_number to -1, as desribed above.  */
  655. +       hunk_number = -1;
  656. +       next_hunk (abfd);
  657. +       break;
  658. +     case HUNK_NAME:
  659. +       {
  660. +         int length = GL(amiga_data->file_pointer) << 2;
  661. +         /* Change the name to a nul-terminated string.  */
  662. +         strncpy ((char *)amiga_data->file_pointer, (char *)(amiga_data->file_pointer + 1), length);
  663. +         *(((char *) amiga_data->file_pointer) + length) = '\0';
  664. +         current_name = (char *) amiga_data->file_pointer;
  665. +         /* Can't use next_hunk() here, as we wrote over the hunk length
  666. +            that next_hunk() looks at.  */
  667. +         amiga_data->file_pointer += 1 + (length>>2);
  668. +       }
  669. +       break;
  670. +     case HUNK_DEBUG:
  671. +       /* The format for the HUNK_DEBUG, as produced by Amiga GNU C:
  672. +          longwords:
  673. +             |---------------|
  674. +             |  HUNK_DEBUG   |  0x3f1, Amigados imposed
  675. +         |---------------|
  676. +         |      N        |  Size of this hunk in longwords
  677. +         |---------------|
  678. +         | AMIGA_ZMAGIC  |  0413, same as BSD unix ZMAGIC
  679. +         |---------------|
  680. +         |  symtabsize   |  size of the symbol table in bytes
  681. +         |---------------|
  682. +         | stringtabsize |  size of the string table in bytes
  683. +         |---------------|
  684. +         | symtab data   |  symbol table in a.out format,
  685. +         :               :  size is symtabsize.
  686. +         :          .....:
  687. +         |..........|    |  
  688. +         |   stringtab   |  string table in a.out format,
  689. +         :     data      :  size is stringtabsize.
  690. +         :               :  (can start on byte boundary,
  691. +         |---------------|   and can be padded at the end).
  692. +       /* Same as BSD unix ZMAGIC, but I don't want to include
  693. +          any BSD files here.  */
  694. + #define    AMIGA_ZMAGIC 0413 
  695. +       /* Identifier for the GNU C format for HUNK_DEBUG on the Amiga.  */
  696. +       if (GL(amiga_data->file_pointer + 1) == AMIGA_ZMAGIC)
  697. +         {
  698. +           amiga_data->symtab_size = GL(amiga_data->file_pointer + 2);
  699. +           amiga_data->stringtab_size = GL(amiga_data->file_pointer + 3);
  700. +           adata(abfd).sym_filepos =
  701. +         (file_ptr) ((char *)(amiga_data->file_pointer + 4) - (char *)amiga_data->first_byte);
  702. +           adata(abfd).str_filepos = adata(abfd).sym_filepos
  703. +         + amiga_data->symtab_size;
  704. +         }
  705. +       else
  706. +         fprintf (stderr, "unknown debug hunk type\n");
  707. +       next_hunk (abfd);
  708. +       break;
  709. +     case HUNK_OVERLAY:
  710. +       /* Poor man's virtual memory.  Not yet supported.  */
  711. +       /* fixme */
  712. +       fprintf (stderr, "Warning: HUNK_OVERLAY encountered, ignoring.\n");
  713. +       next_hunk (abfd);
  714. +       break;
  715. +     case HUNK_BREAK:
  716. +       /* HUNK_BREAK indicates the end of an overlay node.  This
  717. +          hunk consists of a single longword, HUNK_BREAK.  As we
  718. +          do not yet support overlays, we ignore thins hunk for now.  */
  719. +       /* fixme */
  720. +       fprintf(stderr, "Warning: HUNK_BREAK encountered, ignoring.\n");
  721. +       next_hunk (abfd);
  722. +       break;
  723. +     case HUNK_HEADER:
  724. +       /* This is the header of a load file.
  725. +          
  726. +          Skip resident library names (never used, it's
  727. +          an obsolete feature of the file format).  fixme: verify that!  */
  728. +       while (GL(amiga_data->file_pointer))
  729. +         next_hunk (abfd);
  730. +       /* Skip null-word, table_size, F & L, and size-table.  */
  731. +       amiga_data->file_pointer += 4 + GL(amiga_data->file_pointer + 1) - GL(amiga_data->file_pointer + 2);
  732. +       break;
  733. +     case HUNK_CODE:
  734. +       is_chip = HUNK_ATTRIBUTE (GL(amiga_data->file_pointer - 1)) == HUNK_ATTR_CHIP;
  735. +       if (is_chip)
  736. +         fprintf (stderr, "Warning: CHIP code hunks are not supported, ignoring CHIP attribute\n");
  737. +       current_section = amiga_make_unique_section (abfd, (current_name && current_name[0]) ? current_name : ".text");
  738. +       if (current_section == 0)
  739. +         {
  740. +           /* Fatal error.  */
  741. +           return false;
  742. +         }
  743. +       current_section->filepos = (char *) (amiga_data->file_pointer + 1) - (char *)amiga_data->first_byte;
  744. +       current_section->_raw_size = GL(amiga_data->file_pointer) << 2;
  745. +       current_section->target_index = ++hunk_number;
  746. +       bfd_set_section_flags (abfd, current_section, SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS);
  747. +       next_hunk (abfd);
  748. +       break;
  749. +     case HUNK_DATA:
  750. +       current_section = amiga_make_unique_section (abfd, (current_name && current_name[0]) ? current_name : ".data");
  751. +       if (current_section == 0)
  752. +         {
  753. +           /* Fatal error.  */
  754. +           return false;
  755. +         }
  756. +       current_section->filepos = (char *) (amiga_data->file_pointer + 1) - (char *)amiga_data->first_byte;
  757. +       current_section->_raw_size = GL(amiga_data->file_pointer) << 2;
  758. +       current_section->target_index = ++hunk_number;
  759. +       bfd_set_section_flags (abfd, current_section, SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS);
  760. +       next_hunk (abfd);
  761. +       break;
  762. +     case HUNK_BSS:
  763. +       current_section = amiga_make_unique_section (abfd, (current_name && current_name[0]) ? current_name : ".bss");
  764. +       if (current_section == 0)
  765. +         {
  766. +           /* Fatal error.  */
  767. +           return false;
  768. +         }
  769. +       current_section->filepos = (file_ptr) -1;
  770. +       current_section->_raw_size = GL(amiga_data->file_pointer) << 2;
  771. +       current_section->target_index = ++hunk_number;
  772. +       bfd_set_section_flags (abfd, current_section, SEC_ALLOC);
  773. +       ++ amiga_data->file_pointer;
  774. +       break;
  775. +     case HUNK_RELOC8:
  776. +     case HUNK_RELOC16:
  777. +     case HUNK_RELOC32:
  778. +     case HUNK_DREL8:
  779. +     case HUNK_DREL16:
  780. +     case HUNK_DREL32:
  781. +       {
  782. +         int size, base_relative;
  783. +         reloc_howto_type *howto;
  784. +       
  785. +         base_relative = GL(&amiga_data->file_pointer[-1]) >= HUNK_DREL32;
  786. +         size = (base_relative ? HUNK_DREL8 : HUNK_RELOC8) - GL(&amiga_data->file_pointer[-1]);
  787. +         howto = amiga_howto_array[base_relative][size];
  788. +         while (GL(amiga_data->file_pointer))
  789. +           {
  790. +         long to_reloc = GL(amiga_data->file_pointer + 1);
  791. +         long n        = GL(amiga_data->file_pointer);
  792. +         long i = 1;
  793. +         
  794. +         while (i++ < n)
  795. +           amiga_add_reloc (abfd, current_section,
  796. +                    GL(amiga_data->file_pointer + i + 1),
  797. +                    -1, howto, to_reloc);
  798. +         amiga_data->file_pointer += GL(amiga_data->file_pointer) + 2;
  799. +           }
  800. +         ++amiga_data->file_pointer;
  801. +       }
  802. +       break;
  803. +     case HUNK_SYMBOL:
  804. +       /* "You use this block to attach a symbol table to a hunk so that
  805. +          you can use a symbolic debugger on the code.  The linker passes
  806. +          symbol table blocks through attached to the hunk and, if the hunks
  807. +          are coagulated, coagulates the symbol tables.  The loader does not
  808. +          load symbol table blocks into memory; when this is required,
  809. +          the debugger is expected to read the load file."
  810. +                                            -- The AmigaDOS Manual, 3rd ed.
  811. +          GNU C on the Amiga passes all needed debug information in the
  812. +          debug hunk (HUNK_DEBUG).  Thus we do not depend on HUNK_SYMBOL
  813. +          for the GNU debugger GDB to get symbol information and can safely
  814. +          ignore this hunk.
  815. +            If, however, someone would like to add full support for
  816. +          HUNK_SYMBOL to be able to use some debugger that doesn't
  817. +          understand the GNU C debug hunk, please go ahead.
  818. +            As of this writing, the BarFly debugger written by
  819. +          Ralph "laire" Schmidt is starting to understand the GNU C debug
  820. +          hunk.  As the GNU version of the debug hunk is publically
  821. +          documented, unlike for example the format used by SAS Insitute
  822. +          on the Amiga, I hope other debugger writers will follow his
  823. +          example.                          -- vinsci@nic.funet.fi   */
  824. +       /* The formats of the HUNK_SYMBOL and HUNK_EXT hunks are exactly
  825. +          the same, except the type byte of anything in the HUNK_SYMBOL
  826. +          is always zero.  Thus we ignore the symbol hunk by ignoring
  827. +          all EXT_SYMB's below and can thus reuse the code.  */
  828. +       /* Fall through */
  829. +     case HUNK_EXT:
  830. +       while (GL(amiga_data->file_pointer))
  831. +         {
  832. +           int num, size, base_relative;
  833. +           unsigned char type;
  834. +           reloc_howto_type *howto;
  835. +           /* Make sure we don't set this flag for HUNK_SYMBOL hunks.  */
  836. +           if (hunk_type == HUNK_EXT)
  837. +             abfd -> flags |= HAS_SYMS;
  838. +           
  839. +           switch (type = (GL(amiga_data->file_pointer) >> 24))
  840. +         {
  841. +         case EXT_SYMB:  /* This is a symbol from HUNK_SYMBOL, which we
  842. +                    ignore.  See long description above.  */
  843. +           num = GL(amiga_data->file_pointer) & 0xffffff;
  844. +           amiga_data->file_pointer += 2 + num;
  845. +           break;
  846. +         case EXT_DEF:   /* Relocatable definition.  */
  847. +         case EXT_ABS:   /* Absolute definition.  */
  848. +         /* case EXT_RES: obsolete; Resident library definition.  */
  849. +           num = amiga_add_symbol (abfd, hunk_number);
  850. +           amiga_data->file_pointer += 2 + num;
  851. +           break;
  852. +           
  853. +         case EXT_COMMON:  /* 32 bit reference to COMMON block.  */
  854. +           {
  855. +             int i = 0;
  856. +             num = amiga_add_symbol (abfd, hunk_number);
  857. +             amiga_data->file_pointer += 2 + num;
  858. +           
  859. +             num = GL(amiga_data->file_pointer);
  860. +             while (i++ < num)
  861. +               amiga_add_reloc
  862. +             (abfd, current_section, GL(amiga_data->file_pointer + i),
  863. +              amiga_data->a.n_symbols, &howto_hunk_drel32, -1);
  864. +             next_hunk (abfd);
  865. +           }
  866. +           break;
  867. +           
  868. +         case EXT_REF8:     /*  8 bit reference to symbol.  */
  869. +         case EXT_REF16:    /* 16 bit reference to symbol.  */
  870. +         case EXT_REF32:    /* 32 bit reference to symbol.  */
  871. +         case EXT_DEXT8:    /*  8 bit data relative reference.  */
  872. +         case EXT_DEXT16:   /* 16 bit data relative reference.  */
  873. +         case EXT_DEXT32:   /* 32 bit data relative reference.  */
  874. +           size = GL(amiga_data->file_pointer) >> 24;
  875. +           base_relative = size >= EXT_DEXT32;
  876. +           switch (size)
  877. +             {
  878. +             case EXT_REF32:
  879. +             case EXT_DEXT32:
  880. +               size = 2;
  881. +               break;
  882. +             case EXT_REF16:
  883. +             case EXT_DEXT16:
  884. +               size = 1;
  885. +               break;
  886. +             default:
  887. +               size = 0;
  888. +             }
  889. +           howto = amiga_howto_array[base_relative][size];
  890. +           
  891. +           num = amiga_add_symbol (abfd, hunk_number);
  892. +           
  893. +           amiga_data->file_pointer += 1 + num;
  894. +           {
  895. +             int i = 0;
  896. +             
  897. +             num = GL(amiga_data->file_pointer);
  898. +             while (i++ < num)
  899. +               amiga_add_reloc (abfd, current_section,
  900. +                        GL(amiga_data->file_pointer + i),
  901. +                        amiga_data->a.n_symbols, howto, -1);
  902. +           }
  903. +           next_hunk (abfd);
  904. +           break;
  905. +           
  906. +         default:
  907. +           fprintf (stderr, "Unknown symbol type %d, don't know how to handle.\n", type);
  908. +           /* Fatal error.  */
  909. +           return false;
  910. +         }
  911. +         }
  912. +       ++ amiga_data->file_pointer;
  913. +       break;
  914. +     case HUNK_END:
  915. +       break;
  916. +     case HUNK_LIB:
  917. +     case HUNK_INDEX:
  918. +       fprintf (stderr, "Can not handle HUNK_LIB and HUNK_INDEX hunks.\nConvert the library to ALINK (join) format.\n");
  919. +       break;
  920. +     default:
  921. +       fprintf (stderr, "Unknown hunk type $%x, unit offset = $%x.\n",
  922. +            GL(amiga_data->file_pointer -1),
  923. +            ((amiga_data->file_pointer - 1) - amiga_data->first_byte) * 4);
  924. +       /* Fatal error.  */
  925. +       return false;
  926. +     }
  927. + #if DEBUG_AMIGA
  928. +       printf ("...hunk processed.\n");
  929. + #endif
  930. +       if (amiga_data->file_pointer >= amiga_data->file_end)
  931. +     break;
  932. +     }
  933. +   /* OK.  */
  934. +   return true;
  935. + }
  936. + static boolean
  937. + amiga_mkobject (abfd)
  938. +      bfd *abfd;
  939. + {
  940. +   struct amiga_data_struct *rawptr;
  941. +   rawptr = (struct amiga_data_struct *) bfd_zalloc (abfd, sizeof (struct amiga_data_struct));
  942. +   abfd->tdata.amiga_data = rawptr;
  943. +   return true;
  944. + }
  945. + static boolean
  946. + amiga_write_object_contents (abfd)
  947. +      bfd *abfd;
  948. + {
  949. +   /* fixme */
  950. +   return true;
  951. + }
  952. + static boolean
  953. + amiga_get_section_contents (abfd, section, location, offset, count)
  954. +      bfd *abfd;
  955. +      sec_ptr section;
  956. +      PTR location;
  957. +      file_ptr offset;
  958. +      bfd_size_type count;
  959. + {
  960. +   memmove ((void *) location,
  961. +        (void *) (((int) AMIGA_DATA(abfd)->first_byte)
  962. +              + (int) section->filepos
  963. +              + (int) offset),
  964. +        count);
  965. +   return true;
  966. + }
  967. + boolean
  968. + amiga_new_section_hook (abfd, newsect)
  969. +      bfd *abfd;
  970. +      asection *newsect;
  971. + {
  972. +   newsect->used_by_bfd = (PTR) bfd_alloc (abfd, sizeof (amiga_per_section_type));
  973. +   newsect->alignment_power = 2;
  974. +   amiga_per_section(newsect)->reloc_tail_ptr = (amiga_reloc_type *) 0;
  975. +   return true;
  976. + }
  977. + void
  978. + amiga_slurp_symbol_table (abfd)
  979. +      bfd *abfd;
  980. + {
  981. +   /* fixme:  currently we always load the symbols at check_format time,
  982. +      so we don't do it here.  When the amiga backend someday doesn't
  983. +      keep more info than needed in memory, this will have to be fixed.  */
  984. + }
  985. + unsigned int
  986. + amiga_get_symtab_upper_bound (abfd)
  987. +      bfd *abfd;
  988. + {
  989. +   amiga_slurp_symbol_table (abfd);
  990. +   return (abfd->symcount != 0) ?
  991. +     (abfd->symcount+1) * (sizeof (amiga_symbol_type *)) : 0;
  992. + }
  993. + unsigned int
  994. + amiga_get_symtab (abfd, location)
  995. +      bfd *abfd;
  996. +      asymbol **location;
  997. + {
  998. +   amiga_symbol_type *symp;
  999. +   if (abfd->symcount)
  1000. +     {
  1001. +       int i = 0;
  1002. +       amiga_slurp_symbol_table (abfd);
  1003. +       for (symp = AMIGA_DATA(abfd)->external_symbols;
  1004. +                  symp != (amiga_symbol_type *) NULL;
  1005. +                  symp = symp->next)
  1006. +     {
  1007. +       location[i++] = &symp->symbol;
  1008. +     }
  1009. +       for (symp = AMIGA_DATA(abfd)->external_references;
  1010. +                  symp != (amiga_symbol_type *) NULL;
  1011. +                  symp = symp->next)
  1012. +     {
  1013. +       location[i++] = &symp->symbol;
  1014. +     }
  1015. +     }
  1016. +   return abfd->symcount;
  1017. + }
  1018. + asymbol *
  1019. + amiga_make_empty_symbol (abfd)
  1020. +      bfd *abfd;
  1021. + {
  1022. +   amiga_symbol_type *new =
  1023. +     (amiga_symbol_type *) bfd_zalloc (abfd, sizeof (amiga_symbol_type));
  1024. +   new->symbol.the_bfd = abfd;
  1025. +   return &new->symbol;
  1026. + }
  1027. + void 
  1028. + amiga_get_symbol_info (ignore_abfd, symbol, ret)
  1029. +       bfd *ignore_abfd;
  1030. +       asymbol *symbol;
  1031. +       symbol_info *ret;
  1032. + {
  1033. +   bfd_symbol_info (symbol, ret);
  1034. +   if (symbol->name[0] == ' ')
  1035. +     ret->name = "* empty table entry ";
  1036. +   if (!symbol->section)
  1037. +     ret->type = (symbol->flags & BSF_LOCAL) ? 'a' : 'A';
  1038. + }
  1039. + void 
  1040. + amiga_print_symbol (ignore_abfd, afile,  symbol, how)
  1041. +       bfd *ignore_abfd;
  1042. +       PTR afile;
  1043. +       asymbol *symbol;
  1044. +       bfd_print_symbol_type how;
  1045. + {
  1046. +   FILE *file = (FILE *)afile;
  1047. +   switch (how) {
  1048. +   case bfd_print_symbol_name:
  1049. +     fprintf(file, "%s", symbol->name);
  1050. +     break;
  1051. +   case bfd_print_symbol_more:
  1052. +     /* fixme: adapt for amiga */
  1053. +     BFD_FAIL();
  1054. +     break;
  1055. +   case bfd_print_symbol_all:
  1056. +       {
  1057. +     CONST char *section_name = (symbol->section == (asection *)NULL)
  1058. +       ? (CONST char *)"*abs" : symbol->section->name;
  1059. +     if (symbol->name[0] == ' ')
  1060. +       {
  1061. +         fprintf(file, "* empty table entry ");
  1062. +       }
  1063. +     else
  1064. +       {
  1065. +         bfd_print_symbol_vandf ((PTR)file, symbol);
  1066. +         fprintf(file," %-5s %04x %02x %s",
  1067. +             section_name,
  1068. +             amiga_symbol(symbol)->hunk_number,  /* ->desc */
  1069. +             (unsigned) 0,                       /* ->other */
  1070. +                                                 /* type */
  1071. +             symbol->name);                      /* ->name */
  1072. +     }
  1073. +       }
  1074. +     break;
  1075. +   }
  1076. + }
  1077. + static unsigned int
  1078. + amiga_get_reloc_upper_bound (abfd, asect)
  1079. +      bfd *abfd;
  1080. +      sec_ptr asect;
  1081. + {
  1082. +   if (bfd_get_format (abfd) != bfd_object)
  1083. +     {
  1084. +       bfd_error = invalid_operation;
  1085. +       return 0;
  1086. +     }
  1087. +   return sizeof (arelent *) * (asect->reloc_count + 1);
  1088. + }
  1089. + unsigned int
  1090. + amiga_canonicalize_reloc (abfd, section, relptr, symbols)
  1091. +      bfd *abfd;
  1092. +      sec_ptr section;
  1093. +      arelent **relptr;
  1094. +      asymbol **symbols;
  1095. + {
  1096. +   amiga_reloc_type *src = (amiga_reloc_type *) section->relocation;
  1097. +   int i = 0;
  1098. +   while (src != (amiga_reloc_type *) 0)
  1099. +     {
  1100. +       if (src->symbol_number == -1)
  1101. +         src->relent.sym_ptr_ptr =
  1102. +       &(amiga_get_section_by_hunk_number(abfd,src->target_hunk))->symbol;
  1103. +       else
  1104. +     src->relent.sym_ptr_ptr = symbols + i++;
  1105. +       *relptr++ = &src->relent;
  1106. +       src = src->next;
  1107. +     }
  1108. +   *relptr = (arelent *) 0;
  1109. +   return section->reloc_count;
  1110. + }
  1111. + static boolean
  1112. + amiga_set_section_contents (abfd, section, location, offset, count)
  1113. +      bfd *abfd;
  1114. +      sec_ptr section;
  1115. +      unsigned char *location;
  1116. +      file_ptr offset;
  1117. +       int count;
  1118. + {
  1119. +   /* fixme */
  1120. +   return true;
  1121. + }
  1122. + static boolean
  1123. + amiga_set_arch_mach (abfd, arch, machine)
  1124. +      bfd *abfd;
  1125. +      enum bfd_architecture arch;
  1126. +      unsigned long machine;
  1127. + {
  1128. +   bfd_default_set_arch_mach(abfd, arch, machine);
  1129. +   if (arch == bfd_arch_m68k)
  1130. +     {
  1131. +       switch (machine)
  1132. +     {
  1133. +     case 68000:
  1134. +     case 68008:
  1135. +     case 68010:
  1136. +     case 68020:
  1137. +     case 68030:
  1138. +     case 68040:
  1139. +     case 68070:
  1140. +     case 0:
  1141. +       return true;
  1142. +     default:
  1143. +       return false;
  1144. +     }
  1145. +     }
  1146. +   return false;
  1147. + }
  1148. + static int 
  1149. + DEFUN(amiga_sizeof_headers,(ignore_abfd, ignore),
  1150. +       bfd *ignore_abfd AND
  1151. +       boolean ignore)
  1152. + {
  1153. +   /* The amiga hunk format doesn't have headers.  */
  1154. +   return 0;
  1155. + }
  1156. + /* Provided a BFD, a section and an offset into the section, calculate
  1157. +    and return the name of the source file and the line nearest to the
  1158. +    wanted location.  */
  1159. + boolean
  1160. + amiga_find_nearest_line(abfd, section, symbols, offset, filename_ptr,
  1161. +             functionname_ptr, line_ptr)
  1162. +      bfd *abfd;
  1163. +      asection *section;
  1164. +      asymbol **symbols;
  1165. +      bfd_vma offset;
  1166. +      char **filename_ptr;
  1167. +      char **functionname_ptr;
  1168. +      int *line_ptr;
  1169. + {
  1170. +   /* fixme (see aoutx.h, for example) */
  1171. +   return false;
  1172. + }
  1173. + static const struct reloc_howto_struct *
  1174. + amiga_bfd_reloc_type_lookup (abfd, code)
  1175. +        bfd *abfd;
  1176. +        bfd_reloc_code_real_type code;
  1177. + {
  1178. +   switch (code)
  1179. +     {
  1180. +     case BFD_RELOC_8_PCREL:  return &howto_hunk_reloc8;
  1181. +     case BFD_RELOC_16_PCREL: return &howto_hunk_reloc16;
  1182. +     case BFD_RELOC_32_PCREL: return &howto_hunk_reloc32;
  1183. +     case BFD_RELOC_8:        return &howto_hunk_drel8;
  1184. +     case BFD_RELOC_16:       return &howto_hunk_drel16;
  1185. +     case BFD_RELOC_32:       return &howto_hunk_drel32;
  1186. +     default:                 return 0;
  1187. +     }
  1188. + }
  1189. + /* We don't have core files.  */
  1190. + #define    amiga_core_file_failing_command _bfd_dummy_core_file_failing_command
  1191. + #define    amiga_core_file_failing_signal _bfd_dummy_core_file_failing_signal
  1192. + #define    amiga_core_file_matches_executable_p _bfd_dummy_core_file_matches_executable_p
  1193. + /* We use BSD-Unix generic archive files (fixme: test that this actually works).  */
  1194. + #define    amiga_openr_next_archived_file    bfd_generic_openr_next_archived_file
  1195. + #define    amiga_generic_stat_arch_elt    bfd_generic_stat_arch_elt
  1196. + #define    amiga_slurp_armap        bfd_slurp_bsd_armap
  1197. + #define    amiga_slurp_extended_name_table    bfd_true
  1198. + #define    amiga_write_armap        bsd_write_armap
  1199. + #define    amiga_truncate_arname        bfd_bsd_truncate_arname
  1200. + #define amiga_bfd_debug_info_start        bfd_void
  1201. + #define amiga_bfd_debug_info_end        bfd_void
  1202. + #define amiga_bfd_debug_info_accumulate    (PROTO(void,(*),(bfd*, struct sec *))) bfd_void
  1203. + /* fixme: (when everything else has been done) a tailor-made
  1204. +    amiga_get_relocated_section_contents would probably be faster
  1205. +    than the generic routine.  */
  1206. + #define amiga_bfd_get_relocated_section_contents  bfd_generic_get_relocated_section_contents
  1207. + #define amiga_bfd_relax_section                   bfd_generic_relax_section
  1208. + #define amiga_get_lineno (struct lineno_cache_entry *(*)())bfd_nullvoidptr
  1209. + #define amiga_close_and_cleanup         bfd_generic_close_and_cleanup
  1210. + #define amiga_bfd_make_debug_symbol \
  1211. +   ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
  1212. + #define amiga_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
  1213. + #define amiga_bfd_link_add_symbols _bfd_generic_link_add_symbols
  1214. + #define amiga_bfd_final_link _bfd_generic_final_link
  1215. + #if defined (amiga)
  1216. + /* So that the JUMP_TABLE() macro below can work.  */
  1217. + #undef amiga
  1218. + #endif
  1219. + bfd_target amiga_vec =
  1220. + {
  1221. +   "amiga",        /* name */
  1222. +   bfd_target_amiga_flavour,
  1223. +   true,            /* data byte order is little */
  1224. +   true,            /* header byte order is little */
  1225. +   HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT, /* object flags */
  1226. +   SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC, /* section flags */
  1227. +   '_',                /* symbol leading char */
  1228. +   ' ',                /* ar_pad_char */
  1229. +   31,                /* ar_max_namelen */
  1230. +   2,                /* minimum align */
  1231. +   bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32,
  1232. +   bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
  1233. +   bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32,
  1234. +   bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
  1235. +   {
  1236. +     /* bfd_check_format */
  1237. +     _bfd_dummy_target,
  1238. +     amiga_object_p, 
  1239. +     bfd_generic_archive_p,
  1240. +     _bfd_dummy_target
  1241. +   },
  1242. +   {
  1243. +     /* bfd_set_format */
  1244. +     bfd_false,
  1245. +     amiga_mkobject,
  1246. +     _bfd_generic_mkarchive,
  1247. +     bfd_false
  1248. +   },
  1249. +   {
  1250. +     /* bfd_write_contents */
  1251. +     bfd_false,
  1252. +     amiga_write_object_contents,
  1253. +     _bfd_write_archive_contents,
  1254. +     bfd_false
  1255. +   },
  1256. +   JUMP_TABLE(amiga),
  1257. +   (PTR) 0
  1258. + #if 0
  1259. + /* fixme: no longer in use?  */
  1260. +   /* How applications can find out about amiga relocation types (see
  1261. +      documentation on reloc types).  */
  1262. +   amiga_reloc_type_lookup
  1263. + #endif
  1264. + };
  1265. diff -rc --new-file gdb-4.12/bfd/bfd-in2.h /gnu/src/amiga/gdb-4.12/bfd/bfd-in2.h
  1266. *** gdb-4.12/bfd/bfd-in2.h    Thu Feb  3 17:00:58 1994
  1267. --- /gnu/src/amiga/gdb-4.12/bfd/bfd-in2.h    Fri Jun 17 07:33:36 1994
  1268. ***************
  1269. *** 1737,1742 ****
  1270. --- 1737,1743 ----
  1271.         struct sgi_core_struct *sgi_core_data;
  1272.         struct lynx_core_struct *lynx_core_data;
  1273.         struct osf_core_struct *osf_core_data;
  1274. +       struct amiga_data_struct *amiga_data;
  1275.         PTR any;
  1276.         } tdata;
  1277.     
  1278. ***************
  1279. *** 1861,1867 ****
  1280.     bfd_target_oasys_flavour,
  1281.     bfd_target_tekhex_flavour,
  1282.     bfd_target_srec_flavour,
  1283. !   bfd_target_som_flavour};
  1284.   
  1285.    /* Forward declaration.  */
  1286.   typedef struct bfd_link_info _bfd_link_info;
  1287. --- 1862,1869 ----
  1288.     bfd_target_oasys_flavour,
  1289.     bfd_target_tekhex_flavour,
  1290.     bfd_target_srec_flavour,
  1291. !   bfd_target_som_flavour,
  1292. !   bfd_target_amiga_flavour};
  1293.   
  1294.    /* Forward declaration.  */
  1295.   typedef struct bfd_link_info _bfd_link_info;
  1296. diff -rc --new-file gdb-4.12/bfd/bfd.c /gnu/src/amiga/gdb-4.12/bfd/bfd.c
  1297. *** gdb-4.12/bfd/bfd.c    Thu Feb  3 16:46:42 1994
  1298. --- /gnu/src/amiga/gdb-4.12/bfd/bfd.c    Fri Jun 17 07:33:37 1994
  1299. ***************
  1300. *** 168,173 ****
  1301. --- 168,174 ----
  1302.   .      struct sgi_core_struct *sgi_core_data;
  1303.   .      struct lynx_core_struct *lynx_core_data;
  1304.   .      struct osf_core_struct *osf_core_data;
  1305. + .      struct amiga_data_struct *amiga_data;
  1306.   .      PTR any;
  1307.   .      } tdata;
  1308.   .  
  1309. diff -rc --new-file gdb-4.12/bfd/config/amigados.mh /gnu/src/amiga/gdb-4.12/bfd/config/amigados.mh
  1310. *** gdb-4.12/bfd/config/amigados.mh    Thu Jan  1 00:00:00 1970
  1311. --- /gnu/src/amiga/gdb-4.12/bfd/config/amigados.mh    Fri Jun 17 07:33:38 1994
  1312. ***************
  1313. *** 0 ****
  1314. --- 1,6 ----
  1315. + # Host makefile fragment for Commodore Amiga running AmigaDOS
  1316. + # Use the GNU C compiler.
  1317. + CC=gcc
  1318. + # Don't use -g, it doesn't do anything useful yet.  Optimize though.
  1319. + CFLAGS=-O
  1320. diff -rc --new-file gdb-4.12/bfd/config/amigados.mt /gnu/src/amiga/gdb-4.12/bfd/config/amigados.mt
  1321. *** gdb-4.12/bfd/config/amigados.mt    Thu Jan  1 00:00:00 1970
  1322. --- /gnu/src/amiga/gdb-4.12/bfd/config/amigados.mt    Fri Jun 17 07:33:38 1994
  1323. ***************
  1324. *** 0 ****
  1325. --- 1,3 ----
  1326. + # Target config file for Commodore Amiga running AmigaDOS
  1327. + DEFAULT_VECTOR=amiga_vec
  1328. + SELECT_ARCHITECTURES=bfd_m68k_arch
  1329. diff -rc --new-file gdb-4.12/bfd/config.bfd /gnu/src/amiga/gdb-4.12/bfd/config.bfd
  1330. *** gdb-4.12/bfd/config.bfd    Thu Feb  3 17:01:00 1994
  1331. --- /gnu/src/amiga/gdb-4.12/bfd/config.bfd    Fri Jun 17 07:33:39 1994
  1332. ***************
  1333. *** 63,68 ****
  1334. --- 63,69 ----
  1335.     m68*-*-vxworks*)    bfd_name=m68k-aout ;;
  1336.     m68*-ericsson-*)    bfd_name=m68k-aout ;;
  1337.     m68*-netx-*)        bfd_name=m68k-aout ;;
  1338. +   m68*-cbm-amigados*)    bfd_name=amigados ;;
  1339.   
  1340.     m88*-*-sysv4*)    bfd_name=m88k-elf ;;
  1341.     # DGUX used to use COFF, but now (Jan 94) I believe it uses ELF by default.
  1342. diff -rc --new-file gdb-4.12/bfd/configure.in /gnu/src/amiga/gdb-4.12/bfd/configure.in
  1343. *** gdb-4.12/bfd/configure.in    Thu Feb  3 17:00:54 1994
  1344. --- /gnu/src/amiga/gdb-4.12/bfd/configure.in    Fri Jun 17 22:20:21 1994
  1345. ***************
  1346. *** 137,142 ****
  1347. --- 137,143 ----
  1348.       # with the two vector lists in targets.c.
  1349.       a29kcoff_big_vec)        tb="$tb coff-a29k.o" ;;
  1350.       a_out_adobe_vec)        tb="$tb aout-adobe.o aout32.o stab-syms.o" ;;
  1351. +     amiga_vec)            tb="$tb amiga.o" ;;
  1352.       aout_mips_big_vec)        tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
  1353.       aout_mips_little_vec)    tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
  1354.       apollocoff_vec)        tb="$tb coff-apollo.o" ;;
  1355. ***************
  1356. *** 261,270 ****
  1357.   
  1358.   test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
  1359.   
  1360.   echo "TDEFAULTS = \
  1361. ! ${defvec+-DDEFAULT_VECTOR=$defvec} \
  1362. ! ${selvecs+-DSELECT_VECS='$selvecs'} \
  1363. ! ${selarchs+-DSELECT_ARCHITECTURES='$selarchs'}" \
  1364.     >> Makefile.2
  1365.   
  1366.   cat Makefile.tmp >> Makefile.2
  1367. --- 262,273 ----
  1368.   
  1369.   test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
  1370.   
  1371. + # Because of a bug in pdksh on the Amiga, the -D args in the TDEFAULTS
  1372. + # line are preexpanded to the appropriate Amiga args.
  1373.   echo "TDEFAULTS = \
  1374. ! -DDEFAULT_VECTOR=amiga_vec \
  1375. ! -DSELECT_VECS='&amiga_vec' \
  1376. ! -DSELECT_ARCHITECTURES=bfd_m68k_arch" \
  1377.     >> Makefile.2
  1378.   
  1379.   cat Makefile.tmp >> Makefile.2
  1380. diff -rc --new-file gdb-4.12/bfd/hosts/amigados.h /gnu/src/amiga/gdb-4.12/bfd/hosts/amigados.h
  1381. *** gdb-4.12/bfd/hosts/amigados.h    Thu Jan  1 00:00:00 1970
  1382. --- /gnu/src/amiga/gdb-4.12/bfd/hosts/amigados.h    Fri Jun 17 07:33:40 1994
  1383. ***************
  1384. *** 0 ****
  1385. --- 1,8 ----
  1386. + /* Host configuration for AmigaDOS */
  1387. + #ifndef hosts_amigados_h
  1388. + #define hosts_amigados_h
  1389. + #include "hosts/std-host.h"
  1390. + #endif /* hosts_amigados_h */
  1391. diff -rc --new-file gdb-4.12/bfd/libamiga.h /gnu/src/amiga/gdb-4.12/bfd/libamiga.h
  1392. *** gdb-4.12/bfd/libamiga.h    Thu Jan  1 00:00:00 1970
  1393. --- /gnu/src/amiga/gdb-4.12/bfd/libamiga.h    Fri Jun 17 07:33:41 1994
  1394. ***************
  1395. *** 0 ****
  1396. --- 1,149 ----
  1397. + /* BFD back-end data structures for AmigaOS.
  1398. +    Copyright (C) 1992-1994 Free Software Foundation, Inc.
  1399. +    Contributed by Leonard Norrgard.
  1400. + This file is part of BFD, the Binary File Descriptor library.
  1401. + This program is free software; you can redistribute it and/or modify
  1402. + it under the terms of the GNU General Public License as published by
  1403. + the Free Software Foundation; either version 2 of the License, or
  1404. + (at your option) any later version.
  1405. + This program is distributed in the hope that it will be useful,
  1406. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  1407. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1408. + GNU General Public License for more details.
  1409. + You should have received a copy of the GNU General Public License
  1410. + along with this program; if not, write to the Free Software
  1411. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  1412. + #ifdef __STDC__
  1413. + #define CAT3(a,b,c) a##b##c
  1414. + #else
  1415. + #define CAT3(a,b,c) a/**/b/**/c
  1416. + #endif
  1417. + #define GET_WORD bfd_h_get_32
  1418. + #define GET_SWORD (int32_type)GET_WORD
  1419. + #define PUT_WORD bfd_h_put_32
  1420. + #define NAME(x,y) CAT3(x,_32_,y)
  1421. + #define JNAME(x) CAT(x,_32)
  1422. + #define BYTES_IN_WORD 4
  1423. + /* Hunk ID numbers.  */
  1424. + #define HUNK_UNIT       999
  1425. + #define HUNK_NAME    1000
  1426. + #define HUNK_CODE    1001
  1427. + #define HUNK_DATA    1002
  1428. + #define HUNK_BSS    1003
  1429. + #define HUNK_RELOC32    1004
  1430. + #define HUNK_RELOC16    1005
  1431. + #define HUNK_RELOC8    1006
  1432. + #define HUNK_EXT    1007
  1433. + #define HUNK_SYMBOL    1008
  1434. + #define HUNK_DEBUG    1009
  1435. + #define HUNK_END    1010
  1436. + #define HUNK_HEADER    1011
  1437. + #define HUNK_OVERLAY    1013
  1438. + #define HUNK_BREAK    1014
  1439. + #define HUNK_DREL32    1015
  1440. + #define HUNK_DREL16    1016
  1441. + #define HUNK_DREL8    1017
  1442. + #define HUNK_LIB    1018
  1443. + #define HUNK_INDEX    1019
  1444. + /* The hunk ID part.  */
  1445. + #define HUNK_VALUE(hunk_id) ((hunk_id) & 0x3fffffff)
  1446. + /* Attributes of a hunk.  */
  1447. + #define HUNK_ATTRIBUTE(hunk_id) ((hunk_id) >> 30)
  1448. + #define HUNK_ATTR_CHIP 0x01 /* Hunk contents must go into chip (graphics) memory.  */
  1449. + /* HUNK_EXT sub-types.  */
  1450. + #define EXT_SYMB    0    /* Symbol table.  */
  1451. + #define EXT_DEF        1    /* Relocatable definition.  */
  1452. + #define EXT_ABS        2    /* Absolute definition. */
  1453. + #define EXT_RES        3    /* Obsolete.  */
  1454. + #define EXT_REF32    129    /* 32 bit reference to symbol.  */
  1455. + #define EXT_COMMON    130    /* 32 bit reference to COMMON block.  */
  1456. + #define EXT_REF16    131    /* 16 bit reference to symbol.  */
  1457. + #define EXT_REF8    132    /*  8 bit reference to symbol.  */
  1458. + #define EXT_DEXT32    133    /* 32 bit data releative reference.  */
  1459. + #define EXT_DEXT16    134    /* 16 bit data releative reference.  */
  1460. + #define EXT_DEXT8    135    /*  8 bit data releative reference.  */
  1461. + typedef struct amiga_reloc {
  1462. +   arelent relent;
  1463. +   struct amiga_reloc *next;
  1464. +   int symbol_number;
  1465. +   unsigned int target_hunk;
  1466. + } amiga_reloc_type;
  1467. + typedef struct amiga_symbol {
  1468. +   asymbol symbol;
  1469. +   struct amiga_symbol *next;
  1470. +   unsigned long hunk_number;
  1471. +   unsigned long value;
  1472. +   unsigned char type;
  1473. + } amiga_symbol_type;
  1474. + typedef struct amiga_per_section
  1475. + {
  1476. +   amiga_reloc_type *reloc_tail_ptr;
  1477. + } amiga_per_section_type;
  1478. + #define amiga_per_section(x) ((amiga_per_section_type *)((x)->used_by_bfd))
  1479. + /* The `tdata' struct for all a.out-like object file formats.
  1480. +    Various things depend on this struct being around any time an a.out
  1481. +    file is being handled.  An example is dbxread.c in GDB.  */
  1482. + struct amiga_data {
  1483. +   struct internal_exec *hdr;        /* exec file header */
  1484. +   amiga_symbol_type *symbols;        /* symtab for input bfd */
  1485. +   /* Filler, so we can pretend to be an a.out to GDB.  */
  1486. +   asection *dummy_1_textsec;
  1487. +   asection *dummy_2_datasec;
  1488. +   asection *dummy_3_bsssec;
  1489. +   /* The positions of the string table and symbol table.  */
  1490. +   file_ptr sym_filepos;
  1491. +   file_ptr str_filepos;
  1492. +   unsigned int n_symbols;               /* number of symbols */
  1493. +   /* Size of a relocation entry in external form */
  1494. +   unsigned dummy_reloc_entry_size;
  1495. +   /* Size of a symbol table entry in external form */
  1496. +   unsigned symbol_entry_size;
  1497. +   unsigned exec_bytes_size;
  1498. +   unsigned vma_adjusted : 1;  
  1499. + };
  1500. + typedef struct  amiga_data_struct {
  1501. +   struct amiga_data a;
  1502. +   unsigned long symtab_size;
  1503. +   unsigned long stringtab_size;
  1504. +   unsigned long *first_byte;
  1505. +   unsigned long *file_end;
  1506. +   unsigned long *file_pointer;
  1507. +   amiga_symbol_type *external_symbols;
  1508. +   amiga_symbol_type *external_references;
  1509. +   amiga_symbol_type **symbol_tail_ptr;
  1510. + } amiga_data_type;
  1511. + #define    adata(bfd)        ((bfd)->tdata.amiga_data->a)
  1512. + /* We take the address of the first element of an asymbol to ensure that the
  1513. +    macro is only ever applied to an asymbol */
  1514. + #define amiga_symbol(asymbol) ((amiga_symbol_type *)(&(asymbol)->the_bfd))
  1515. + #define AMIGA_DATA(abfd) ((abfd)->tdata.amiga_data)
  1516. diff -rc --new-file gdb-4.12/bfd/targets.c /gnu/src/amiga/gdb-4.12/bfd/targets.c
  1517. *** gdb-4.12/bfd/targets.c    Thu Feb  3 17:00:59 1994
  1518. --- /gnu/src/amiga/gdb-4.12/bfd/targets.c    Fri Jun 17 07:33:42 1994
  1519. ***************
  1520. *** 129,135 ****
  1521.   .  bfd_target_oasys_flavour,
  1522.   .  bfd_target_tekhex_flavour,
  1523.   .  bfd_target_srec_flavour,
  1524. ! .  bfd_target_som_flavour};
  1525.   .
  1526.   .{* Forward declaration.  *}
  1527.   .typedef struct bfd_link_info _bfd_link_info;
  1528. --- 129,136 ----
  1529.   .  bfd_target_oasys_flavour,
  1530.   .  bfd_target_tekhex_flavour,
  1531.   .  bfd_target_srec_flavour,
  1532. ! .  bfd_target_som_flavour,
  1533. ! .  bfd_target_amiga_flavour};
  1534.   .
  1535.   .{* Forward declaration.  *}
  1536.   .typedef struct bfd_link_info _bfd_link_info;
  1537. ***************
  1538. *** 339,344 ****
  1539. --- 340,346 ----
  1540.      we can't intermix extern's and initializers.  */
  1541.   extern bfd_target a29kcoff_big_vec;
  1542.   extern bfd_target a_out_adobe_vec;
  1543. + extern bfd_target amiga_vec;
  1544.   extern bfd_target aout_mips_big_vec;
  1545.   extern bfd_target aout_mips_little_vec;
  1546.   extern bfd_target apollocoff_vec;
  1547. ***************
  1548. *** 430,435 ****
  1549. --- 432,438 ----
  1550.          it wasn't omitted by mistake.  */
  1551.       &a29kcoff_big_vec,
  1552.       &a_out_adobe_vec,
  1553. +         &amiga_vec,
  1554.   #if 0                /* No one seems to use this.  */
  1555.       &aout_mips_big_vec,
  1556.   #endif
  1557. diff -rc --new-file gdb-4.12/config/mh-amigados /gnu/src/amiga/gdb-4.12/config/mh-amigados
  1558. *** gdb-4.12/config/mh-amigados    Thu Jan  1 00:00:00 1970
  1559. --- /gnu/src/amiga/gdb-4.12/config/mh-amigados    Fri Jun 17 07:33:43 1994
  1560. ***************
  1561. *** 0 ****
  1562. --- 1,6 ----
  1563. + # Host makefile fragment for Commodore Amiga running AmigaDOS.
  1564. + # There is no standard system compiler.  Assume use GNU C.
  1565. + CC = gcc
  1566. + # There is no support for -g yet.  But use -O instead.
  1567. + CFLAGS = -O
  1568. diff -rc --new-file gdb-4.12/configure /gnu/src/amiga/gdb-4.12/configure
  1569. *** gdb-4.12/configure    Thu Feb  3 17:27:16 1994
  1570. --- /gnu/src/amiga/gdb-4.12/configure    Fri Jun 17 19:26:30 1994
  1571. ***************
  1572. *** 33,43 ****
  1573.   #       config.status is removed.
  1574.   #
  1575.   
  1576.   export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0 $argv; kill $$)
  1577.   
  1578.   remove=rm
  1579. ! hard_link=ln
  1580. ! symbolic_link='ln -s'
  1581.   
  1582.   #for Test
  1583.   #remove="echo rm"
  1584. --- 33,46 ----
  1585.   #       config.status is removed.
  1586.   #
  1587.   
  1588. + # In places where the argument to echo may start with a '-', use /bin/echo
  1589. + # since the AmigaDOS pdksh builtin echo botches this case.
  1590.   export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0 $argv; kill $$)
  1591.   
  1592.   remove=rm
  1593. ! hard_link=cp
  1594. ! symbolic_link=cp
  1595.   
  1596.   #for Test
  1597.   #remove="echo rm"
  1598. ***************
  1599. *** 68,74 ****
  1600.   next_tmpdir=
  1601.   norecursion=
  1602.   package_makefile_frag=
  1603. ! prefix=/usr/local
  1604.   progname=
  1605.   program_prefix=
  1606.   program_prefixoption=
  1607. --- 71,80 ----
  1608.   next_tmpdir=
  1609.   norecursion=
  1610.   package_makefile_frag=
  1611. ! # This is a hack so we don't have to remember to always configure using
  1612. ! # the "--prefix=/gnu" option.  Personally I feel this should be settable
  1613. ! # in a config file.  -fnf
  1614. ! prefix=/gnu
  1615.   progname=
  1616.   program_prefix=
  1617.   program_prefixoption=
  1618. ***************
  1619. *** 105,113 ****
  1620.   ## path.  Since PATH might include "." we also add `pwd` to the end of PATH.
  1621.   ##
  1622.   
  1623. ! progname=$0
  1624.   # if PWD already has a value, it is probably wrong.
  1625. ! if [ -n "$PWD" ]; then PWD=`pwd`; fi
  1626.   
  1627.   case "${progname}" in
  1628.   /*) ;;
  1629. --- 111,122 ----
  1630.   ## path.  Since PATH might include "." we also add `pwd` to the end of PATH.
  1631.   ##
  1632.   
  1633. ! # For some reason, the value of $0 in AmigaDOS pdksh ends up with a
  1634. ! # trailing '/' that needs to be stripped.
  1635. ! progname=`/bin/echo $0 | sed 's:/$::'`
  1636.   # if PWD already has a value, it is probably wrong.
  1637. ! # The AmigaDOS pksh can't change the value of PWD, it's readonly.
  1638. ! #if [ -n "$PWD" ]; then PWD=`pwd`; fi
  1639.   
  1640.   case "${progname}" in
  1641.   /*) ;;
  1642. ***************
  1643. *** 127,133 ****
  1644.                   next_exec_prefix=
  1645.           elif [ -n "${next_site}" ] ; then site=${arg} ; site_option=-site=${site} ; next_site=
  1646.           # remove any possible trailing slash from srcdir.  See note below.
  1647. !         elif [ -n "${next_srcdir}" ] ; then srcdir=`echo ${arg} | sed -e 's:/$::'` ; next_srcdir=
  1648.           elif [ -n "${next_program_prefix}" ] ; then
  1649.                   program_prefix=${arg}
  1650.                   program_prefixoption="-program_prefix=${program_prefix}"
  1651. --- 136,142 ----
  1652.                   next_exec_prefix=
  1653.           elif [ -n "${next_site}" ] ; then site=${arg} ; site_option=-site=${site} ; next_site=
  1654.           # remove any possible trailing slash from srcdir.  See note below.
  1655. !         elif [ -n "${next_srcdir}" ] ; then srcdir=`/bin/echo ${arg} | sed -e 's:/$::'` ; next_srcdir=
  1656.           elif [ -n "${next_program_prefix}" ] ; then
  1657.                   program_prefix=${arg}
  1658.                   program_prefixoption="-program_prefix=${program_prefix}"
  1659. ***************
  1660. *** 139,145 ****
  1661.           elif [ -n "${next_program_transform_name}" ] ; then
  1662.                   # Double any backslashes or dollar signs in the argument
  1663.           if [ -n "${arg}" ] ; then
  1664. !             program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
  1665.           fi
  1666.                   program_transform_nameoption="${program_transform_nameoption} --program-transform-name='${arg}'"
  1667.                   next_program_transform_name=
  1668. --- 148,154 ----
  1669.           elif [ -n "${next_program_transform_name}" ] ; then
  1670.                   # Double any backslashes or dollar signs in the argument
  1671.           if [ -n "${arg}" ] ; then
  1672. !             program_transform_name="${program_transform_name} -e `/bin/echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
  1673.           fi
  1674.                   program_transform_nameoption="${program_transform_nameoption} --program-transform-name='${arg}'"
  1675.                   next_program_transform_name=
  1676. ***************
  1677. *** 185,191 ****
  1678.                   case ${arg} in
  1679.                   -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
  1680.                           case "${build_alias}" in
  1681. !                         "") build_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`" ;;
  1682.                           *)
  1683.                                   echo '***' Can only configure for one build machine at a time.  1>&2
  1684.                                   fatal=yes
  1685. --- 194,200 ----
  1686.                   case ${arg} in
  1687.                   -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
  1688.                           case "${build_alias}" in
  1689. !                         "") build_alias="`/bin/echo ${arg} | sed 's/^[-a-z]*=//'`" ;;
  1690.                           *)
  1691.                                   echo '***' Can only configure for one build machine at a time.  1>&2
  1692.                                   fatal=yes
  1693. ***************
  1694. *** 196,202 ****
  1695.                           next_build=yes
  1696.                           ;;
  1697.                   -exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=* | -exec-prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* )
  1698. !                         exec_prefix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
  1699.                           exec_prefixoption=${arg}
  1700.                           ;;
  1701.                   -exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e | -exec-prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec-)
  1702. --- 205,211 ----
  1703.                           next_build=yes
  1704.                           ;;
  1705.                   -exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=* | -exec-prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* )
  1706. !                         exec_prefix=`/bin/echo ${arg} | sed 's/^[-a-z_]*=//'`
  1707.                           exec_prefixoption=${arg}
  1708.                           ;;
  1709.                   -exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e | -exec-prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec-)
  1710. ***************
  1711. *** 211,217 ****
  1712.                   -host=* | --host=* | --hos=* | --ho=*)
  1713.                           case "${host_alias}" in
  1714.                           "")
  1715. !                                 host_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`"
  1716.                                   ;;
  1717.                           *)
  1718.                                   echo '***' Can only configure for one host at a time.  1>&2
  1719. --- 220,226 ----
  1720.                   -host=* | --host=* | --hos=* | --ho=*)
  1721.                           case "${host_alias}" in
  1722.                           "")
  1723. !                                 host_alias="`/bin/echo ${arg} | sed 's/^[-a-z]*=//'`"
  1724.                                   ;;
  1725.                           *)
  1726.                                   echo '***' Can only configure for one host at a time.  1>&2
  1727. ***************
  1728. *** 237,243 ****
  1729.                           norecursion=true
  1730.                           ;;
  1731.                   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=*)
  1732. !                         prefix=`echo ${arg} | sed 's/^[-a-z]*=//'`
  1733.                           prefixoption=${arg}
  1734.                           ;;
  1735.                   -prefix | --prefix | --prefi | --pref | --pre)
  1736. --- 246,252 ----
  1737.                           norecursion=true
  1738.                           ;;
  1739.                   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=*)
  1740. !                         prefix=`/bin/echo ${arg} | sed 's/^[-a-z]*=//'`
  1741.                           prefixoption=${arg}
  1742.                           ;;
  1743.                   -prefix | --prefix | --prefi | --pref | --pre)
  1744. ***************
  1745. *** 245,268 ****
  1746.                           ;;
  1747.                   -rm | --rm) removing=${arg} ;;
  1748.                   -program_prefix=* | --program_prefix=* | --program_prefi=* | --program_pref=* | --program_pre=* | --program_pr=* | --program_p=* | -program-prefix=* | --program-prefix=* | --program-prefi=* | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
  1749. !                         program_prefix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
  1750.                           program_prefixoption=${arg}
  1751.                           ;;
  1752.                   -program_prefix | --program_prefix | --program_prefi | --program_pref | --program_pre | --program_pr | --program_p | -program-prefix | --program-prefix | --program-prefi | --program-pref | --program-pre | --program-pr | --program-p)
  1753.                           next_program_prefix=yes
  1754.                           ;;
  1755.                   -program_suffix=* | --program_suffix=* | --program_suffi=* | --program_suff=* | --program_suf=* | --program_su=* | --program_s=* | -program-suffix=* | --program-suffix=* | --program-suffi=* | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
  1756. !                         program_suffix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
  1757.                           program_suffixoption=${arg}
  1758.                           ;;
  1759.                   -program_suffix | --program_suffix | --program_suffi | --program_suff | --program_suf | --program_su | --program_s |-program-suffix | --program-suffix | --program-suffi | --program-suff | --program-suf | --program-su | --program-s)
  1760.                           next_program_suffix=yes
  1761.                           ;;
  1762.                   -program_transform_name=* | --program_transform_name=* | --program_transform_nam=* | --program_transform_na=* | --program_transform_n=* | --program_transform_=* | --program_transform=* | --program_transfor=* | --program_transfo=* | --program_transf=* | --program_trans=* | --program_tran=* | --program_tra=* | --program_tr=* | --program_t=* | -program-transform-name=* | --program-transform-name=* | --program-transform-nam=* | --program-transform-na=* | --program-transform-n=* | --program-transform-=* | --program-transform=* | --program-transfor=* | --program-transfo=* | --program-transf=* | --program-trans=* | --program-tran=* | --program-tra=* | --program-tr=* | --program-t=*)
  1763. !             arg=`echo ${arg} | sed -e 's/^[-a-z_]*=//'`
  1764.                           # Double any \ or $ in the argument
  1765.               if [ -n "${arg}" ] ; then
  1766. !                             program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
  1767.               fi
  1768.                           program_transform_nameoption="${program_transform_nameoption} --program-transform-name='${arg}'"
  1769.                           ;;
  1770. --- 254,277 ----
  1771.                           ;;
  1772.                   -rm | --rm) removing=${arg} ;;
  1773.                   -program_prefix=* | --program_prefix=* | --program_prefi=* | --program_pref=* | --program_pre=* | --program_pr=* | --program_p=* | -program-prefix=* | --program-prefix=* | --program-prefi=* | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
  1774. !                         program_prefix=`/bin/echo ${arg} | sed 's/^[-a-z_]*=//'`
  1775.                           program_prefixoption=${arg}
  1776.                           ;;
  1777.                   -program_prefix | --program_prefix | --program_prefi | --program_pref | --program_pre | --program_pr | --program_p | -program-prefix | --program-prefix | --program-prefi | --program-pref | --program-pre | --program-pr | --program-p)
  1778.                           next_program_prefix=yes
  1779.                           ;;
  1780.                   -program_suffix=* | --program_suffix=* | --program_suffi=* | --program_suff=* | --program_suf=* | --program_su=* | --program_s=* | -program-suffix=* | --program-suffix=* | --program-suffi=* | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
  1781. !                         program_suffix=`/bin/echo ${arg} | sed 's/^[-a-z_]*=//'`
  1782.                           program_suffixoption=${arg}
  1783.                           ;;
  1784.                   -program_suffix | --program_suffix | --program_suffi | --program_suff | --program_suf | --program_su | --program_s |-program-suffix | --program-suffix | --program-suffi | --program-suff | --program-suf | --program-su | --program-s)
  1785.                           next_program_suffix=yes
  1786.                           ;;
  1787.                   -program_transform_name=* | --program_transform_name=* | --program_transform_nam=* | --program_transform_na=* | --program_transform_n=* | --program_transform_=* | --program_transform=* | --program_transfor=* | --program_transfo=* | --program_transf=* | --program_trans=* | --program_tran=* | --program_tra=* | --program_tr=* | --program_t=* | -program-transform-name=* | --program-transform-name=* | --program-transform-nam=* | --program-transform-na=* | --program-transform-n=* | --program-transform-=* | --program-transform=* | --program-transfor=* | --program-transfo=* | --program-transf=* | --program-trans=* | --program-tran=* | --program-tra=* | --program-tr=* | --program-t=*)
  1788. !             arg=`/bin/echo ${arg} | sed -e 's/^[-a-z_]*=//'`
  1789.                           # Double any \ or $ in the argument
  1790.               if [ -n "${arg}" ] ; then
  1791. !                             program_transform_name="${program_transform_name} -e `/bin/echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
  1792.               fi
  1793.                           program_transform_nameoption="${program_transform_nameoption} --program-transform-name='${arg}'"
  1794.                           ;;
  1795. ***************
  1796. *** 271,277 ****
  1797.                           ;;
  1798.                   -site=* | --site=* | --sit=* | --si=*)
  1799.                           site_option=${arg}
  1800. !                         site=`echo ${arg} | sed 's/^[-a-z]*=//'`
  1801.                           ;;
  1802.                   -site | --site | --sit)
  1803.                           next_site=yes
  1804. --- 280,286 ----
  1805.                           ;;
  1806.                   -site=* | --site=* | --sit=* | --si=*)
  1807.                           site_option=${arg}
  1808. !                         site=`/bin/echo ${arg} | sed 's/^[-a-z]*=//'`
  1809.                           ;;
  1810.                   -site | --site | --sit)
  1811.                           next_site=yes
  1812. ***************
  1813. *** 281,294 ****
  1814.                   # it.  Ordinarily this is ok, but emacs takes double slash to
  1815.                   # mean "forget the first part".
  1816.                   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  1817. !                         srcdir=`echo ${arg} | sed 's/^[-a-z]*=//' | sed -e 's:/$::'`
  1818.                           ;;
  1819.                   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
  1820.                           next_srcdir=yes
  1821.                           ;;
  1822.                   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=*)
  1823.                           case "${target_alias}" in
  1824. !                         "") target_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`" ;;
  1825.                           *)
  1826.                                   echo '***' Can only configure for one target at a time.  1>&2
  1827.                                   fatal=yes
  1828. --- 290,303 ----
  1829.                   # it.  Ordinarily this is ok, but emacs takes double slash to
  1830.                   # mean "forget the first part".
  1831.                   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  1832. !                         srcdir=`/bin/echo ${arg} | sed 's/^[-a-z]*=//' | sed -e 's:/$::'`
  1833.                           ;;
  1834.                   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
  1835.                           next_srcdir=yes
  1836.                           ;;
  1837.                   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=*)
  1838.                           case "${target_alias}" in
  1839. !                         "") target_alias="`/bin/echo ${arg} | sed 's/^[-a-z]*=//'`" ;;
  1840.                           *)
  1841.                                   echo '***' Can only configure for one target at a time.  1>&2
  1842.                                   fatal=yes
  1843. ***************
  1844. *** 300,311 ****
  1845.                           ;;
  1846.                   -tmpdir=* | --tmpdir=* | --tmpdi=* | --tmpd=* | --tmp=* | --tm=*)
  1847.                           tmpdiroption=${arg}
  1848. !                         TMPDIR=`echo ${arg} | sed 's/^[-a-z]*=//'`
  1849.                           ;;
  1850.                   -tmpdir | --tmpdir | --tmpdi | --tmpd | --tmp | --tm)
  1851.                           next_tmpdir=yes
  1852.                           ;;
  1853. !                 -v | -verbose | --v)
  1854.                           redirect=
  1855.                           verbose=-v
  1856.                           ;;
  1857. --- 309,320 ----
  1858.                           ;;
  1859.                   -tmpdir=* | --tmpdir=* | --tmpdi=* | --tmpd=* | --tmp=* | --tm=*)
  1860.                           tmpdiroption=${arg}
  1861. !                         TMPDIR=`/bin/echo ${arg} | sed 's/^[-a-z]*=//'`
  1862.                           ;;
  1863.                   -tmpdir | --tmpdir | --tmpdi | --tmpd | --tmp | --tm)
  1864.                           next_tmpdir=yes
  1865.                           ;;
  1866. !                 -v | -verbose | --v | --verb*)
  1867.                           redirect=
  1868.                           verbose=-v
  1869.                           ;;
  1870. ***************
  1871. *** 314,331 ****
  1872.                           exit 0
  1873.                           ;;
  1874.                   -with*=* | --with*=*)
  1875. !                         withopt=`echo ${arg} | sed 's:^-*\(with[^=]*\)=.*$:\1:;s/-/_/g'`
  1876. !                         withval=`echo ${arg} | sed 's:^-*with[^=]*=\(.*\)$:\1:'`
  1877.                           eval $withopt="$withval"
  1878.                           withoptions="$withoptions $arg"
  1879.                           ;;
  1880.                   -without* | --without*)
  1881. !                         withopt=`echo ${arg} | sed 's:^-*without:with:;s/-/_/g'`        
  1882.                           eval $withopt=no
  1883.                           withoutoptions="$withoutoptions $arg"
  1884.                           ;;
  1885.                   -with* | --with*)
  1886. !                         withopt=`echo ${arg} | sed 's:^-*with:with:;s/-/_/g'`
  1887.                           eval $withopt=yes
  1888.                           withoptions="$withoptions $arg"
  1889.                           ;;
  1890. --- 323,340 ----
  1891.                           exit 0
  1892.                           ;;
  1893.                   -with*=* | --with*=*)
  1894. !                         withopt=`/bin/echo ${arg} | sed 's:^-*\(with[^=]*\)=.*$:\1:;s/-/_/g'`
  1895. !                         withval=`/bin/echo ${arg} | sed 's:^-*with[^=]*=\(.*\)$:\1:'`
  1896.                           eval $withopt="$withval"
  1897.                           withoptions="$withoptions $arg"
  1898.                           ;;
  1899.                   -without* | --without*)
  1900. !                         withopt=`/bin/echo ${arg} | sed 's:^-*without:with:;s/-/_/g'`        
  1901.                           eval $withopt=no
  1902.                           withoutoptions="$withoutoptions $arg"
  1903.                           ;;
  1904.                   -with* | --with*)
  1905. !                         withopt=`/bin/echo ${arg} | sed 's:^-*with:with:;s/-/_/g'`
  1906.                           eval $withopt=yes
  1907.                           withoptions="$withoptions $arg"
  1908.                           ;;
  1909. ***************
  1910. *** 549,573 ****
  1911.   *)
  1912.       result=`${configsub} ${build_alias}`
  1913.           buildopt="--build=${build_alias}"
  1914. !     build_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  1915. !     build_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  1916. !     build_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  1917.       build=${build_cpu}-${build_vendor}-${build_os}
  1918.       ;;
  1919.   esac
  1920.   
  1921.   result=`${configsub} ${host_alias}`
  1922. ! host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  1923. ! host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  1924. ! host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  1925.   host=${host_cpu}-${host_vendor}-${host_os}
  1926.   
  1927.   . ${tmpfile}.hst
  1928.   
  1929.   result=`${configsub} ${target_alias}`
  1930. ! target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  1931. ! target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  1932. ! target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  1933.   target=${target_cpu}-${target_vendor}-${target_os}
  1934.   
  1935.   . ${tmpfile}.tgt
  1936. --- 558,582 ----
  1937.   *)
  1938.       result=`${configsub} ${build_alias}`
  1939.           buildopt="--build=${build_alias}"
  1940. !     build_cpu=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  1941. !     build_vendor=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  1942. !     build_os=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  1943.       build=${build_cpu}-${build_vendor}-${build_os}
  1944.       ;;
  1945.   esac
  1946.   
  1947.   result=`${configsub} ${host_alias}`
  1948. ! host_cpu=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  1949. ! host_vendor=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  1950. ! host_os=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  1951.   host=${host_cpu}-${host_vendor}-${host_os}
  1952.   
  1953.   . ${tmpfile}.hst
  1954.   
  1955.   result=`${configsub} ${target_alias}`
  1956. ! target_cpu=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  1957. ! target_vendor=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  1958. ! target_os=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  1959.   target=${target_cpu}-${target_vendor}-${target_os}
  1960.   
  1961.   . ${tmpfile}.tgt
  1962. ***************
  1963. *** 851,857 ****
  1964.           # make sure that some sort of reasonable default exists for these 
  1965.           # two variables
  1966.           CXX=${CXX-"g++ -O"}
  1967. !         CC=${CC-cc}
  1968.   
  1969.               # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
  1970.               # remove any form feeds.
  1971. --- 860,866 ----
  1972.           # make sure that some sort of reasonable default exists for these 
  1973.           # two variables
  1974.           CXX=${CXX-"g++ -O"}
  1975. !         CC=${CC-gcc}
  1976.   
  1977.               # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
  1978.               # remove any form feeds.
  1979. ***************
  1980. *** 988,993 ****
  1981. --- 997,1003 ----
  1982.   
  1983.   ### The recursion line is here.
  1984.               if [ ! -z "${recprog}" ] ; then
  1985. +                             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} ${removing} ${redirect}
  1986.                               if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} \
  1987.                                       ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
  1988.                                       ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${removing} ${redirect} ; then
  1989. diff -rc --new-file gdb-4.12/configure.in /gnu/src/amiga/gdb-4.12/configure.in
  1990. *** gdb-4.12/configure.in    Thu Feb  3 17:27:17 1994
  1991. --- /gnu/src/amiga/gdb-4.12/configure.in    Fri Jun 17 07:33:46 1994
  1992. ***************
  1993. *** 108,113 ****
  1994. --- 108,114 ----
  1995.                   cross_only="xiberty" ;;
  1996.     *-*-sysv4*)             host_makefile_frag=config/mh-sysv4 ;;
  1997.     *-*-sysv*)              host_makefile_frag=config/mh-sysv ;;
  1998. +   *-*-amigados*)      host_makefile_frag=config/mh-amigados ;;
  1999.   esac
  2000.   
  2001.   # per-target:
  2002. diff -rc --new-file gdb-4.12/gdb/Makefile.in /gnu/src/amiga/gdb-4.12/gdb/Makefile.in
  2003. *** gdb-4.12/gdb/Makefile.in    Thu Feb  3 16:45:29 1994
  2004. --- /gnu/src/amiga/gdb-4.12/gdb/Makefile.in    Fri Jun 17 07:33:48 1994
  2005. ***************
  2006. *** 70,77 ****
  2007.   srcdir = .
  2008.   
  2009.   # If you use bison instead of yacc, it needs to include the "-y" argument.
  2010. ! #BISON=bison -y
  2011. ! BISON=yacc
  2012.   YACC=$(BISON)
  2013.   
  2014.   # where to find makeinfo, preferably one designed for texinfo-2
  2015. --- 70,77 ----
  2016.   srcdir = .
  2017.   
  2018.   # If you use bison instead of yacc, it needs to include the "-y" argument.
  2019. ! BISON=bison -y
  2020. ! #BISON=yacc
  2021.   YACC=$(BISON)
  2022.   
  2023.   # where to find makeinfo, preferably one designed for texinfo-2
  2024. ***************
  2025. *** 310,316 ****
  2026.       mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c parse.c \
  2027.       printcmd.c remote.c source.c stabsread.c stack.c symfile.c symmisc.c \
  2028.       symtab.c target.c thread.c typeprint.c utils.c valarith.c valops.c \
  2029. !     valprint.c values.c serial.c ser-unix.c mdebugread.c
  2030.   
  2031.   # Files that are not source code, but need to go into
  2032.   # gdb-$(VERSION).tar.Z.
  2033. --- 310,316 ----
  2034.       mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c parse.c \
  2035.       printcmd.c remote.c source.c stabsread.c stack.c symfile.c symmisc.c \
  2036.       symtab.c target.c thread.c typeprint.c utils.c valarith.c valops.c \
  2037. !     valprint.c values.c serial.c ser-unix.c mdebugread.c amigaread.c
  2038.   
  2039.   # Files that are not source code, but need to go into
  2040.   # gdb-$(VERSION).tar.Z.
  2041. ***************
  2042. *** 443,449 ****
  2043.       dwarfread.o mipsread.o stabsread.o core.o c-lang.o ch-lang.o m2-lang.o \
  2044.       complaints.o typeprint.o c-typeprint.o ch-typeprint.o m2-typeprint.o \
  2045.       c-valprint.o cp-valprint.o ch-valprint.o m2-valprint.o nlmread.o \
  2046. !     serial.o mdebugread.o
  2047.   
  2048.   RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
  2049.   
  2050. --- 443,449 ----
  2051.       dwarfread.o mipsread.o stabsread.o core.o c-lang.o ch-lang.o m2-lang.o \
  2052.       complaints.o typeprint.o c-typeprint.o ch-typeprint.o m2-typeprint.o \
  2053.       c-valprint.o cp-valprint.o ch-valprint.o m2-valprint.o nlmread.o \
  2054. !     serial.o mdebugread.o amigaread.o
  2055.   
  2056.   RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
  2057.   
  2058. ***************
  2059. *** 870,876 ****
  2060.   ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
  2061.       29k-share/udi/udi2go32.c \
  2062.       a29k-pinsn.c a29k-tdep.c a68v-nat.c alpha-nat.c alpha-tdep.c \
  2063. !     altos-xdep.c arm-convert.s \
  2064.       arm-pinsn.c arm-tdep.c arm-xdep.c coff-solib.c convex-pinsn.c \
  2065.       convex-tdep.c \
  2066.       convex-xdep.c core-svr4.c coredep.c corelow.c dcache.c delta68-nat.c \
  2067. --- 870,876 ----
  2068.   ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
  2069.       29k-share/udi/udi2go32.c \
  2070.       a29k-pinsn.c a29k-tdep.c a68v-nat.c alpha-nat.c alpha-tdep.c \
  2071. !     altos-xdep.c amigaread.c arm-convert.s \
  2072.       arm-pinsn.c arm-tdep.c arm-xdep.c coff-solib.c convex-pinsn.c \
  2073.       convex-tdep.c \
  2074.       convex-xdep.c core-svr4.c coredep.c corelow.c dcache.c delta68-nat.c \
  2075. ***************
  2076. *** 1074,1079 ****
  2077. --- 1074,1081 ----
  2078.       $(inferior_h) $(symtab_h) $(dis-asm.h)
  2079.   
  2080.   altos-xdep.o: altos-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
  2081. + amigaread.o: amigaread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
  2082. +     gdb-stabs.h objfiles.h symfile.h $(symtab_h)
  2083.   arm-pinsn.o: arm-pinsn.c $(OP_INCLUDE)/arm.h $(defs_h) $(symtab_h)
  2084.   
  2085.   blockframe.o: blockframe.c $(defs_h) $(gdbcore_h) $(inferior_h) \
  2086. diff -rc --new-file gdb-4.12/gdb/amigaread.c /gnu/src/amiga/gdb-4.12/gdb/amigaread.c
  2087. *** gdb-4.12/gdb/amigaread.c    Thu Jan  1 00:00:00 1970
  2088. --- /gnu/src/amiga/gdb-4.12/gdb/amigaread.c    Fri Jun 17 07:33:49 1994
  2089. ***************
  2090. *** 0 ****
  2091. --- 1,256 ----
  2092. + /* Read Amigados object files for GDB.
  2093. +    Copyright 1991, 1992, 1994 Free Software Foundation, Inc.
  2094. +    Converted to Amigados format files by Leonard Norrgard.  Original
  2095. +    was paread.c by Fred Fish.
  2096. + This file is part of GDB.
  2097. + This program is free software; you can redistribute it and/or modify
  2098. + it under the terms of the GNU General Public License as published by
  2099. + the Free Software Foundation; either version 2 of the License, or
  2100. + (at your option) any later version.
  2101. + This program is distributed in the hope that it will be useful,
  2102. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  2103. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2104. + GNU General Public License for more details.
  2105. + You should have received a copy of the GNU General Public License
  2106. + along with this program; if not, write to the Free Software
  2107. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  2108. + #include "defs.h"
  2109. + #include "bfd.h"
  2110. + #include <time.h> /* For time_t in libbfd.h.  */
  2111. + #include <sys/types.h> /* For time_t, if not in time.h.  */
  2112. + #include "libbfd.h"
  2113. + #include "libamiga.h"
  2114. + #include "symtab.h"
  2115. + #include "symfile.h"
  2116. + #include "objfiles.h"
  2117. + #include "buildsym.h"
  2118. + #include "stabsread.h"
  2119. + #include "gdb-stabs.h"
  2120. + #include "complaints.h"
  2121. + #include <string.h>
  2122. + #include "demangle.h"
  2123. + #include <sys/file.h>
  2124. + #include "aout/aout64.h"
  2125. + /* Various things we might complain about... */
  2126. + static void
  2127. + amiga_symfile_init PARAMS ((struct objfile *));
  2128. + static void
  2129. + amiga_new_init PARAMS ((struct objfile *));
  2130. + extern void
  2131. + amiga_symfile_read PARAMS ((struct objfile *, struct section_offsets *, int));
  2132. + static void
  2133. + amiga_symfile_finish PARAMS ((struct objfile *));
  2134. + static void
  2135. + free_amigainfo PARAMS ((PTR));
  2136. + static struct section_offsets *
  2137. + amiga_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
  2138. + static void
  2139. + record_minimal_symbol PARAMS ((char *, CORE_ADDR,
  2140. +                    enum minimal_symbol_type,
  2141. +                    struct objfile *));
  2142. + static void
  2143. + record_minimal_symbol (name, address, ms_type, objfile)
  2144. +      char *name;
  2145. +      CORE_ADDR address;
  2146. +      enum minimal_symbol_type ms_type;
  2147. +      struct objfile *objfile;
  2148. + {
  2149. +   name = obsavestring (name, strlen (name), &objfile -> symbol_obstack);
  2150. +   prim_record_minimal_symbol (name, address, ms_type, objfile);
  2151. + }
  2152. + /* This cleans up the objfile's sym_stab_info pointer, and the chain of
  2153. +    stab_section_info's, that might be dangling from it.  */
  2154. + static void
  2155. + free_amigainfo (objp)
  2156. +      PTR objp;
  2157. + {
  2158. +   struct objfile *objfile = (struct objfile *)objp;
  2159. +   struct dbx_symfile_info *dbxinfo = (struct dbx_symfile_info *)
  2160. +                      objfile->sym_stab_info;
  2161. +   struct stab_section_info *ssi, *nssi;
  2162. +   ssi = dbxinfo->stab_section_info;
  2163. +   while (ssi)
  2164. +     {
  2165. +       nssi = ssi->next;
  2166. +       mfree (objfile->md, ssi);
  2167. +       ssi = nssi;
  2168. +     }
  2169. +   dbxinfo->stab_section_info = 0;    /* Just say No mo info about this.  */
  2170. + }
  2171. + /* Initialize anything that needs initializing when a completely new symbol
  2172. +    file is specified (not just adding some symbols from another file, e.g. a
  2173. +    shared library).
  2174. +    We reinitialize buildsym, since we may be reading stabs from an amigados file.  */
  2175. + static void
  2176. + amiga_new_init (ignore)
  2177. +      struct objfile *ignore;
  2178. + {
  2179. +   stabsread_new_init ();
  2180. +   buildsym_new_init ();
  2181. + }
  2182. + /* Perform any local cleanups required when we are done with a particular
  2183. +    objfile.  I.E, we are in the process of discarding all symbol information
  2184. +    for an objfile, freeing up all memory held for it, and unlinking the
  2185. +    objfile struct from the global list of known objfiles. */
  2186. + static void
  2187. + amiga_symfile_finish (objfile)
  2188. +      struct objfile *objfile;
  2189. + {
  2190. +   if (objfile -> sym_stab_info != NULL)
  2191. +     {
  2192. +       mfree (objfile -> md, objfile -> sym_stab_info);
  2193. +     }
  2194. + }
  2195. + /* Amigados specific initialization routine for reading symbols.
  2196. +    It is passed a pointer to a struct sym_fns which contains, among other
  2197. +    things, the BFD for the file whose symbols are being read, and a slot for
  2198. +    a pointer to "private data" which we can fill with goodies.
  2199. +    This routine is almost a complete ripoff of dbx_symfile_init.  The
  2200. +    common parts of these routines should be extracted and used instead of
  2201. +    duplicating this code.  FIXME. */
  2202. + static void
  2203. + amiga_symfile_init (objfile)
  2204. +      struct objfile *objfile;
  2205. + {
  2206. +   int val;
  2207. +   bfd *sym_bfd = objfile->obfd;
  2208. +   char *name = bfd_get_filename (sym_bfd);
  2209. +   /* Allocate struct to keep track of the symfile */
  2210. +   objfile->sym_stab_info = (PTR)
  2211. +     xmmalloc (objfile -> md, sizeof (struct dbx_symfile_info));
  2212. +   memset ((PTR) objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info));
  2213. +   /* FIXME POKING INSIDE BFD DATA STRUCTURES */
  2214. + #define    STRING_TABLE_OFFSET    adata(sym_bfd).str_filepos
  2215. + #define    SYMBOL_TABLE_OFFSET    adata(sym_bfd).sym_filepos
  2216. +   /* FIXME POKING INSIDE BFD DATA STRUCTURES */
  2217. +   DBX_SYMFILE_INFO (objfile)->stab_section_info = NULL;
  2218. +   DBX_TEXT_SECT (objfile) = bfd_get_section_by_name (sym_bfd, ".text");
  2219. +   if (!DBX_TEXT_SECT (objfile))
  2220. +     error ("Can't find .text section in symbol file");
  2221. +   /* FIXME: I suspect this should be external_nlist.  The size of host
  2222. +      types like long and bfd_vma should not affect how we read the
  2223. +      file.  */
  2224. +   DBX_SYMBOL_SIZE (objfile) = sizeof (struct internal_nlist);
  2225. +   DBX_SYMCOUNT (objfile) = AMIGA_DATA(sym_bfd)->symtab_size
  2226. +     / DBX_SYMBOL_SIZE (objfile);
  2227. +   DBX_SYMTAB_OFFSET (objfile) = SYMBOL_TABLE_OFFSET;
  2228. +   /* Read the string table and stash it away in the psymbol_obstack.  It is
  2229. +      only needed as long as we need to expand psymbols into full symbols,
  2230. +      so when we blow away the psymbol the string table goes away as well.
  2231. +      Note that gdb used to use the results of attempting to malloc the
  2232. +      string table, based on the size it read, as a form of sanity check
  2233. +      for botched byte swapping, on the theory that a byte swapped string
  2234. +      table size would be so totally bogus that the malloc would fail.  Now
  2235. +      that we put in on the psymbol_obstack, we can't do this since gdb gets
  2236. +      a fatal error (out of virtual memory) if the size is bogus.  We can
  2237. +      however at least check to see if the size is zero or some negative
  2238. +      value. */
  2239. +   DBX_STRINGTAB_SIZE (objfile) = AMIGA_DATA (sym_bfd)->stringtab_size;
  2240. +   if (DBX_SYMCOUNT (objfile) == 0
  2241. +       || DBX_STRINGTAB_SIZE (objfile) == 0)
  2242. +     return;
  2243. +   if (DBX_STRINGTAB_SIZE (objfile) <= 0
  2244. +       || DBX_STRINGTAB_SIZE (objfile) > bfd_get_size (sym_bfd))
  2245. +     error ("ridiculous string table size (%d bytes).",
  2246. +        DBX_STRINGTAB_SIZE (objfile));
  2247. +   DBX_STRINGTAB (objfile) =
  2248. +     (char *) obstack_alloc (&objfile -> psymbol_obstack,
  2249. +                 DBX_STRINGTAB_SIZE (objfile));
  2250. +   /* Now read in the string table in one big gulp.  */
  2251. +   val = bfd_seek (sym_bfd, STRING_TABLE_OFFSET, L_SET);
  2252. +   if (val < 0)
  2253. +     perror_with_name (name);
  2254. +   val = bfd_read (DBX_STRINGTAB (objfile), DBX_STRINGTAB_SIZE (objfile), 1,
  2255. +           sym_bfd);
  2256. +   if (val == 0)
  2257. +     error ("End of file reading string table");
  2258. +   else if (val < 0)
  2259. +     /* It's possible bfd_read should be setting bfd_error, and we should be
  2260. +        checking that.  But currently it doesn't set bfd_error.  */
  2261. +     perror_with_name (name);
  2262. +   else if (val != DBX_STRINGTAB_SIZE (objfile))
  2263. +     error ("Short read reading string table");
  2264. + }
  2265. + /* Amiga specific parsing routine for section offsets.
  2266. +    Plain and simple for now.  */
  2267. + static struct section_offsets *
  2268. + amiga_symfile_offsets (objfile, addr)
  2269. +      struct objfile *objfile;
  2270. +      CORE_ADDR addr;
  2271. + {
  2272. +   struct section_offsets *section_offsets;
  2273. +   int i;
  2274. +   objfile->num_sections = SECT_OFF_MAX;
  2275. +   section_offsets = (struct section_offsets *)
  2276. +     obstack_alloc (&objfile -> psymbol_obstack,
  2277. +            sizeof (struct section_offsets)
  2278. +            + sizeof (section_offsets->offsets) * (SECT_OFF_MAX-1));
  2279. +   for (i = 0; i < SECT_OFF_MAX; i++)
  2280. +     ANOFFSET (section_offsets, i) = addr;
  2281. +   return section_offsets;
  2282. + }
  2283. + /* Register that we are able to handle Amigados object file formats.  */
  2284. + static struct sym_fns amiga_sym_fns =
  2285. + {
  2286. +   bfd_target_amiga_flavour,
  2287. +   amiga_new_init,    /* sym_new_init: init anything gbl to entire symtab */
  2288. +   amiga_symfile_init,    /* sym_init: read initial info, setup for sym_read() */
  2289. +   amiga_symfile_read,    /* sym_read: read a symbol file into symtab */
  2290. +   amiga_symfile_finish,    /* sym_finish: finished with file, cleanup */
  2291. +   amiga_symfile_offsets,/* sym_offsets:  Translate ext. to int. relocation */
  2292. +   NULL            /* next: pointer to next struct sym_fns */
  2293. + };
  2294. + void
  2295. + _initialize_amigaread ()
  2296. + {
  2297. +   add_symtab_fns (&amiga_sym_fns);
  2298. + }
  2299. diff -rc --new-file gdb-4.12/gdb/config/m68k/amigados.mh /gnu/src/amiga/gdb-4.12/gdb/config/m68k/amigados.mh
  2300. *** gdb-4.12/gdb/config/m68k/amigados.mh    Thu Jan  1 00:00:00 1970
  2301. --- /gnu/src/amiga/gdb-4.12/gdb/config/m68k/amigados.mh    Fri Jun 17 07:33:50 1994
  2302. ***************
  2303. *** 0 ****
  2304. --- 1,14 ----
  2305. + # Host: Commodore Amiga running AmigaDOS.
  2306. + NAT_FILE= nm-amigados.h
  2307. + NATDEPFILES=
  2308. + XDEPFILES=
  2309. + XM_FILE= xm-amigados.h
  2310. + REGEX=regex.o
  2311. + REGEX1=regex.o
  2312. + # Use GNU C compiler
  2313. + CC = gcc
  2314. + # Use GNU install
  2315. + INSTALL = /bin/install -c
  2316. + # Don't use the mmalloc library, there is no sbrk() or mmap().
  2317. + MMALLOC=
  2318. + MMALLOC_DISABLE = -DNO_MMALLOC
  2319. diff -rc --new-file gdb-4.12/gdb/config/m68k/amigados.mt /gnu/src/amiga/gdb-4.12/gdb/config/m68k/amigados.mt
  2320. *** gdb-4.12/gdb/config/m68k/amigados.mt    Thu Jan  1 00:00:00 1970
  2321. --- /gnu/src/amiga/gdb-4.12/gdb/config/m68k/amigados.mt    Fri Jun 17 07:33:51 1994
  2322. ***************
  2323. *** 0 ****
  2324. --- 1,3 ----
  2325. + # Target: Commodore Amiga running AmigaDOS
  2326. + TDEPFILES= m68k-pinsn.o exec.o m68k-tdep.o
  2327. + TM_FILE= tm-amigados.h
  2328. diff -rc --new-file gdb-4.12/gdb/config/m68k/nm-amigados.h /gnu/src/amiga/gdb-4.12/gdb/config/m68k/nm-amigados.h
  2329. *** gdb-4.12/gdb/config/m68k/nm-amigados.h    Thu Jan  1 00:00:00 1970
  2330. --- /gnu/src/amiga/gdb-4.12/gdb/config/m68k/nm-amigados.h    Fri Jun 17 07:33:52 1994
  2331. ***************
  2332. *** 0 ****
  2333. --- 1,26 ----
  2334. + /* Native-dependent definitions for Commodore Amiga running AmigaDOS.
  2335. +    Copyright 1994 Free Software Foundation, Inc.
  2336. +    Written by Fred Fish (fnf@cygnus.com)
  2337. + This file is part of GDB.
  2338. + This program is free software; you can redistribute it and/or modify
  2339. + it under the terms of the GNU General Public License as published by
  2340. + the Free Software Foundation; either version 2 of the License, or
  2341. + (at your option) any later version.
  2342. + This program is distributed in the hope that it will be useful,
  2343. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  2344. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2345. + GNU General Public License for more details.
  2346. + You should have received a copy of the GNU General Public License
  2347. + along with this program; if not, write to the Free Software
  2348. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  2349. + #ifndef NM_AMIGADOS_H
  2350. + #define NM_AMIGADOS_H
  2351. + /* Stuff goes here... */
  2352. + #endif /* NM_AMIGADOS_H */
  2353. diff -rc --new-file gdb-4.12/gdb/config/m68k/tm-amigados.h /gnu/src/amiga/gdb-4.12/gdb/config/m68k/tm-amigados.h
  2354. *** gdb-4.12/gdb/config/m68k/tm-amigados.h    Thu Jan  1 00:00:00 1970
  2355. --- /gnu/src/amiga/gdb-4.12/gdb/config/m68k/tm-amigados.h    Fri Jun 17 07:33:53 1994
  2356. ***************
  2357. *** 0 ****
  2358. --- 1,64 ----
  2359. + /* Macro definitions for GDB on a Commodore Amiga running AmigaDOS.
  2360. +    Copyright (C) 1994, Free Software Foundation, Inc.
  2361. +    Written by Fred Fish at Cygnus Support (fnf@cygnus.com)
  2362. + This file is part of GDB.
  2363. + This program is free software; you can redistribute it and/or modify
  2364. + it under the terms of the GNU General Public License as published by
  2365. + the Free Software Foundation; either version 2 of the License, or
  2366. + (at your option) any later version.
  2367. + This program is distributed in the hope that it will be useful,
  2368. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  2369. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2370. + GNU General Public License for more details.
  2371. + You should have received a copy of the GNU General Public License
  2372. + along with this program; if not, write to the Free Software
  2373. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  2374. + /* Define BPT_VECTOR if it is different than the default.
  2375. +    This is the vector number used by traps to indicate a breakpoint. */
  2376. + #define BPT_VECTOR 0x1
  2377. + /* How much to decrement the PC after a trap.  Depends on kernel. */
  2378. + #define DECR_PC_AFTER_BREAK 0        /* No decrement required */
  2379. + /* Use the alternate method of determining valid frame chains. */
  2380. + #define FRAME_CHAIN_VALID_ALTERNATE
  2381. + #include "m68k/tm-m68k.h"
  2382. + /* Offsets (in target ints) into jmp_buf.  Not defined in any system header
  2383. +    file, so we have to step through setjmp/longjmp with a debugger and figure
  2384. +    them out.  As a double check, note that <setjmp> defines _JBLEN as 13,
  2385. +    which matches the number of elements we see saved by setjmp(). */
  2386. + #define JB_ELEMENT_SIZE sizeof(int)    /* jmp_buf[_JBLEN] is array of ints */
  2387. + #define JB_D2    0
  2388. + #define JB_D3    1
  2389. + #define JB_D4    2
  2390. + #define JB_D5    3
  2391. + #define JB_D6    4
  2392. + #define JB_D7    5
  2393. + #define JB_A1    6
  2394. + #define JB_A2    7
  2395. + #define JB_A3    8
  2396. + #define JB_A4    9
  2397. + #define JB_A5    10
  2398. + #define JB_A6    11
  2399. + #define JB_A7    12
  2400. + #define JB_PC    JB_A1    /* Setjmp()'s return PC saved in A1 */
  2401. + /* Figure out where the longjmp will land.  Slurp the args out of the stack.
  2402. +    We expect the first arg to be a pointer to the jmp_buf structure from which
  2403. +    we extract the pc (JB_PC) that we will land at.  The pc is copied into ADDR.
  2404. +    This routine returns true on success */
  2405. + #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
  2406. diff -rc --new-file gdb-4.12/gdb/config/m68k/xm-amigados.h /gnu/src/amiga/gdb-4.12/gdb/config/m68k/xm-amigados.h
  2407. *** gdb-4.12/gdb/config/m68k/xm-amigados.h    Thu Jan  1 00:00:00 1970
  2408. --- /gnu/src/amiga/gdb-4.12/gdb/config/m68k/xm-amigados.h    Fri Jun 17 07:33:53 1994
  2409. ***************
  2410. *** 0 ****
  2411. --- 1,23 ----
  2412. + /* Macro definitions for GDB on a Commodore Amiga running AmigaDOS.
  2413. +    Copyright 1994 Free Software Foundation, Inc.
  2414. +    Written by Fred Fish at Cygnus Support (fnf@cygnus.com)
  2415. + This file is part of GDB.
  2416. + This program is free software; you can redistribute it and/or modify
  2417. + it under the terms of the GNU General Public License as published by
  2418. + the Free Software Foundation; either version 2 of the License, or
  2419. + (at your option) any later version.
  2420. + This program is distributed in the hope that it will be useful,
  2421. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  2422. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2423. + GNU General Public License for more details.
  2424. + You should have received a copy of the GNU General Public License
  2425. + along with this program; if not, write to the Free Software
  2426. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  2427. + /* Pick up most of what we need from the generic m68k host include file. */
  2428. + #include "m68k/xm-m68k.h"
  2429. diff -rc --new-file gdb-4.12/gdb/configure.in /gnu/src/amiga/gdb-4.12/gdb/configure.in
  2430. *** gdb-4.12/gdb/configure.in    Thu Feb  3 17:05:09 1994
  2431. --- /gnu/src/amiga/gdb-4.12/gdb/configure.in    Fri Jun 17 07:33:54 1994
  2432. ***************
  2433. *** 68,73 ****
  2434. --- 68,74 ----
  2435.   m68*-apollo*-bsd*)    gdb_host=apollo68b ;;
  2436.   m68*-att-*)        gdb_host=3b1 ;;
  2437.   m68*-bull*-sysv*)    gdb_host=dpx2 ;;
  2438. + m68*-cbm-amigados*)    gdb_host=amigados ;;
  2439.   m68*-cbm-sysv4*)    gdb_host=amix ;;
  2440.   m68*-hp-bsd*)        gdb_host=hp300bsd ;;
  2441.   m68*-hp-hpux*)        gdb_host=hp300hpux ;;
  2442. ***************
  2443. *** 221,226 ****
  2444. --- 222,228 ----
  2445.   m68000-*-sunos3*)    gdb_target=sun2os3 ;;
  2446.   m68000-*-sunos4*)    gdb_target=sun2os4 ;;
  2447.   
  2448. + m68*-cbm-amigados*)    gdb_target=amigados ;;
  2449.   m68*-cbm-sysv4*)    gdb_target=amix ;;
  2450.   m68*-bull-sysv*)    gdb_target=dpx2 ;;
  2451.   m68*-hp-bsd*)        gdb_target=hp300bsd ;;
  2452. diff -rc --new-file gdb-4.12/gdb/dbxread.c /gnu/src/amiga/gdb-4.12/gdb/dbxread.c
  2453. *** gdb-4.12/gdb/dbxread.c    Thu Feb  3 16:41:07 1994
  2454. --- /gnu/src/amiga/gdb-4.12/gdb/dbxread.c    Fri Jun 17 07:33:55 1994
  2455. ***************
  2456. *** 2146,2151 ****
  2457. --- 2146,2161 ----
  2458.     dbx_symfile_read (objfile, section_offsets, mainline);
  2459.   }
  2460.   
  2461. + /* Called from amigaread.c  */
  2462. + void
  2463. + amiga_symfile_read (objfile, section_offsets, mainline)
  2464. +      struct objfile *objfile;
  2465. +      struct section_offsets *section_offsets;
  2466. +      int mainline;
  2467. + {
  2468. +   dbx_symfile_read (objfile, section_offsets, mainline);
  2469. + }
  2470.   /* Parse the user's idea of an offset for dynamic linking, into our idea
  2471.      of how to represent it for fast symbol reading.  */
  2472.   
  2473. diff -rc --new-file gdb-4.12/include/COPYING /gnu/src/amiga/gdb-4.12/include/COPYING
  2474. *** gdb-4.12/include/COPYING    Thu Jan  1 00:00:00 1970
  2475. --- /gnu/src/amiga/gdb-4.12/include/COPYING    Thu Feb  3 12:40:45 1994
  2476. ***************
  2477. *** 0 ****
  2478. --- 1,339 ----
  2479. +             GNU GENERAL PUBLIC LICENSE
  2480. +                Version 2, June 1991
  2481. +  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  2482. +                           675 Mass Ave, Cambridge, MA 02139, USA
  2483. +  Everyone is permitted to copy and distribute verbatim copies
  2484. +  of this license document, but changing it is not allowed.
  2485. +                 Preamble
  2486. +   The licenses for most software are designed to take away your
  2487. + freedom to share and change it.  By contrast, the GNU General Public
  2488. + License is intended to guarantee your freedom to share and change free
  2489. + software--to make sure the software is free for all its users.  This
  2490. + General Public License applies to most of the Free Software
  2491. + Foundation's software and to any other program whose authors commit to
  2492. + using it.  (Some other Free Software Foundation software is covered by
  2493. + the GNU Library General Public License instead.)  You can apply it to
  2494. + your programs, too.
  2495. +   When we speak of free software, we are referring to freedom, not
  2496. + price.  Our General Public Licenses are designed to make sure that you
  2497. + have the freedom to distribute copies of free software (and charge for
  2498. + this service if you wish), that you receive source code or can get it
  2499. + if you want it, that you can change the software or use pieces of it
  2500. + in new free programs; and that you know you can do these things.
  2501. +   To protect your rights, we need to make restrictions that forbid
  2502. + anyone to deny you these rights or to ask you to surrender the rights.
  2503. + These restrictions translate to certain responsibilities for you if you
  2504. + distribute copies of the software, or if you modify it.
  2505. +   For example, if you distribute copies of such a program, whether
  2506. + gratis or for a fee, you must give the recipients all the rights that
  2507. + you have.  You must make sure that they, too, receive or can get the
  2508. + source code.  And you must show them these terms so they know their
  2509. + rights.
  2510. +   We protect your rights with two steps: (1) copyright the software, and
  2511. + (2) offer you this license which gives you legal permission to copy,
  2512. + distribute and/or modify the software.
  2513. +   Also, for each author's protection and ours, we want to make certain
  2514. + that everyone understands that there is no warranty for this free
  2515. + software.  If the software is modified by someone else and passed on, we
  2516. + want its recipients to know that what they have is not the original, so
  2517. + that any problems introduced by others will not reflect on the original
  2518. + authors' reputations.
  2519. +   Finally, any free program is threatened constantly by software
  2520. + patents.  We wish to avoid the danger that redistributors of a free
  2521. + program will individually obtain patent licenses, in effect making the
  2522. + program proprietary.  To prevent this, we have made it clear that any
  2523. + patent must be licensed for everyone's free use or not licensed at all.
  2524. +   The precise terms and conditions for copying, distribution and
  2525. + modification follow.
  2526. +             GNU GENERAL PUBLIC LICENSE
  2527. +    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  2528. +   0. This License applies to any program or other work which contains
  2529. + a notice placed by the copyright holder saying it may be distributed
  2530. + under the terms of this General Public License.  The "Program", below,
  2531. + refers to any such program or work, and a "work based on the Program"
  2532. + means either the Program or any derivative work under copyright law:
  2533. + that is to say, a work containing the Program or a portion of it,
  2534. + either verbatim or with modifications and/or translated into another
  2535. + language.  (Hereinafter, translation is included without limitation in
  2536. + the term "modification".)  Each licensee is addressed as "you".
  2537. + Activities other than copying, distribution and modification are not
  2538. + covered by this License; they are outside its scope.  The act of
  2539. + running the Program is not restricted, and the output from the Program
  2540. + is covered only if its contents constitute a work based on the
  2541. + Program (independent of having been made by running the Program).
  2542. + Whether that is true depends on what the Program does.
  2543. +   1. You may copy and distribute verbatim copies of the Program's
  2544. + source code as you receive it, in any medium, provided that you
  2545. + conspicuously and appropriately publish on each copy an appropriate
  2546. + copyright notice and disclaimer of warranty; keep intact all the
  2547. + notices that refer to this License and to the absence of any warranty;
  2548. + and give any other recipients of the Program a copy of this License
  2549. + along with the Program.
  2550. + You may charge a fee for the physical act of transferring a copy, and
  2551. + you may at your option offer warranty protection in exchange for a fee.
  2552. +   2. You may modify your copy or copies of the Program or any portion
  2553. + of it, thus forming a work based on the Program, and copy and
  2554. + distribute such modifications or work under the terms of Section 1
  2555. + above, provided that you also meet all of these conditions:
  2556. +     a) You must cause the modified files to carry prominent notices
  2557. +     stating that you changed the files and the date of any change.
  2558. +     b) You must cause any work that you distribute or publish, that in
  2559. +     whole or in part contains or is derived from the Program or any
  2560. +     part thereof, to be licensed as a whole at no charge to all third
  2561. +     parties under the terms of this License.
  2562. +     c) If the modified program normally reads commands interactively
  2563. +     when run, you must cause it, when started running for such
  2564. +     interactive use in the most ordinary way, to print or display an
  2565. +     announcement including an appropriate copyright notice and a
  2566. +     notice that there is no warranty (or else, saying that you provide
  2567. +     a warranty) and that users may redistribute the program under
  2568. +     these conditions, and telling the user how to view a copy of this
  2569. +     License.  (Exception: if the Program itself is interactive but
  2570. +     does not normally print such an announcement, your work based on
  2571. +     the Program is not required to print an announcement.)
  2572. + These requirements apply to the modified work as a whole.  If
  2573. + identifiable sections of that work are not derived from the Program,
  2574. + and can be reasonably considered independent and separate works in
  2575. + themselves, then this License, and its terms, do not apply to those
  2576. + sections when you distribute them as separate works.  But when you
  2577. + distribute the same sections as part of a whole which is a work based
  2578. + on the Program, the distribution of the whole must be on the terms of
  2579. + this License, whose permissions for other licensees extend to the
  2580. + entire whole, and thus to each and every part regardless of who wrote it.
  2581. + Thus, it is not the intent of this section to claim rights or contest
  2582. + your rights to work written entirely by you; rather, the intent is to
  2583. + exercise the right to control the distribution of derivative or
  2584. + collective works based on the Program.
  2585. + In addition, mere aggregation of another work not based on the Program
  2586. + with the Program (or with a work based on the Program) on a volume of
  2587. + a storage or distribution medium does not bring the other work under
  2588. + the scope of this License.
  2589. +   3. You may copy and distribute the Program (or a work based on it,
  2590. + under Section 2) in object code or executable form under the terms of
  2591. + Sections 1 and 2 above provided that you also do one of the following:
  2592. +     a) Accompany it with the complete corresponding machine-readable
  2593. +     source code, which must be distributed under the terms of Sections
  2594. +     1 and 2 above on a medium customarily used for software interchange; or,
  2595. +     b) Accompany it with a written offer, valid for at least three
  2596. +     years, to give any third party, for a charge no more than your
  2597. +     cost of physically performing source distribution, a complete
  2598. +     machine-readable copy of the corresponding source code, to be
  2599. +     distributed under the terms of Sections 1 and 2 above on a medium
  2600. +     customarily used for software interchange; or,
  2601. +     c) Accompany it with the information you received as to the offer
  2602. +     to distribute corresponding source code.  (This alternative is
  2603. +     allowed only for noncommercial distribution and only if you
  2604. +     received the program in object code or executable form with such
  2605. +     an offer, in accord with Subsection b above.)
  2606. + The source code for a work means the preferred form of the work for
  2607. + making modifications to it.  For an executable work, complete source
  2608. + code means all the source code for all modules it contains, plus any
  2609. + associated interface definition files, plus the scripts used to
  2610. + control compilation and installation of the executable.  However, as a
  2611. + special exception, the source code distributed need not include
  2612. + anything that is normally distributed (in either source or binary
  2613. + form) with the major components (compiler, kernel, and so on) of the
  2614. + operating system on which the executable runs, unless that component
  2615. + itself accompanies the executable.
  2616. + If distribution of executable or object code is made by offering
  2617. + access to copy from a designated place, then offering equivalent
  2618. + access to copy the source code from the same place counts as
  2619. + distribution of the source code, even though third parties are not
  2620. + compelled to copy the source along with the object code.
  2621. +   4. You may not copy, modify, sublicense, or distribute the Program
  2622. + except as expressly provided under this License.  Any attempt
  2623. + otherwise to copy, modify, sublicense or distribute the Program is
  2624. + void, and will automatically terminate your rights under this License.
  2625. + However, parties who have received copies, or rights, from you under
  2626. + this License will not have their licenses terminated so long as such
  2627. + parties remain in full compliance.
  2628. +   5. You are not required to accept this License, since you have not
  2629. + signed it.  However, nothing else grants you permission to modify or
  2630. + distribute the Program or its derivative works.  These actions are
  2631. + prohibited by law if you do not accept this License.  Therefore, by
  2632. + modifying or distributing the Program (or any work based on the
  2633. + Program), you indicate your acceptance of this License to do so, and
  2634. + all its terms and conditions for copying, distributing or modifying
  2635. + the Program or works based on it.
  2636. +   6. Each time you redistribute the Program (or any work based on the
  2637. + Program), the recipient automatically receives a license from the
  2638. + original licensor to copy, distribute or modify the Program subject to
  2639. + these terms and conditions.  You may not impose any further
  2640. + restrictions on the recipients' exercise of the rights granted herein.
  2641. + You are not responsible for enforcing compliance by third parties to
  2642. + this License.
  2643. +   7. If, as a consequence of a court judgment or allegation of patent
  2644. + infringement or for any other reason (not limited to patent issues),
  2645. + conditions are imposed on you (whether by court order, agreement or
  2646. + otherwise) that contradict the conditions of this License, they do not
  2647. + excuse you from the conditions of this License.  If you cannot
  2648. + distribute so as to satisfy simultaneously your obligations under this
  2649. + License and any other pertinent obligations, then as a consequence you
  2650. + may not distribute the Program at all.  For example, if a patent
  2651. + license would not permit royalty-free redistribution of the Program by
  2652. + all those who receive copies directly or indirectly through you, then
  2653. + the only way you could satisfy both it and this License would be to
  2654. + refrain entirely from distribution of the Program.
  2655. + If any portion of this section is held invalid or unenforceable under
  2656. + any particular circumstance, the balance of the section is intended to
  2657. + apply and the section as a whole is intended to apply in other
  2658. + circumstances.
  2659. + It is not the purpose of this section to induce you to infringe any
  2660. + patents or other property right claims or to contest validity of any
  2661. + such claims; this section has the sole purpose of protecting the
  2662. + integrity of the free software distribution system, which is
  2663. + implemented by public license practices.  Many people have made
  2664. + generous contributions to the wide range of software distributed
  2665. + through that system in reliance on consistent application of that
  2666. + system; it is up to the author/donor to decide if he or she is willing
  2667. + to distribute software through any other system and a licensee cannot
  2668. + impose that choice.
  2669. + This section is intended to make thoroughly clear what is believed to
  2670. + be a consequence of the rest of this License.
  2671. +   8. If the distribution and/or use of the Program is restricted in
  2672. + certain countries either by patents or by copyrighted interfaces, the
  2673. + original copyright holder who places the Program under this License
  2674. + may add an explicit geographical distribution limitation excluding
  2675. + those countries, so that distribution is permitted only in or among
  2676. + countries not thus excluded.  In such case, this License incorporates
  2677. + the limitation as if written in the body of this License.
  2678. +   9. The Free Software Foundation may publish revised and/or new versions
  2679. + of the General Public License from time to time.  Such new versions will
  2680. + be similar in spirit to the present version, but may differ in detail to
  2681. + address new problems or concerns.
  2682. + Each version is given a distinguishing version number.  If the Program
  2683. + specifies a version number of this License which applies to it and "any
  2684. + later version", you have the option of following the terms and conditions
  2685. + either of that version or of any later version published by the Free
  2686. + Software Foundation.  If the Program does not specify a version number of
  2687. + this License, you may choose any version ever published by the Free Software
  2688. + Foundation.
  2689. +   10. If you wish to incorporate parts of the Program into other free
  2690. + programs whose distribution conditions are different, write to the author
  2691. + to ask for permission.  For software which is copyrighted by the Free
  2692. + Software Foundation, write to the Free Software Foundation; we sometimes
  2693. + make exceptions for this.  Our decision will be guided by the two goals
  2694. + of preserving the free status of all derivatives of our free software and
  2695. + of promoting the sharing and reuse of software generally.
  2696. +                 NO WARRANTY
  2697. +   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  2698. + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  2699. + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  2700. + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  2701. + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  2702. + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
  2703. + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  2704. + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  2705. + REPAIR OR CORRECTION.
  2706. +   12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  2707. + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  2708. + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  2709. + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  2710. + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
  2711. + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  2712. + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  2713. + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  2714. + POSSIBILITY OF SUCH DAMAGES.
  2715. +              END OF TERMS AND CONDITIONS
  2716. +     Appendix: How to Apply These Terms to Your New Programs
  2717. +   If you develop a new program, and you want it to be of the greatest
  2718. + possible use to the public, the best way to achieve this is to make it
  2719. + free software which everyone can redistribute and change under these terms.
  2720. +   To do so, attach the following notices to the program.  It is safest
  2721. + to attach them to the start of each source file to most effectively
  2722. + convey the exclusion of warranty; and each file should have at least
  2723. + the "copyright" line and a pointer to where the full notice is found.
  2724. +     <one line to give the program's name and a brief idea of what it does.>
  2725. +     Copyright (C) 19yy  <name of author>
  2726. +     This program is free software; you can redistribute it and/or modify
  2727. +     it under the terms of the GNU General Public License as published by
  2728. +     the Free Software Foundation; either version 2 of the License, or
  2729. +     (at your option) any later version.
  2730. +     This program is distributed in the hope that it will be useful,
  2731. +     but WITHOUT ANY WARRANTY; without even the implied warranty of
  2732. +     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2733. +     GNU General Public License for more details.
  2734. +     You should have received a copy of the GNU General Public License
  2735. +     along with this program; if not, write to the Free Software
  2736. +     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2737. + Also add information on how to contact you by electronic and paper mail.
  2738. + If the program is interactive, make it output a short notice like this
  2739. + when it starts in an interactive mode:
  2740. +     Gnomovision version 69, Copyright (C) 19yy name of author
  2741. +     Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  2742. +     This is free software, and you are welcome to redistribute it
  2743. +     under certain conditions; type `show c' for details.
  2744. + The hypothetical commands `show w' and `show c' should show the appropriate
  2745. + parts of the General Public License.  Of course, the commands you use may
  2746. + be called something other than `show w' and `show c'; they could even be
  2747. + mouse-clicks or menu items--whatever suits your program.
  2748. + You should also get your employer (if you work as a programmer) or your
  2749. + school, if any, to sign a "copyright disclaimer" for the program, if
  2750. + necessary.  Here is a sample; alter the names:
  2751. +   Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  2752. +   `Gnomovision' (which makes passes at compilers) written by James Hacker.
  2753. +   <signature of Ty Coon>, 1 April 1989
  2754. +   Ty Coon, President of Vice
  2755. + This General Public License does not permit incorporating your program into
  2756. + proprietary programs.  If your program is a subroutine library, you may
  2757. + consider it more useful to permit linking proprietary applications with the
  2758. + library.  If this is what you want to do, use the GNU Library General
  2759. + Public License instead of this License.
  2760. diff -rc --new-file gdb-4.12/libiberty/config/mh-amigados /gnu/src/amiga/gdb-4.12/libiberty/config/mh-amigados
  2761. *** gdb-4.12/libiberty/config/mh-amigados    Thu Jan  1 00:00:00 1970
  2762. --- /gnu/src/amiga/gdb-4.12/libiberty/config/mh-amigados    Fri Jun 17 07:33:56 1994
  2763. ***************
  2764. *** 0 ****
  2765. --- 1,6 ----
  2766. + # Host makefile fragment for Commodore Amiga running AmigaDOS.
  2767. + # Use GNU C.  There is no default system compiler.
  2768. + CC=gcc
  2769. + # Don't use -g since we don't really support it yet.  Use -O instead though.
  2770. + CFLAGS=-O
  2771. diff -rc --new-file gdb-4.12/libiberty/config.table /gnu/src/amiga/gdb-4.12/libiberty/config.table
  2772. *** gdb-4.12/libiberty/config.table    Thu Feb  3 16:48:12 1994
  2773. --- /gnu/src/amiga/gdb-4.12/libiberty/config.table    Fri Jun 17 07:33:57 1994
  2774. ***************
  2775. *** 19,22 ****
  2776. --- 19,23 ----
  2777.     *-*-solaris2*)    frag=mh-sysv4 ;;
  2778.     *-*-sysv4*)        frag=mh-sysv4 ;;
  2779.     *-*-sysv*)        frag=mh-sysv ;;
  2780. +   *-*-amigados*)    frag=mh-amigados ;;
  2781.   esac
  2782. diff -rc --new-file gdb-4.12/mmalloc/config/mh-amigados /gnu/src/amiga/gdb-4.12/mmalloc/config/mh-amigados
  2783. *** gdb-4.12/mmalloc/config/mh-amigados    Thu Jan  1 00:00:00 1970
  2784. --- /gnu/src/amiga/gdb-4.12/mmalloc/config/mh-amigados    Fri Jun 17 07:33:58 1994
  2785. ***************
  2786. *** 0 ****
  2787. --- 1,7 ----
  2788. + # Host configuration for Commodore Amiga running AmigaDOS.
  2789. + # We don't actually use libmmalloc.a, since there is no sbrk(),
  2790. + # but this allows us to compile it (and then ignore it).
  2791. + CC=gcc
  2792. + # We don't need -g yet, so do -O instead.
  2793. + CFLAGS=-O
  2794. diff -rc --new-file gdb-4.12/mmalloc/configure.in /gnu/src/amiga/gdb-4.12/mmalloc/configure.in
  2795. *** gdb-4.12/mmalloc/configure.in    Thu Feb  3 16:48:23 1994
  2796. --- /gnu/src/amiga/gdb-4.12/mmalloc/configure.in    Fri Jun 17 07:33:59 1994
  2797. ***************
  2798. *** 15,20 ****
  2799. --- 15,21 ----
  2800.     *-*-solaris2*)    host_makefile_frag=config/mh-sysv4 ;;
  2801.     *-*-sunos4*)        host_makefile_frag=config/mh-sunos4 ;;
  2802.     *-*-sysv4*)        host_makefile_frag=config/mh-sysv4 ;;
  2803. +   *-*-amigados*)    host_makefile_frag=config/mh-amigados ;;
  2804.   esac
  2805.   
  2806.   # per-target:
  2807. diff -rc --new-file gdb-4.12/readline/COPYING /gnu/src/amiga/gdb-4.12/readline/COPYING
  2808. *** gdb-4.12/readline/COPYING    Thu Jan  1 00:00:00 1970
  2809. --- /gnu/src/amiga/gdb-4.12/readline/COPYING    Thu Feb  3 12:40:45 1994
  2810. ***************
  2811. *** 0 ****
  2812. --- 1,339 ----
  2813. +             GNU GENERAL PUBLIC LICENSE
  2814. +                Version 2, June 1991
  2815. +  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  2816. +                           675 Mass Ave, Cambridge, MA 02139, USA
  2817. +  Everyone is permitted to copy and distribute verbatim copies
  2818. +  of this license document, but changing it is not allowed.
  2819. +                 Preamble
  2820. +   The licenses for most software are designed to take away your
  2821. + freedom to share and change it.  By contrast, the GNU General Public
  2822. + License is intended to guarantee your freedom to share and change free
  2823. + software--to make sure the software is free for all its users.  This
  2824. + General Public License applies to most of the Free Software
  2825. + Foundation's software and to any other program whose authors commit to
  2826. + using it.  (Some other Free Software Foundation software is covered by
  2827. + the GNU Library General Public License instead.)  You can apply it to
  2828. + your programs, too.
  2829. +   When we speak of free software, we are referring to freedom, not
  2830. + price.  Our General Public Licenses are designed to make sure that you
  2831. + have the freedom to distribute copies of free software (and charge for
  2832. + this service if you wish), that you receive source code or can get it
  2833. + if you want it, that you can change the software or use pieces of it
  2834. + in new free programs; and that you know you can do these things.
  2835. +   To protect your rights, we need to make restrictions that forbid
  2836. + anyone to deny you these rights or to ask you to surrender the rights.
  2837. + These restrictions translate to certain responsibilities for you if you
  2838. + distribute copies of the software, or if you modify it.
  2839. +   For example, if you distribute copies of such a program, whether
  2840. + gratis or for a fee, you must give the recipients all the rights that
  2841. + you have.  You must make sure that they, too, receive or can get the
  2842. + source code.  And you must show them these terms so they know their
  2843. + rights.
  2844. +   We protect your rights with two steps: (1) copyright the software, and
  2845. + (2) offer you this license which gives you legal permission to copy,
  2846. + distribute and/or modify the software.
  2847. +   Also, for each author's protection and ours, we want to make certain
  2848. + that everyone understands that there is no warranty for this free
  2849. + software.  If the software is modified by someone else and passed on, we
  2850. + want its recipients to know that what they have is not the original, so
  2851. + that any problems introduced by others will not reflect on the original
  2852. + authors' reputations.
  2853. +   Finally, any free program is threatened constantly by software
  2854. + patents.  We wish to avoid the danger that redistributors of a free
  2855. + program will individually obtain patent licenses, in effect making the
  2856. + program proprietary.  To prevent this, we have made it clear that any
  2857. + patent must be licensed for everyone's free use or not licensed at all.
  2858. +   The precise terms and conditions for copying, distribution and
  2859. + modification follow.
  2860. +             GNU GENERAL PUBLIC LICENSE
  2861. +    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  2862. +   0. This License applies to any program or other work which contains
  2863. + a notice placed by the copyright holder saying it may be distributed
  2864. + under the terms of this General Public License.  The "Program", below,
  2865. + refers to any such program or work, and a "work based on the Program"
  2866. + means either the Program or any derivative work under copyright law:
  2867. + that is to say, a work containing the Program or a portion of it,
  2868. + either verbatim or with modifications and/or translated into another
  2869. + language.  (Hereinafter, translation is included without limitation in
  2870. + the term "modification".)  Each licensee is addressed as "you".
  2871. + Activities other than copying, distribution and modification are not
  2872. + covered by this License; they are outside its scope.  The act of
  2873. + running the Program is not restricted, and the output from the Program
  2874. + is covered only if its contents constitute a work based on the
  2875. + Program (independent of having been made by running the Program).
  2876. + Whether that is true depends on what the Program does.
  2877. +   1. You may copy and distribute verbatim copies of the Program's
  2878. + source code as you receive it, in any medium, provided that you
  2879. + conspicuously and appropriately publish on each copy an appropriate
  2880. + copyright notice and disclaimer of warranty; keep intact all the
  2881. + notices that refer to this License and to the absence of any warranty;
  2882. + and give any other recipients of the Program a copy of this License
  2883. + along with the Program.
  2884. + You may charge a fee for the physical act of transferring a copy, and
  2885. + you may at your option offer warranty protection in exchange for a fee.
  2886. +   2. You may modify your copy or copies of the Program or any portion
  2887. + of it, thus forming a work based on the Program, and copy and
  2888. + distribute such modifications or work under the terms of Section 1
  2889. + above, provided that you also meet all of these conditions:
  2890. +     a) You must cause the modified files to carry prominent notices
  2891. +     stating that you changed the files and the date of any change.
  2892. +     b) You must cause any work that you distribute or publish, that in
  2893. +     whole or in part contains or is derived from the Program or any
  2894. +     part thereof, to be licensed as a whole at no charge to all third
  2895. +     parties under the terms of this License.
  2896. +     c) If the modified program normally reads commands interactively
  2897. +     when run, you must cause it, when started running for such
  2898. +     interactive use in the most ordinary way, to print or display an
  2899. +     announcement including an appropriate copyright notice and a
  2900. +     notice that there is no warranty (or else, saying that you provide
  2901. +     a warranty) and that users may redistribute the program under
  2902. +     these conditions, and telling the user how to view a copy of this
  2903. +     License.  (Exception: if the Program itself is interactive but
  2904. +     does not normally print such an announcement, your work based on
  2905. +     the Program is not required to print an announcement.)
  2906. + These requirements apply to the modified work as a whole.  If
  2907. + identifiable sections of that work are not derived from the Program,
  2908. + and can be reasonably considered independent and separate works in
  2909. + themselves, then this License, and its terms, do not apply to those
  2910. + sections when you distribute them as separate works.  But when you
  2911. + distribute the same sections as part of a whole which is a work based
  2912. + on the Program, the distribution of the whole must be on the terms of
  2913. + this License, whose permissions for other licensees extend to the
  2914. + entire whole, and thus to each and every part regardless of who wrote it.
  2915. + Thus, it is not the intent of this section to claim rights or contest
  2916. + your rights to work written entirely by you; rather, the intent is to
  2917. + exercise the right to control the distribution of derivative or
  2918. + collective works based on the Program.
  2919. + In addition, mere aggregation of another work not based on the Program
  2920. + with the Program (or with a work based on the Program) on a volume of
  2921. + a storage or distribution medium does not bring the other work under
  2922. + the scope of this License.
  2923. +   3. You may copy and distribute the Program (or a work based on it,
  2924. + under Section 2) in object code or executable form under the terms of
  2925. + Sections 1 and 2 above provided that you also do one of the following:
  2926. +     a) Accompany it with the complete corresponding machine-readable
  2927. +     source code, which must be distributed under the terms of Sections
  2928. +     1 and 2 above on a medium customarily used for software interchange; or,
  2929. +     b) Accompany it with a written offer, valid for at least three
  2930. +     years, to give any third party, for a charge no more than your
  2931. +     cost of physically performing source distribution, a complete
  2932. +     machine-readable copy of the corresponding source code, to be
  2933. +     distributed under the terms of Sections 1 and 2 above on a medium
  2934. +     customarily used for software interchange; or,
  2935. +     c) Accompany it with the information you received as to the offer
  2936. +     to distribute corresponding source code.  (This alternative is
  2937. +     allowed only for noncommercial distribution and only if you
  2938. +     received the program in object code or executable form with such
  2939. +     an offer, in accord with Subsection b above.)
  2940. + The source code for a work means the preferred form of the work for
  2941. + making modifications to it.  For an executable work, complete source
  2942. + code means all the source code for all modules it contains, plus any
  2943. + associated interface definition files, plus the scripts used to
  2944. + control compilation and installation of the executable.  However, as a
  2945. + special exception, the source code distributed need not include
  2946. + anything that is normally distributed (in either source or binary
  2947. + form) with the major components (compiler, kernel, and so on) of the
  2948. + operating system on which the executable runs, unless that component
  2949. + itself accompanies the executable.
  2950. + If distribution of executable or object code is made by offering
  2951. + access to copy from a designated place, then offering equivalent
  2952. + access to copy the source code from the same place counts as
  2953. + distribution of the source code, even though third parties are not
  2954. + compelled to copy the source along with the object code.
  2955. +   4. You may not copy, modify, sublicense, or distribute the Program
  2956. + except as expressly provided under this License.  Any attempt
  2957. + otherwise to copy, modify, sublicense or distribute the Program is
  2958. + void, and will automatically terminate your rights under this License.
  2959. + However, parties who have received copies, or rights, from you under
  2960. + this License will not have their licenses terminated so long as such
  2961. + parties remain in full compliance.
  2962. +   5. You are not required to accept this License, since you have not
  2963. + signed it.  However, nothing else grants you permission to modify or
  2964. + distribute the Program or its derivative works.  These actions are
  2965. + prohibited by law if you do not accept this License.  Therefore, by
  2966. + modifying or distributing the Program (or any work based on the
  2967. + Program), you indicate your acceptance of this License to do so, and
  2968. + all its terms and conditions for copying, distributing or modifying
  2969. + the Program or works based on it.
  2970. +   6. Each time you redistribute the Program (or any work based on the
  2971. + Program), the recipient automatically receives a license from the
  2972. + original licensor to copy, distribute or modify the Program subject to
  2973. + these terms and conditions.  You may not impose any further
  2974. + restrictions on the recipients' exercise of the rights granted herein.
  2975. + You are not responsible for enforcing compliance by third parties to
  2976. + this License.
  2977. +   7. If, as a consequence of a court judgment or allegation of patent
  2978. + infringement or for any other reason (not limited to patent issues),
  2979. + conditions are imposed on you (whether by court order, agreement or
  2980. + otherwise) that contradict the conditions of this License, they do not
  2981. + excuse you from the conditions of this License.  If you cannot
  2982. + distribute so as to satisfy simultaneously your obligations under this
  2983. + License and any other pertinent obligations, then as a consequence you
  2984. + may not distribute the Program at all.  For example, if a patent
  2985. + license would not permit royalty-free redistribution of the Program by
  2986. + all those who receive copies directly or indirectly through you, then
  2987. + the only way you could satisfy both it and this License would be to
  2988. + refrain entirely from distribution of the Program.
  2989. + If any portion of this section is held invalid or unenforceable under
  2990. + any particular circumstance, the balance of the section is intended to
  2991. + apply and the section as a whole is intended to apply in other
  2992. + circumstances.
  2993. + It is not the purpose of this section to induce you to infringe any
  2994. + patents or other property right claims or to contest validity of any
  2995. + such claims; this section has the sole purpose of protecting the
  2996. + integrity of the free software distribution system, which is
  2997. + implemented by public license practices.  Many people have made
  2998. + generous contributions to the wide range of software distributed
  2999. + through that system in reliance on consistent application of that
  3000. + system; it is up to the author/donor to decide if he or she is willing
  3001. + to distribute software through any other system and a licensee cannot
  3002. + impose that choice.
  3003. + This section is intended to make thoroughly clear what is believed to
  3004. + be a consequence of the rest of this License.
  3005. +   8. If the distribution and/or use of the Program is restricted in
  3006. + certain countries either by patents or by copyrighted interfaces, the
  3007. + original copyright holder who places the Program under this License
  3008. + may add an explicit geographical distribution limitation excluding
  3009. + those countries, so that distribution is permitted only in or among
  3010. + countries not thus excluded.  In such case, this License incorporates
  3011. + the limitation as if written in the body of this License.
  3012. +   9. The Free Software Foundation may publish revised and/or new versions
  3013. + of the General Public License from time to time.  Such new versions will
  3014. + be similar in spirit to the present version, but may differ in detail to
  3015. + address new problems or concerns.
  3016. + Each version is given a distinguishing version number.  If the Program
  3017. + specifies a version number of this License which applies to it and "any
  3018. + later version", you have the option of following the terms and conditions
  3019. + either of that version or of any later version published by the Free
  3020. + Software Foundation.  If the Program does not specify a version number of
  3021. + this License, you may choose any version ever published by the Free Software
  3022. + Foundation.
  3023. +   10. If you wish to incorporate parts of the Program into other free
  3024. + programs whose distribution conditions are different, write to the author
  3025. + to ask for permission.  For software which is copyrighted by the Free
  3026. + Software Foundation, write to the Free Software Foundation; we sometimes
  3027. + make exceptions for this.  Our decision will be guided by the two goals
  3028. + of preserving the free status of all derivatives of our free software and
  3029. + of promoting the sharing and reuse of software generally.
  3030. +                 NO WARRANTY
  3031. +   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  3032. + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  3033. + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  3034. + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  3035. + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  3036. + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
  3037. + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  3038. + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  3039. + REPAIR OR CORRECTION.
  3040. +   12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  3041. + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  3042. + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  3043. + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  3044. + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
  3045. + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  3046. + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  3047. + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  3048. + POSSIBILITY OF SUCH DAMAGES.
  3049. +              END OF TERMS AND CONDITIONS
  3050. +     Appendix: How to Apply These Terms to Your New Programs
  3051. +   If you develop a new program, and you want it to be of the greatest
  3052. + possible use to the public, the best way to achieve this is to make it
  3053. + free software which everyone can redistribute and change under these terms.
  3054. +   To do so, attach the following notices to the program.  It is safest
  3055. + to attach them to the start of each source file to most effectively
  3056. + convey the exclusion of warranty; and each file should have at least
  3057. + the "copyright" line and a pointer to where the full notice is found.
  3058. +     <one line to give the program's name and a brief idea of what it does.>
  3059. +     Copyright (C) 19yy  <name of author>
  3060. +     This program is free software; you can redistribute it and/or modify
  3061. +     it under the terms of the GNU General Public License as published by
  3062. +     the Free Software Foundation; either version 2 of the License, or
  3063. +     (at your option) any later version.
  3064. +     This program is distributed in the hope that it will be useful,
  3065. +     but WITHOUT ANY WARRANTY; without even the implied warranty of
  3066. +     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  3067. +     GNU General Public License for more details.
  3068. +     You should have received a copy of the GNU General Public License
  3069. +     along with this program; if not, write to the Free Software
  3070. +     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  3071. + Also add information on how to contact you by electronic and paper mail.
  3072. + If the program is interactive, make it output a short notice like this
  3073. + when it starts in an interactive mode:
  3074. +     Gnomovision version 69, Copyright (C) 19yy name of author
  3075. +     Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  3076. +     This is free software, and you are welcome to redistribute it
  3077. +     under certain conditions; type `show c' for details.
  3078. + The hypothetical commands `show w' and `show c' should show the appropriate
  3079. + parts of the General Public License.  Of course, the commands you use may
  3080. + be called something other than `show w' and `show c'; they could even be
  3081. + mouse-clicks or menu items--whatever suits your program.
  3082. + You should also get your employer (if you work as a programmer) or your
  3083. + school, if any, to sign a "copyright disclaimer" for the program, if
  3084. + necessary.  Here is a sample; alter the names:
  3085. +   Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  3086. +   `Gnomovision' (which makes passes at compilers) written by James Hacker.
  3087. +   <signature of Ty Coon>, 1 April 1989
  3088. +   Ty Coon, President of Vice
  3089. + This General Public License does not permit incorporating your program into
  3090. + proprietary programs.  If your program is a subroutine library, you may
  3091. + consider it more useful to permit linking proprietary applications with the
  3092. + library.  If this is what you want to do, use the GNU Library General
  3093. + Public License instead of this License.
  3094. diff -rc --new-file gdb-4.12/readline/config/mh-amigados /gnu/src/amiga/gdb-4.12/readline/config/mh-amigados
  3095. *** gdb-4.12/readline/config/mh-amigados    Thu Jan  1 00:00:00 1970
  3096. --- /gnu/src/amiga/gdb-4.12/readline/config/mh-amigados    Fri Jun 17 07:34:00 1994
  3097. ***************
  3098. *** 0 ****
  3099. --- 1,10 ----
  3100. + # Host makefile fragment for Commodore Amiga running AmigaDOS.
  3101. + # Use the GNU C compiler.
  3102. + CC=gcc
  3103. + # Don't use -g for now, it isn't useful and may just bloat the
  3104. + # executable.  But do optimize.
  3105. + CFLAGS=-O
  3106. + # Use the GNU install program.
  3107. + INSTALL_PROG = /bin/install -c
  3108. + # The system doesn't distinguish users.
  3109. + H_CFLAGS = -DNOT_MULTIUSER
  3110. diff -rc --new-file gdb-4.12/readline/configure.in /gnu/src/amiga/gdb-4.12/readline/configure.in
  3111. *** gdb-4.12/readline/configure.in    Thu Feb  3 16:47:47 1994
  3112. --- /gnu/src/amiga/gdb-4.12/readline/configure.in    Fri Jun 17 07:34:00 1994
  3113. ***************
  3114. *** 28,33 ****
  3115. --- 28,34 ----
  3116.     i[34]86-*-sco*)    host_makefile_frag=config/mh-sco; files=sysdep-sco.h ;;
  3117.     i[34]86-*-isc*)    host_makefile_frag=config/mh-isc ;;
  3118.     m68k-apollo-sysv*)    host_makefile_frag=config/mh-apollo68v ;;    
  3119. +   m68k-cbm-amigados*)    host_makefile_frag=config/mh-amigados ;;
  3120.     *-*-sysv*)        host_makefile_frag=config/mh-sysv ;;
  3121.     *-*-m88kbcs*)        host_makefile_frag=config/mh-sysv ;;
  3122.     i[34]86-*-linux*)    host_makefile_frag=config/mh-posix ;;
  3123. diff -rc --new-file gdb-4.12/readline/readline.c /gnu/src/amiga/gdb-4.12/readline/readline.c
  3124. *** gdb-4.12/readline/readline.c    Thu Feb  3 16:47:49 1994
  3125. --- /gnu/src/amiga/gdb-4.12/readline/readline.c    Fri Jun 17 07:34:02 1994
  3126. ***************
  3127. *** 180,185 ****
  3128. --- 180,190 ----
  3129.   #include <pwd.h>
  3130.   #endif /* __MSDOS__ */
  3131.   
  3132. + #ifdef amigados
  3133. + #define tcflow(a,b)    /* Hack, this is missing from ixemul.library */
  3134. + #define tcsetattr(a,b,c)    /* But this isn't? */
  3135. + #endif
  3136.   #if defined (USG) && !defined (isc386) && !defined (sgi)
  3137.   struct passwd *getpwuid (), *getpwent ();
  3138.   #endif
  3139. ***************
  3140. *** 4135,4141 ****
  3141.        int state;
  3142.        char *text;
  3143.   {
  3144. ! #ifdef __GO32__
  3145.     return (char *)NULL;
  3146.   #else /* !__GO32__ */
  3147.     static char *username = (char *)NULL;
  3148. --- 4140,4146 ----
  3149.        int state;
  3150.        char *text;
  3151.   {
  3152. ! #if defined (__GO32__) || defined (NOT_MULTIUSER)
  3153.     return (char *)NULL;
  3154.   #else /* !__GO32__ */
  3155.     static char *username = (char *)NULL;
  3156.