* 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.
* 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.
* 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.
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.
* 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.
* 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.
where possible.
* bfd/amigaos.c (reloc_types array): Add HUNK_ABSRELOC16 and HUNK_RELRELOC32.
(determine_type): Update for layout change of reloc_types array.
* 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.
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.
[gas]
2010-09-09 Gunther Nikl <gnikl@users.sourceforge.net>
* gas/config/tc-m68k.c (tc_gen_reloc): Handle references to defined
weak symbols first if generating an a.out object.
2009-10-013 Vincent Riviere <vincent.riviere@freesbee.fr>
PR gas/3041
* config/tc-m68k.c (tc_gen_reloc): Fix addend for relocations
located in data section an referencing a weak symbol.
2007-05-15 Vincent Riviere <vincent.riviere@freesbee.fr>
PR gas/3041
* config/tc-m68k.c (relaxable_symbol): Make sure that the correct
addend is stored for relocs against weak symbols.
(md_apply_fix): So not loose track of addend for relocs against
weak symbols.
2007-05-03 Vincent Riviere <vincent.riviere@freesbee.fr>
Nick Clifton <nickc@redhat.com>
PR gas/3041
* config/tc-m68k.c (relaxable_symbol): Do not relax weak symbols.
(tc_gen_reloc): Adjust the addend of relocs against weak symbols.
(md_apply_fix): Put zero values into the frags referencing weak
symbols.
[bfd]
2007-05-03 Vincent Riviere <vincent.riviere@freesbee.fr>
Nick Clifton <nickc@redhat.com>
PR gas/3041
* aoutx.h (swap_std_reloc_out): Treat relocs against weak symbols
in the same way as relocs against external symbols.
Weak fixes for the non-bfd assembler:
* gas/config/tc-m68k.h (S_IS_WEAK): Define for !BFD_ASSEMBLER.
* gas/config/tc-m68k.c (tc_aout_fix_to_chars): Check weak symbol state.
* gas/write.c (fixup_segment): Treat a weak symbol as undefined.
"reloc_count". Better error message for a relocation against an omitted
section. Replace BFD_FAIL with "bfd_set_error/return FALSE" since linking
cannot succeed. Prevent a possible endless loop when writing relocations.
Fail link operation if not all relocations could be written.
to really catch an amiga link when computing maximal symbol alignment.
(_bfd_generic_link_add_one_symbol): Likewise. Add the same kludge to case
'BIG' as used for case 'COM'.
(link_add_symbols): New wrapper function to handle symbols the same way
as the amiga backend by using a generic linker function when doing a
final link. This makes --wrap option of ld work.
requested in that mask either signed or unsigned.
(amiga_perform_reloc): Test final relocation always signed. Request reading
the addend of baserel relocations as unsigned value. Note that this is not
always correct but should only be done for symbols that came from the same
unit as the relocation.
(aout_perform_reloc): Likewise.