This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[patch] Minor improvements to elf_m68k_gc_sweep_hook().
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: binutils at sources dot redhat dot com
- Date: Thu, 08 Jan 2004 06:03:10 -0500 (EST)
- Subject: [patch] Minor improvements to elf_m68k_gc_sweep_hook().
Hi,
Attached is a patch to make minor improvements to
elf_m68k_gc_sweep_hook(). Specifically, we can terminate early if no
dynamic object is present. The patch also moves two variables to an
inner scope as they are used only there.
Built m68k-elf port. Committed as obvious.
Kazu Hirata
2004-01-08 Kazu Hirata <kazu@cs.umass.edu>
* elf32-m68k.c (elf_m68k_gc_sweep_hook): Terminate early
if no dynamic object is present. Declare r_symndx and h in an
inner scope.
Index: elf32-m68k.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m68k.c,v
retrieving revision 1.60
diff -u -r1.60 elf32-m68k.c
--- elf32-m68k.c 11 Nov 2003 13:32:37 -0000 1.60
+++ elf32-m68k.c 8 Jan 2004 10:50:43 -0000
@@ -817,26 +817,27 @@
struct elf_link_hash_entry **sym_hashes;
bfd_signed_vma *local_got_refcounts;
const Elf_Internal_Rela *rel, *relend;
- unsigned long r_symndx;
- struct elf_link_hash_entry *h;
bfd *dynobj;
asection *sgot;
asection *srelgot;
- symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
- sym_hashes = elf_sym_hashes (abfd);
- local_got_refcounts = elf_local_got_refcounts (abfd);
-
dynobj = elf_hash_table (info)->dynobj;
if (dynobj == NULL)
return TRUE;
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (abfd);
+ local_got_refcounts = elf_local_got_refcounts (abfd);
+
sgot = bfd_get_section_by_name (dynobj, ".got");
srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
relend = relocs + sec->reloc_count;
for (rel = relocs; rel < relend; rel++)
{
+ unsigned long r_symndx;
+ struct elf_link_hash_entry *h;
+
switch (ELF32_R_TYPE (rel->r_info))
{
case R_68K_GOT8: