amigaos-cross-toolchain/patches/binutils-2.14/bfd/aoutx.h.diff

62 lines
2.0 KiB
Diff

--- binutils-2.14/bfd/aoutx.h 2003-03-31 20:13:24.000000000 +0200
+++ binutils-2.14-patched/bfd/aoutx.h 2013-04-24 18:38:23.000000000 +0200
@@ -133,7 +133,8 @@
PARAMS ((bfd *));
static bfd_boolean translate_from_native_sym_flags
PARAMS ((bfd *, aout_symbol_type *));
-static bfd_boolean translate_to_native_sym_flags
+/*Amiga hack - used in amigaos.c, must be global */
+/*static*/ bfd_boolean translate_to_native_sym_flags
PARAMS ((bfd *, asymbol *, struct external_nlist *));
static void adjust_o_magic
PARAMS ((bfd *, struct internal_exec *));
@@ -1657,7 +1658,7 @@
/* Set the fields of SYM_POINTER according to CACHE_PTR. */
-static bfd_boolean
+/*static*/ bfd_boolean
translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer)
bfd *abfd;
asymbol *cache_ptr;
@@ -2067,10 +2068,26 @@
r_length = g->howto->size ; /* Size as a power of two. */
r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */
+#if 1
+ /* FIXME! "#if 1" is the wrong way to select this Amiga specific code. */
+ switch (bfd_asymbol_flavour(sym))
+ {
+ case bfd_target_amiga_flavour:
+ case bfd_target_aout_flavour:
+ r_baserel = (g->howto->type & 8) != 0;
+ r_jmptable = (g->howto->type & 16) != 0;
+ r_relative = (g->howto->type & 32) != 0;
+ break;
+ default:
+ r_baserel=r_jmptable=r_relative=0;
+ break;
+ }
+#else
/* XXX This relies on relocs coming from a.out files. */
r_baserel = (g->howto->type & 8) != 0;
r_jmptable = (g->howto->type & 16) != 0;
r_relative = (g->howto->type & 32) != 0;
+#endif
#if 0
/* For a standard reloc, the addend is in the object file. */
@@ -2369,8 +2386,12 @@
/* Base relative relocs are always against the symbol table,
regardless of the setting of r_extern. r_extern just reflects
whether the symbol the reloc is against is local or global. */
+#if 0
+ /* FIXME! "#if 0" is the wrong way to disable this code. See comment
+ earlier in file. */
if (r_baserel)
r_extern = 1;
+#endif
if (r_extern && r_index > symcount)
{