Wed Mar 27 10:43:34 1996 Ian Lance Taylor <ian@cygnus.com>
+ * coff-ppc.c (ppc_record_toc_entry): Put inside COFF_IMAGE_WITH_PE
+ ifdef. Remove unused variables.
+ (ppc_record_data_in_toc_entry): Ifdef out. Removed unused
+ variables.
+ (ppc_mark_symbol_as_glue): Put inside COFF_IMAGE_WITH_PE ifdef.
+ (get_symbol_value): Ifdef out.
+ (pe_ppc_reloc): Ifdef out. Remove unused variables.
+ (coff_ppc_relocate_section): Remove unused variables. Make
+ fprintf strings and argument types correspond. Put before_addr in
+ DEBUG_RELOC ifdef.
+ (ppc_reflo_reloc): Ifdef out.
+ (ppc_addr32nb_reloc): Ifdef out.
+ (ppc_coff_rtype2howto): Make fprintf strings and argument types
+ correspond.
+ (coff_ppc_rtype_to_howto): Likewise.
+ (ppc_coff_swap_sym_in_hook): Remove unused variables.
+
+ * peicode.h (pe_print_idata): Move otherwise unused variables into
+ the #ifdef where they are used. Always return a value.
+ (pe_print_edata): Change fprintf strings and add cast to make
+ fprintf strings correspond to actual types. Always return a
+ value.
+ (pe_print_pdata): Removed unused variable addr_value. Always
+ return a value.
+ (pe_print_reloc): Remove unused variable onaline. Make fprintf
+ strings and arguments correspond. Always return a value.
+
+ * elf32-ppc.c (ppc_elf_fake_sections): Return true.
+ (ppc_elf_finish_dynamic_symbol): Move definition of unused
+ variable rela inside #if 0 section where it is used.
+
* libhppa.h: Define HINLINE rather than INLINE. Define it to
extern inline if using gcc and to static INLINE otherwise. Change
all functions from static INLINE to HINLINE.
asection *section,
bfd *output_bfd,
char **error));
+#if 0
static bfd_reloc_status_type ppc_reflo_reloc PARAMS ((bfd *abfd,
arelent *reloc,
asymbol *symbol,
asection *section,
bfd *output_bfd,
char **error));
+#endif
static bfd_reloc_status_type ppc_pair_reloc PARAMS ((bfd *abfd,
arelent *reloc,
asymbol *symbol,
bfd *output_bfd,
char **error));
+#if 0
static bfd_reloc_status_type ppc_addr32nb_reloc PARAMS ((bfd *abfd,
arelent *reloc,
asymbol *symbol,
asection *section,
bfd *output_bfd,
char **error));
-
+#endif
static bfd_reloc_status_type ppc_section_reloc PARAMS ((bfd *abfd,
arelent *reloc,
asymbol *symbol,
}
}
+#ifdef COFF_IMAGE_WITH_PE
+
/* record a toc offset against a symbol */
static int
ppc_record_toc_entry(abfd, info, sec, sym, toc_kind)
int sym;
enum toc_type toc_kind;
{
- bfd_byte *t;
- bfd_byte *old_contents;
- asection *s;
- int element_size;
- int data;
- int offset;
struct ppc_coff_link_hash_entry *h;
- struct coff_symbol_struct *target;
int ret_val;
const char *name;
return ret_val;
}
+
+#endif /* COFF_IMAGE_WITH_PE */
+
+#if 0
+
/* FIXME: record a toc offset against a data-in-toc symbol */
/* Now, there is currenly some confusion on what this means. In some
compilers one sees the moral equivalent of:
int sym;
enum toc_type toc_kind;
{
- bfd_byte *t;
- bfd_byte *old_contents;
- asection *s;
- int element_size;
- int data;
- int offset;
struct ppc_coff_link_hash_entry *h = 0;
- struct coff_symbol_struct *target;
int ret_val;
const char *name;
return ret_val;
}
+#endif /* 0 */
+
+#ifdef COFF_IMAGE_WITH_PE
+
/* record a toc offset against a symbol */
static void
ppc_mark_symbol_as_glue(abfd, sym, rel)
return;
}
+#endif /* COFF_IMAGE_WITH_PE */
\f
+#if 0
+
/* Provided the symbol, returns the value reffed */
static long get_symbol_value PARAMS ((asymbol *));
return(relocation);
}
+#endif /* 0 */
+
/* Return true if this relocation should
appear in the output .reloc section. */
&& (howto->type != IMAGE_REL_PPC_TOCREL16_DEFN) ;
}
+#if 0
+
/* this function is in charge of performing all the ppc PE relocations */
/* Don't yet know if we want to do this this particular way ... (krk) */
/* FIXME: (it is not yet enabled) */
static boolean part1_consth_active = false;
static unsigned long part1_consth_value;
- unsigned long insn;
unsigned long sym_value;
- unsigned long unsigned_value;
unsigned short r_type;
- long signed_value;
-
unsigned long addr = reloc_entry->address ; /*+ input_section->vma*/
- bfd_byte *hit_data =addr + (bfd_byte *)(data);
fprintf(stderr, "pe_ppc_reloc (%s)\n", TARGET_LITTLE_NAME);
return(bfd_reloc_ok);
}
+#endif /* 0 */
+
/* The reloc processing routine for the optimized COFF linker. */
static boolean
unsigned short r_type = EXTRACT_TYPE (rel->r_type);
unsigned short r_flags = EXTRACT_FLAGS(rel->r_type);
- unsigned short junk = EXTRACT_JUNK (rel->r_type);
#ifdef DEBUG_RELOC
/* now examine flags */
bfd_get_filename(input_bfd),
input_section->name);
- fprintf(stderr,"sym %d (%s), r_vaddr %d (%x)\n",
- rel->r_symndx, my_name, rel->r_vaddr, rel->r_vaddr);
+ fprintf(stderr,"sym %ld (%s), r_vaddr %ld (%lx)\n",
+ rel->r_symndx, my_name, (long) rel->r_vaddr,
+ (unsigned long) rel->r_vaddr);
}
break;
case IMAGE_REL_PPC_IMGLUE:
if (coff_data(output_bfd)->pe)
{
+#ifdef DEBUG_RELOC
bfd_vma before_addr = addr;
+#endif
addr -= pe_data(output_bfd)->pe_opthdr.ImageBase;
#ifdef DEBUG_RELOC
fprintf(stderr,
else
{
fprintf(file,
- "**** global_toc_size %d(%x), thunk_size %d(%x)\n",
+ "**** global_toc_size %ld(%lx), thunk_size %ld(%lx)\n",
global_toc_size, global_toc_size, thunk_size, thunk_size);
cat = "Out of bounds!";
}
}
fprintf(file,
- " %04lx (%d)", t->offset, t->offset - 32768);
+ " %04lx (%d)", (unsigned long) t->offset, t->offset - 32768);
fprintf(file,
" %s %s\n",
cat, t->name);
{
unsigned short r_type = EXTRACT_TYPE (rel->r_type);
unsigned short r_flags = EXTRACT_FLAGS(rel->r_type);
- unsigned short junk = EXTRACT_JUNK (rel->r_type);
#ifdef DEBUG_RELOC
/* now examine flags */
}
}
}
+
+ return true;
}
#endif
return bfd_reloc_undefined;
}
+#if 0
+
static bfd_reloc_status_type
ppc_reflo_reloc (abfd,
reloc_entry,
return bfd_reloc_undefined;
}
+#endif
+
static bfd_reloc_status_type
ppc_pair_reloc (abfd,
reloc_entry,
return bfd_reloc_ok;
}
+#if 0
+
/* ADDR32NB : 32 bit address relative to the virtual origin. */
/* (On the alpha, this is always a linker generated thunk)*/
/* (i.e. 32bit addr relative to the image base) */
return bfd_reloc_ok;
}
+#endif
+
static bfd_reloc_status_type
ppc_secrel_reloc (abfd,
reloc_entry,
if ( r_type > MAX_RELOC_INDEX )
{
fprintf(stderr,
- "ppc_coff_rtype2howto: reloc index %d out of range [%d, %d]\n",
- internal->r_type, 0, MAX_RELOC_INDEX);
+ "ppc_coff_rtype2howto: reloc index %d out of range [%d, %ld]\n",
+ internal->r_type, 0, (long) MAX_RELOC_INDEX);
abort();
}
if ( r_type > MAX_RELOC_INDEX )
{
fprintf(stderr,
- "coff_ppc_rtype_to_howto: index %d out of range [%d, %d]\n",
- r_type, 0, MAX_RELOC_INDEX);
+ "coff_ppc_rtype_to_howto: index %d out of range [%d, %ld]\n",
+ r_type, 0, (long) MAX_RELOC_INDEX);
abort();
}
PTR ext1;
PTR in1;
{
- SYMENT *ext = (SYMENT *)ext1;
struct internal_syment *in = (struct internal_syment *)in1;
if (bfd_of_toc_owner != 0) /* we already have a toc, so go home */
{
flagword flags;
register asection *s;
- char *foo;
s = bfd_get_section_by_name ( abfd , TOC_SECTION_NAME);
if (s != NULL)