gas/config/
authorSean Keys <skeys@ipdatasys.com>
Thu, 28 Jun 2012 21:36:35 +0000 (21:36 +0000)
committerSean Keys <skeys@ipdatasys.com>
Thu, 28 Jun 2012 21:36:35 +0000 (21:36 +0000)
* tc-xgate.h: Defined tc_frob_symbol.
* tc-xgate.c (xgate_frob_symbol): Wrote new function to mark
  symbols as being XGATE by setting st_target_internal value.

bfd/
* elf32-xgate.c (elf32_xgate_add_symbol_hook): Added a temp patch
  that forces st_target_internal to equal 1, since tc_frob_symbol
  seems to need adjusting.

bfd/elf32-xgate.c
gas/config/tc-xgate.c
gas/config/tc-xgate.h

index bd5ebc476d4fe843c1817e6769a8b0fdce769fa7..bd62438eff46649ce52f31559ad5353888b9beab 100644 (file)
@@ -529,12 +529,15 @@ stub_hash_newfunc (struct bfd_hash_entry *entry,
 bfd_boolean
 elf32_xgate_add_symbol_hook (bfd *abfd ATTRIBUTE_UNUSED,
                             struct bfd_link_info *info ATTRIBUTE_UNUSED,
-                            Elf_Internal_Sym *sym ATTRIBUTE_UNUSED,
+                            Elf_Internal_Sym *sym,
                             const char **namep ATTRIBUTE_UNUSED,
                             flagword *flagsp ATTRIBUTE_UNUSED,
                             asection **secp ATTRIBUTE_UNUSED,
                             bfd_vma *valp ATTRIBUTE_UNUSED)
 {
+  /* For some reason the st_target_internal value is not retained
+     after xgate_frob_symbol is called, hence this temp hack.  */
+  sym->st_target_internal = 1;
   return TRUE;
 }
 
index 29089c95707d1d1980a4131c6335f2c0ee6f1195..84bac42ec9c129c7b454ee93fc474908448cb3c1 100644 (file)
@@ -1410,3 +1410,24 @@ xgate_find_match (struct xgate_opcode_handle *opcode_handle,
 
   return NULL;
 }
+
+/* Because we are dealing with two different core that view the system
+   memory with different offsets, we must differentiate what core a
+   symbol belongs to, in order for the linker to cross-link.  */
+
+int
+xgate_frob_symbol (symbolS *sym)
+{
+  asymbol *bfdsym;
+  elf_symbol_type *elfsym;
+
+  bfdsym = symbol_get_bfdsym (sym);
+  elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
+
+  gas_assert(elfsym);
+
+  /* Mark the symbol as being *from XGATE  */
+  elfsym->internal_elf_sym.st_target_internal = 1;
+
+  return 0;
+}
index 7f414e5831c826d35b6531dbd883a2b3a8f9ac66..04349a7e3e01d555e43b0739165051c899a32b63 100644 (file)
@@ -105,6 +105,10 @@ extern int tc_xgate_fix_adjustable (struct fix *);
 #define elf_tc_final_processing        xgate_elf_final_processing
 extern void xgate_elf_final_processing (void);
 
+/* Mark the symbol as being from XGATE.  */
+#define tc_frob_symbol(sym, punt) punt = xgate_frob_symbol (sym)
+extern int xgate_frob_symbol (symbolS *);
+
 #if 0
 #define tc_print_statistics(FILE) xgate_print_statistics (FILE)
 extern void xgate_print_statistics (FILE *);
This page took 0.027398 seconds and 4 git commands to generate.