Commit Graph

169 Commits

Author SHA1 Message Date
bebbo 742d6bb698 @R with multiple defined symbols now the first definition is retained (was: last definition), thus object file definition have precedence over libs 2017-02-13 18:59:08 +01:00
bebbo 6372b0a52e @R new approach to fix the offsets relative to a4. 2017-02-13 01:28:22 +01:00
bebbo bc877e33c6 @B fix linking with baserel32 mode 2017-02-06 21:44:29 +01:00
bebbo 1d7d87ecf0 @D remove debug output 2017-02-06 15:12:01 +01:00
bebbo f474743b90 @B fix #ifdef DEBUGPRINT 2017-02-06 15:10:05 +01:00
bebbo bb6ad09703 @B fix compatibilty issues for VC 2017-02-06 15:08:28 +01:00
bebbo b9511c9413 @B fix compatibilty issues for VC 2017-02-06 15:04:37 +01:00
bebbo 78fa84d0b7 @D added more debug output, @B reintroduced an old bug to make the
linker work again!?!
2017-01-31 20:18:46 +01:00
bebbo fd791101b6 @B fix last merge 2016-12-01 12:55:03 +01:00
bebbo 54cef86a35 @R support newer asm directives 2016-11-30 23:54:44 +01:00
bebbo 590f1f95a2 @R changes to work with gcc-6.2.0 2016-11-28 22:19:06 +01:00
bebbo ce410ad89a @I add eclipse .project file 2016-11-22 19:27:18 +01:00
Gunther Nikl 2a89d7fe20 Fix m68k_aout_machtype setting for TE_AMIGA.
* gas/config/tc-m68k.c (m68k_init_after_args): Use m68020up for architecture
  check.
2015-11-28 13:44:40 +00:00
Gunther Nikl 374b9faeb4 Factor out common code for processing a.out and hunk relocations.
* bfd/amigaoslink.c (amiga_update_target_section): New function, broken out
  of amiga_perform_reloc.
  (amiga_perform_reloc): Use it.
  (aout_update_target_section): New function, broken out of aout_perform_reloc.
  (aout_perform_reloc): Use it.
2015-07-03 12:02:29 +00:00
Gunther Nikl c49e1d0d04 Minor cleanup.
* bfd/amigaoslink.c (amiga_perform_reloc): Remove UNUSED from abfd argument.
  (aout_perform_reloc): Reformat debug statements for clarity.
2015-07-03 10:01:50 +00:00
Gunther Nikl 5959708977 Rename a helper macro to better reflect what the macro is used for.
* bfd/amigaos.c (bfd_is_bfd_section): Rename from this ...
  (bfd_is_special_section): ... to this.
2015-06-16 17:40:36 +00:00
Gunther Nikl d2bd053001 Simplify logic dealing with RELOC32SHORT data from an executable.
* bfd/amigaos.c (howto_for_raw_reloc): New parameter indicating file type.
  Use it for mapping HUNK_DREL32 to ABS32 or SD32.
  (amiga_handle_rest): Remove special handling of HUNK_DREL32.
  (read_raw_relocs): Likewise.
2015-06-03 18:03:28 +00:00
Gunther Nikl 75ee6e77cc In an object file a HUNK_RELRELOC32 has 32bit data.
* bfd/amigaos.c (parse_archive_units): Read contents of HUNK_RELRELOC32 as
  32bit words.
2015-06-03 17:55:47 +00:00
Gunther Nikl 33dc868cd6 Move check of on-disk size of relocation data into a separate function.
* bfd/amigaos.c (amiga_reloc_long_p): New function checking a hunk type for
  on-disk size of relocation data.
  (amiga_handle_rest): Use new function.
  (amiga_write_section_contents): Likewise.
  (read_raw_relocs): Likewise.
2015-06-03 17:11:42 +00:00
Gunther Nikl eb89bd3709 Minor style correction.
* bfd/amigaos.c (howto_for_raw_reloc): Remove parameter name from prototype.
  (howto_for_reloc): Likewise.
2015-06-03 16:18:00 +00:00
Gunther Nikl 3da84a8d63 Add missing sanity check for pc-relative references from a.out objects.
This check was already present for references from hunk objects.

* bfd/amigaoslink.c (aout_perform_reloc): For pc-relative references only
  references to the same output section are permitted.
2015-05-25 12:39:35 +00:00
Gunther Nikl 4e19233665 Add support for relocation hunks with short (16bit) data.
* bfd/amigaos.c (write_words): Add protototype.
  (write_words): New function to write 16bit words.
  (amiga_write_section_contents): Use write_words to write 16bit relocs.
2015-05-15 19:35:50 +00:00
Gunther Nikl 0c09613c8f Fix RELRELOC32 reading and decoding. AmigaOS 3.x expects short data.
* bfd/amigaos.c (parse_archive_units): Add support for HUNK_RELOC32SHORT.
  Parse HUNK_RELRELOC32 the same way.
  (amiga_handle_rest): Check for HUNK_RELRELOC32 when reading short data.
  (read_raw_relocs): Likewise.
2015-05-15 19:22:06 +00:00
Gunther Nikl 5df18f43a6 Merge normal RELOC32 and RELOC32SHORT howto selection.
* bfd/amigaos.c (R_ABS32SHORT): Remove.
  (howto_table): Remove H_ABS32SHORT entry.
  (howto_for_raw_reloc): Use R_ABS32 entry for HUNK_RELOC32SHORT.
2015-05-15 18:53:34 +00:00
Gunther Nikl 179c404953 Change HOWTO enumeration.
* bfd/libamiga.h (H_PC32SHORT): New enum value.
  (H_PC26): Moved to end of enumeration.
2015-05-15 18:45:53 +00:00
Gunther Nikl 39cb210148 Fix behaviour of a core bfd function generating sections.
For details check https://sourceware.org/ml/binutils/2003-07/msg00077.html
about the patch.

* bfd/section.c (bfd_make_section): Return NULL for existing section.
2015-05-05 19:01:47 +00:00
Gunther Nikl e2b5906c8a Accept additional hunk types containing raw relocation data at two places
missed before.

* bfd/amigaos.c (parse_archive_units): Handle HUNK_RELRELOC32, HUNK_ABSRELOC16
  and HUNK_RELRELOC26.
  (amiga_handle_rest): Likewise.
2015-04-29 19:07:20 +00:00
Gunther Nikl ddc877b3d3 Minor white space changes.
* bfd/amigaos.c (amiga_handle_rest): Use TABs.
  (amiga_write_object_contents): Likewise.
  (read_raw_relocs): Likewise.
2015-04-29 18:52:24 +00:00
Gunther Nikl f723c5d6ef Unify relocation read logic.
* bfd/amigaos.c (read_raw_relocs): Replace switch with an if test.
2015-04-29 18:48:43 +00:00
Gunther Nikl 48a6d2ca95 Handle more relocation hunk types and treat absolute relocations as such
where possible.

* bfd/amigaos.c (reloc_types array): Add HUNK_ABSRELOC16 and HUNK_RELRELOC32.
  (determine_type): Update for layout change of reloc_types array.
2015-04-29 18:36:00 +00:00
Gunther Nikl 6a60985980 Add support for EXT_RELCOMMON.
* bfd/amigaos.c (howto_for_reloc): Handle EXT_RELCOMMON.
  (parse_archive_units): Likewise.
  (amiga_handle_rest): Likewise.
  (amiga_write_symbols): Likewise.
  (amiga_slurp_symbol_table): Likewise.
  (amiga_slurp_relocs): Likewise.
  (amiga_slurp_armap): Likewise.
2015-04-29 18:27:38 +00:00
Gunther Nikl 6bda262494 Group common reloc types.
* bfd/amigaos.c (reloc enum): Move R_PC32 entry.
  (howto_table): Likewise.
2015-04-29 18:21:58 +00:00
Gunther Nikl 52d21eb1f2 Handle absolute 8-bit and 16-bit amigaos relocations.
* bfd/amigaos.c (reloc enum): Add values for 8-bit and 16-bit absolute relocs.
  (howto_table): Add entries for the new enum values.
  (howto_for_raw_reloc): Handle HUNK_ABSRELOC16.
  (howto_for_reloc): Handle EXT_ABSREF9 and EXT_ABSREF16.
  (parse_archive_units): Likewise.
  (amiga_handle_rest): Likewise.
  (amiga_write_symbols): Likewise.
  (amiga_slurp_armap): Likewise.
  (amiga_bfd_reloc_type_lookup): Map normal 8-bit and 16-bit BFD relocs to
  their absolute amigaos variants.
2015-04-29 18:16:46 +00:00
Gunther Nikl fc73468ff9 Prefer BFD data where available.
* bfd/amigaos.c (amiga_write_section_contents): Consult relocation howto
  for the size of the relocation object.
2015-04-29 17:18:00 +00:00
Gunther Nikl 865652483c Handle more hunk types containing raw relocation data.
* bfd/amigaos.c (howto_for_raw_reloc): Handle HUNK_RELRELOC32 and HUNK_RELRELOC26.
2015-04-29 17:08:54 +00:00
Gunther Nikl cc69950864 Make reading HUNK_EXT data robust.
* bfd/amigaos.c (howto_for_reloc): New helper function to select a relocation
  howto entry.
  (amiga_slurp_relocs): Use it.
2015-04-29 17:03:03 +00:00
Gunther Nikl 1bb550cac5 Make reading raw relocation data robust.
* bfd/amigaos.c (howto_for_raw_reloc): New function to select a relocation
  howto entry.
  (read_raw_relocs): Use it.
2015-04-29 16:53:23 +00:00
Gunther Nikl 1dc1e0d965 Add a helper function to read a 16-bit value.
* bfd/amigaos.c (get_word): New helper function.
  (amiga_handle_rest): Use new helper function.
  (read_raw_relocs): Likewise.
2015-04-29 16:39:36 +00:00
Gunther Nikl d726b16546 Stop accessing BFD backend data member with type-punning. This silences
modern GCC versions.

* bfd/bfd-in2.h (struct bfd): Add amiga_ar_data to tdata union.
* bfd/amigaos.c (amiga_ardata): Use amiga_ar_data union member.
2015-03-29 13:01:31 +00:00
Gunther Nikl 9658695df9 Tolerate bfd_link_hash_warning for input BFD symbols.
* bfd/linker.c (_bfd_generic_link_output_symbols): Accept bfd_link_hash_warning.
2015-03-29 12:38:57 +00:00
Gunther Nikl 449a4bb122 Completely backport _bfd_ar_spacepad() changes from
X-Git-Url: http://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff_plain;h=390c0e4288ca46982c7702ec420d277c021032f4

* bfd/libbfd-in.h (_bfd_ar_spacepad): New prototype.
* bfd/libbfd.h (_bfd_ar_spacepad): Likewise.
* bfd/archive.c (_bfd_ar_spacepad): Use K&R style as rest of file.
* bfd/archive64.c (bfd_elf64_archive_write_armap): Use _bfd_ar_spacepad.
2015-03-29 12:32:37 +00:00
Gunther Nikl 681f013ef9 Override m68k_aout_machtype value when building an amiga target.
* gas/config/tc-m68k.c (TE_AMIGA): Provide a zero default.
  (FRAME): Check TE_AMIGA for zero/non-zero value.
  (m68k_init_after_args): Tweak m68k_aout_machtype for TE_AMIGA case.
2015-03-27 17:17:52 +00:00
Jens Maus 5c77c5df76 - checkin of certain files being automatically generated with newer version of flex/bison&co. 2015-03-26 08:15:01 +00:00
Jens Maus b8fa24d6f7 - backported function _bfd_ar_spacepad() from newer binutils versions in archive.c which fixes buffer overflow problems in these older versions of binutils. 2015-03-26 08:13:01 +00:00
Gunther Nikl a8d9343dc8 Use FLAG_SMALL_CODE at all places.
* gas/config/tc-m68k.c (md_estimate_size_before_relax): Use FLAG_SMALL_CODE.
2015-03-08 20:37:47 +00:00
Gunther Nikl 3e83a383d7 Consistently disable small-code checks.
* gas/config/tc-m68k.c (FLAG_SMALL_CODE): New define.
  (m68k_ip): Replace checking of flag_small_code with FLAG_SMALL_CODE.
  (md_convert_frag_1): Likewise.
  (md_estimate_size_before_relax): Likewise.
2015-03-08 20:17:32 +00:00
Gunther Nikl f25adb075e Remove N_TEXT usage.
* gas/config/tc-m68k.c (N_TEXT): Delete.
  (md_convert_frag_1): Replace S_GET_TYPE check for N_TEXT with a check of
  S_GET_SEGMENT for text_segment.
2015-03-08 20:12:47 +00:00
Gunther Nikl a7120aeaef Fix N_WARNING .stabs handling.
* gas/config/obj-aout.h (N_REGISTER): Use 18 as fake N_TYPE for SEG_REGISTER.
* gas/config/obj-aout.c (N_TYPE_seg): Move SEG_REGISTER to its new position.
* gas/symbols.h (N_REGISTER): Do not redefine if already present.
2015-03-08 20:02:08 +00:00
Gunther Nikl f4a1fde5e7 * (amiga_write_object_contents): Use amiga_symbol macro.
* (amiga_slurp_relocs): Likewise.
2014-11-27 21:05:24 +00:00
Gunther Nikl 11b5fe1b1d * (amiga_write_object_contents): Fix HUNK_DEBUG size calculation for 64bit hosts.
The broken code used the wrong structure for the size calculation. This bug was
  hidden on 32bit hosts since both structures have the same size on such hosts.
  The AmigaOS program loader refuses to load programs with a defective structure.
2014-11-27 21:01:50 +00:00