public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Delete unused functions from elf32-mips.c
@ 1999-09-27  4:26 Geoff Keating
  1999-09-27 12:36 ` Mark Mitchell
  1999-09-27 18:27 ` Ian Lance Taylor
  0 siblings, 2 replies; 3+ messages in thread
From: Geoff Keating @ 1999-09-27  4:26 UTC (permalink / raw)
  To: gavin, Mark Mitchell, binutils

I think these are obsolete.  They are certainly unused.

I'm not sure exactly who can approve changes to the sourceware
binutils; if Gavin or Mark could do this (at least for MIPS), it'd be
good to know as the current sequence of patches will not be the last.
I'm also not sure who can check stuff in.

Anyway, is the patch OK?

-- 
Geoffrey Keating <geoffk@cygnus.com>

===File ~/patches/cygnus/tx49-bin-delete.patch==============
md5sum: 701810431d1e9329 6763d9ed5133293c 195224
Index: binutils/bfd/ChangeLog
0a
Mon Sep 27 20:12:33 1999  Geoffrey Keating  <geoffk@cygnus.com>

	* elf32-mips.c (mips_elf_relocate_hi16): Unused, delete.
	(mips_elf_relocate_got_local): Unused, delete.
	(mips_elf_relocate_global_got): Unused, delete.

.
Changed files:
binutils/bfd/ChangeLog
binutils/bfd/elf32-mips.c
md5sum: 69a8865364de884b 965e5323396f23af 269102
--- /sloth/disk0/co/binutils-mainline/binutils/bfd/elf32-mips.c	Fri Aug 27 10:08:49 1999
+++ binutils/bfd/elf32-mips.c	Mon Sep 27 20:10:51 1999
@@ -124,14 +124,6 @@ static boolean mips_elf_is_local_label_n
 static struct bfd_hash_entry *mips_elf_link_hash_newfunc
   PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
 static int gptab_compare PARAMS ((const void *, const void *));
-static void mips_elf_relocate_hi16
-  PARAMS ((bfd *, Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_byte *,
-	   bfd_vma));
-static boolean mips_elf_relocate_got_local
-  PARAMS ((bfd *, bfd *, asection *, Elf_Internal_Rela *,
-	   Elf_Internal_Rela *, bfd_byte *, bfd_vma));
-static void mips_elf_relocate_global_got
-   PARAMS ((bfd *, Elf_Internal_Rela *, bfd_byte *, bfd_vma));
 static bfd_reloc_status_type mips16_jump_reloc
   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
 static bfd_reloc_status_type mips16_gprel_reloc
@@ -5013,124 +5005,6 @@ _bfd_mips_elf_final_link (abfd, info)
     }
 
   return true;
-}
-
-/* Handle a MIPS ELF HI16 reloc.  */
-
-static void
-mips_elf_relocate_hi16 (input_bfd, relhi, rello, contents, addend)
-     bfd *input_bfd;
-     Elf_Internal_Rela *relhi;
-     Elf_Internal_Rela *rello;
-     bfd_byte *contents;
-     bfd_vma addend;
-{
-  bfd_vma insn;
-  bfd_vma addlo;
-
-  insn = bfd_get_32 (input_bfd, contents + relhi->r_offset);
-
-  addlo = bfd_get_32 (input_bfd, contents + rello->r_offset);
-  addlo &= 0xffff;
-
-  addend += ((insn & 0xffff) << 16) + addlo;
-
-  if ((addlo & 0x8000) != 0)
-    addend -= 0x10000;
-  if ((addend & 0x8000) != 0)
-    addend += 0x10000;
-
-  bfd_put_32 (input_bfd,
-	      (insn & 0xffff0000) | ((addend >> 16) & 0xffff),
-	      contents + relhi->r_offset);
-}
-
-/* Handle a MIPS ELF local GOT16 reloc.  */
-
-static boolean
-mips_elf_relocate_got_local (output_bfd, input_bfd, sgot, relhi, rello,
-			     contents, addend)
-     bfd *output_bfd;
-     bfd *input_bfd;
-     asection *sgot;
-     Elf_Internal_Rela *relhi;
-     Elf_Internal_Rela *rello;
-     bfd_byte *contents;
-     bfd_vma addend;
-{
-  unsigned int assigned_gotno;
-  unsigned int i;
-  bfd_vma insn;
-  bfd_vma addlo;
-  bfd_vma address;
-  bfd_vma hipage;
-  bfd_byte *got_contents;
-  struct mips_got_info *g;
-
-  insn = bfd_get_32 (input_bfd, contents + relhi->r_offset);
-
-  addlo = bfd_get_32 (input_bfd, contents + rello->r_offset);
-  addlo &= 0xffff;
-
-  addend += ((insn & 0xffff) << 16) + addlo;
-
-  if ((addlo & 0x8000) != 0)
-    addend -= 0x10000;
-  if ((addend & 0x8000) != 0)
-    addend += 0x10000;
-
-  /* Get a got entry representing requested hipage.  */
-  BFD_ASSERT (elf_section_data (sgot) != NULL);
-  g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
-  BFD_ASSERT (g != NULL);
-
-  assigned_gotno = g->assigned_gotno;
-  got_contents = sgot->contents;
-  hipage = addend & 0xffff0000;
-
-  for (i = MIPS_RESERVED_GOTNO; i < assigned_gotno; i++)
-    {
-      address = bfd_get_32 (input_bfd, got_contents + i * 4);
-      if (hipage == (address & 0xffff0000))
-	break;
-    }
-
-  if (i == assigned_gotno)
-    {
-      if (assigned_gotno >= g->local_gotno)
-	{
-	  (*_bfd_error_handler)
-	    (_("more got entries are needed for hipage relocations"));
-	  bfd_set_error (bfd_error_bad_value);
-	  return false;
-	}
-
-      bfd_put_32 (input_bfd, hipage, got_contents + assigned_gotno * 4);
-      ++g->assigned_gotno;
-    }
-
-  i = - ELF_MIPS_GP_OFFSET (output_bfd) + i * 4;
-  bfd_put_32 (input_bfd, (insn & 0xffff0000) | (i & 0xffff),
-	      contents + relhi->r_offset);
-
-  return true;
-}
-
-/* Handle MIPS ELF CALL16 reloc and global GOT16 reloc.  */
-
-static void
-mips_elf_relocate_global_got (input_bfd, rel, contents, offset)
-     bfd *input_bfd;
-     Elf_Internal_Rela *rel;
-     bfd_byte *contents;
-     bfd_vma offset;
-{
-  bfd_vma insn;
-
-  insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
-  bfd_put_32 (input_bfd,
-	      (insn & 0xffff0000) | (offset & 0xffff),
-	      contents + rel->r_offset);
 }
 
 /* Returns the GOT section for ABFD.  */
============================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Delete unused functions from elf32-mips.c
  1999-09-27  4:26 Delete unused functions from elf32-mips.c Geoff Keating
@ 1999-09-27 12:36 ` Mark Mitchell
  1999-09-27 18:27 ` Ian Lance Taylor
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Mitchell @ 1999-09-27 12:36 UTC (permalink / raw)
  To: geoffk; +Cc: gavin, binutils

>>>>> "Geoff" == Geoff Keating <geoffk@ozemail.com.au> writes:

    Geoff> I think these are obsolete.  They are certainly unused.

    Geoff> I'm not sure exactly who can approve changes to the
    Geoff> sourceware binutils; if Gavin or Mark could do this (at
    Geoff> least for MIPS), it'd be good to know as the current
    Geoff> sequence of patches will not be the last.  I'm also not
    Geoff> sure who can check stuff in.

I certainly don't have the authority to review these patches.  Even
worse, I don't have the time, in general, to review MIPS binutils
patches. :-)

    Geoff> Anyway, is the patch OK?

I believe that Ian indicated at one point that the *assembler* might
make use of some of these functions.  I'm not sure I remember the
final result of that discussion; Ian's grasp of the big picture is
vast, and he's the one to ask.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Delete unused functions from elf32-mips.c
  1999-09-27  4:26 Delete unused functions from elf32-mips.c Geoff Keating
  1999-09-27 12:36 ` Mark Mitchell
@ 1999-09-27 18:27 ` Ian Lance Taylor
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Lance Taylor @ 1999-09-27 18:27 UTC (permalink / raw)
  To: geoffk; +Cc: gavin, mark, binutils

   Date: Mon, 27 Sep 1999 21:15:31 +1000
   From: Geoff Keating <geoffk@ozemail.com.au>

   I think these are obsolete.  They are certainly unused.

   I'm not sure exactly who can approve changes to the sourceware
   binutils; if Gavin or Mark could do this (at least for MIPS), it'd be
   good to know as the current sequence of patches will not be the last.
   I'm also not sure who can check stuff in.

   Anyway, is the patch OK?

This patch is OK.  I think I originally thought that these functions
were used by the old howto functions.  However, now I see that they
were only called by the old mips_elf_relocate_section function.  If
they are no longer called by anything, then it is OK by me to remove
them.

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-09-27 18:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-27  4:26 Delete unused functions from elf32-mips.c Geoff Keating
1999-09-27 12:36 ` Mark Mitchell
1999-09-27 18:27 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).